summaryrefslogtreecommitdiff
path: root/kaldi_io/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'kaldi_io/init.lua')
-rw-r--r--kaldi_io/init.lua8
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