diff options
author | Determinant <[email protected]> | 2016-03-16 17:53:39 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2016-03-16 17:53:39 +0800 |
commit | 289ac7f4b6e88b935da5c891e1efcf91fc047403 (patch) | |
tree | d4fc3a4fc20f2d5908624b3f6587ecd57966d719 /nerv/init.lua | |
parent | 07fc1e2794027d44c255e1062c4491346b101a08 (diff) |
merge seq_buffer and change asr_trainer.lua accordingly
Diffstat (limited to 'nerv/init.lua')
-rw-r--r-- | nerv/init.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nerv/init.lua b/nerv/init.lua index ff944b8..439a83e 100644 --- a/nerv/init.lua +++ b/nerv/init.lua @@ -109,7 +109,7 @@ function table.val_to_str(v) (("number" == type(v) or "string" == type(v) or "boolean" == type(v)) and tostring(v)) or - nil -- failed to serialize + "" -- failed to serialize end end @@ -226,7 +226,8 @@ function nerv.parse_args(argv, options, unordered) local opt_type = v[3] local opt_meta = {type = opt_type, desc = v.desc or "", - val = v.default} + val = v.default, + specified = false} if opt_short ~= nil then if type(opt_short) ~= "string" or #opt_short ~= 1 then err() end if opt_type ~= "boolean" then @@ -246,6 +247,7 @@ function nerv.parse_args(argv, options, unordered) for c in k:gmatch"." do if sopts[c] then sopts[c].val = true + sopts[c].specified = true else nerv.error("invalid option -%s", c) end @@ -262,6 +264,7 @@ function nerv.parse_args(argv, options, unordered) k, opts[k].type) else opts[k].val = true + opts[k].specified = true end else local k, v = token:match(opt_with_val_exp) @@ -269,6 +272,7 @@ function nerv.parse_args(argv, options, unordered) if opts[k] == nil then nerv.error("invalid option %s", token) end + opts[k].specified = true if opts[k].type == "boolean" then if v == "yes" then opts[k].val = true |