summaryrefslogtreecommitdiff
path: root/kaldi_io
diff options
context:
space:
mode:
Diffstat (limited to 'kaldi_io')
-rw-r--r--kaldi_io/init.lua10
-rw-r--r--kaldi_io/src/cwrapper_kaldi.cpp2
-rw-r--r--kaldi_io/src/cwrapper_kaldi.h2
-rw-r--r--kaldi_io/src/init.c3
4 files changed, 9 insertions, 8 deletions
diff --git a/kaldi_io/init.lua b/kaldi_io/init.lua
index bec2589..5325630 100644
--- a/kaldi_io/init.lua
+++ b/kaldi_io/init.lua
@@ -21,16 +21,18 @@ function KaldiReader:__init(global_conf, reader_conf)
self.lab_repo = {}
if reader_conf.mlfs then
for id, mlf_spec in pairs(reader_conf.mlfs) do
- if mlf_spec.format == nil then
- nerv.error("format spec is expected for label %s", id)
+ if mlf_spec.targets_rspecifier == nil then
+ nerv.error("target spec is expected for label %s", id)
end
- self.lab_repo[id] = nerv.KaldiLabelRepo(mlf_spec.targets_rspecifier,
- mlf_spec.format)
+ self.lab_repo[id] = nerv.KaldiLabelRepo(mlf_spec.targets_rspecifier)
end
end
self.lookup_repo = {}
if reader_conf.lookup then
for id, lookup_spec in pairs(reader_conf.lookup) do
+ if lookup_spec.targets_rspecifier == nil then
+ nerv.error("target spec is expected for label %s", id)
+ end
if lookup_spec.map_rspecifier == nil then
nerv.error("map spec is expected for lookup %s", id)
end
diff --git a/kaldi_io/src/cwrapper_kaldi.cpp b/kaldi_io/src/cwrapper_kaldi.cpp
index 788128b..9cff12e 100644
--- a/kaldi_io/src/cwrapper_kaldi.cpp
+++ b/kaldi_io/src/cwrapper_kaldi.cpp
@@ -150,7 +150,7 @@ extern "C" {
kaldi::RandomAccessPosteriorReader *targets_reader;
};
- KaldiLabelRepo *kaldi_label_repo_new(const char *targets_rspecifier, const char *fmt) {
+ KaldiLabelRepo *kaldi_label_repo_new(const char *targets_rspecifier) {
KaldiLabelRepo *repo = new KaldiLabelRepo();
repo->targets_reader = new kaldi::RandomAccessPosteriorReader(string(targets_rspecifier));
return repo;
diff --git a/kaldi_io/src/cwrapper_kaldi.h b/kaldi_io/src/cwrapper_kaldi.h
index db20087..3b01ee1 100644
--- a/kaldi_io/src/cwrapper_kaldi.h
+++ b/kaldi_io/src/cwrapper_kaldi.h
@@ -18,7 +18,7 @@ extern "C" {
typedef struct KaldiLabelRepo KaldiLabelRepo;
- KaldiLabelRepo *kaldi_label_repo_new(const char *, const char *fmt);
+ KaldiLabelRepo *kaldi_label_repo_new(const char *);
Matrix *kaldi_label_repo_read_utterance(KaldiLabelRepo *repo, KaldiFeatureRepo *, int,
lua_State *L,
diff --git a/kaldi_io/src/init.c b/kaldi_io/src/init.c
index e8b4ea6..efe3ff7 100644
--- a/kaldi_io/src/init.c
+++ b/kaldi_io/src/init.c
@@ -99,8 +99,7 @@ static const luaL_Reg lookup_feat_repo_methods[] = {
static int label_repo_new(lua_State *L) {
const char *targets_rspecifier = luaL_checkstring(L, 1);
- const char *fmt = luaL_checkstring(L, 2);
- KaldiLabelRepo *repo = kaldi_label_repo_new(targets_rspecifier, fmt);
+ KaldiLabelRepo *repo = kaldi_label_repo_new(targets_rspecifier);
luaT_pushudata(L, repo, nerv_kaldi_label_repo_tname);
return 1;
}