summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kaldi_io/init.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/kaldi_io/init.lua b/kaldi_io/init.lua
index b66625e..a1496c4 100644
--- a/kaldi_io/init.lua
+++ b/kaldi_io/init.lua
@@ -54,6 +54,17 @@ function KaldiReader:get_data()
local lookup_utter = repo:get_utter(self.feat_repo,
transformed:nrow(),
self.debug)
+ local nrow = lookup_utter:nrow()
+ if nrow < transformed:nrow() then
+ -- repeat the last frame
+ local nlu = lookup_utter:create(transformed:nrow())
+ nlu:copy_from(lookup_utter, 0, nrow)
+ row = nlu[nrow - 1]
+ for i = 0, transformed:nrow() - nrow - 1 do
+ nlu:copy_from(nlu, nrow - 1, nrow, nrow + i)
+ end
+ lookup_utter = nlu
+ end
res[id] = lookup_utter
end
-- move the pointer to next