aboutsummaryrefslogtreecommitdiff
path: root/nerv/examples/lmptb/lmptb/lmvocab.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/examples/lmptb/lmptb/lmvocab.lua')
-rw-r--r--nerv/examples/lmptb/lmptb/lmvocab.lua12
1 files changed, 0 insertions, 12 deletions
diff --git a/nerv/examples/lmptb/lmptb/lmvocab.lua b/nerv/examples/lmptb/lmptb/lmvocab.lua
index 3d256c0..2ad0e7e 100644
--- a/nerv/examples/lmptb/lmptb/lmvocab.lua
+++ b/nerv/examples/lmptb/lmptb/lmvocab.lua
@@ -101,18 +101,6 @@ function Vocab:get_word_id(key)
return self.map_id(key)
end
---fh: file_handle
---Returns: a list of tokens(string) in the line, if there is no "</s>" at the end, the function will at it, if nothing to read, returns nil
-function Vocab:read_line(fh)
- local l_str = fh:read("*line")
- if (l_str == nil) then return nil end
- local list = mysplit(l_str)
- if (list[(#list)] ~= self.sen_end_token) then
- list[#list + 1] = self.sen_end_token
- end
- return list
-end
-
--fn: string
--Add all words in fn to the vocab
function Vocab:build_file(fn)