diff options
author | Determinant <[email protected]> | 2016-02-29 22:02:32 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2016-02-29 22:02:32 +0800 |
commit | e7c9175e1059a15720025a99ccdb35d5bf6dc30f (patch) | |
tree | 27f10d1f95116c9faf7b62a6524c235dd811aeb5 /kaldi_io/init.lua | |
parent | d9e03b7d2c14549ab480d5e3b31518be4cdc8eed (diff) | |
parent | 24d56605428467e604afded423ba2ff49f2644e3 (diff) |
Merge branch 'master' of https://github.com/sxkachilles/nerv-speech into sxkachilles-master
Conflicts:
kaldi_decode/src/Makefile
kaldi_io/src/cwrapper_kaldi.cpp
Diffstat (limited to 'kaldi_io/init.lua')
-rw-r--r-- | kaldi_io/init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kaldi_io/init.lua b/kaldi_io/init.lua index 2173230..751247a 100644 --- a/kaldi_io/init.lua +++ b/kaldi_io/init.lua @@ -41,6 +41,7 @@ function KaldiReader:__init(global_conf, reader_conf) end function KaldiReader:get_data() + local fail_to_read_alignment = false if self.feat_repo:is_end() then return nil end @@ -87,6 +88,9 @@ function KaldiReader:get_data() local lab_utter = repo:get_utter(self.feat_repo, feat_utter:nrow(), self.debug) + if lab_utter == nil then + fail_to_read_alignment = true + end res[id] = lab_utter end -- add corresponding lookup features @@ -110,5 +114,9 @@ function KaldiReader:get_data() -- move the pointer to next self.feat_repo:next() collectgarbage("collect") + if fail_to_read_alignment then + nerv.info("[kaldi] utterance %s alignment not found, skip it.", self.feat_repo:key()) + res = self:get_data() + end return res end |