diff options
author | Determinant <[email protected]> | 2015-06-21 22:58:50 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2015-06-21 22:58:50 +0800 |
commit | 331886e5995ba3ece4ae97f199b5d7ceea612080 (patch) | |
tree | ee1aeae37b7083494b03bf46089a9f800f5dacf1 | |
parent | aee0d372e6b06a217f24bea5c88962b97e0ca0eb (diff) |
add support: use -1 to denote the end of utterance in MLF
-rw-r--r-- | examples/tnet_preprocessing_example.lua | 4 | ||||
-rw-r--r-- | examples/tnet_preprocessing_example2.lua | 4 | ||||
-rw-r--r-- | tnet_io/KaldiLib/Labels.cc | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/examples/tnet_preprocessing_example.lua b/examples/tnet_preprocessing_example.lua index 5f20910..9e1c0ce 100644 --- a/examples/tnet_preprocessing_example.lua +++ b/examples/tnet_preprocessing_example.lua @@ -69,7 +69,7 @@ main:propagate({rearranged}, output) for i = 0, 157 - 10 do row_diff = input.trans[i] - output[1][i + 5] for j = 0, row_diff:ncol() - 1 do - nerv.utils.printf("%.8f ", row_diff[j]) + nerv.printf("%.8f ", row_diff[j]) end - nerv.utils.printf("\n") + nerv.printf("\n") end diff --git a/examples/tnet_preprocessing_example2.lua b/examples/tnet_preprocessing_example2.lua index 8e1bc85..1215b23 100644 --- a/examples/tnet_preprocessing_example2.lua +++ b/examples/tnet_preprocessing_example2.lua @@ -62,7 +62,7 @@ print(utter.ref) -- for i = 0, 157 - 10 do -- row_diff = input.trans[i] - utter.main_scp[i] -- for j = 0, row_diff:ncol() - 1 do --- nerv.utils.printf("%.8f ", row_diff[j]) +-- nerv.printf("%.8f ", row_diff[j]) -- end --- nerv.utils.printf("\n") +-- nerv.printf("\n") -- end diff --git a/tnet_io/KaldiLib/Labels.cc b/tnet_io/KaldiLib/Labels.cc index 1af4447..8b04cde 100644 --- a/tnet_io/KaldiLib/Labels.cc +++ b/tnet_io/KaldiLib/Labels.cc @@ -372,7 +372,10 @@ namespace TNet { //divide beg/end by sourceRate and round up to get interval of frames beg = (beg+sourceRate/2)/sourceRate; - end = (end+sourceRate/2)/sourceRate; + if (end == (unsigned long long)-1) + end = rDesired[prev].Rows(); + else + end = (end+sourceRate/2)/sourceRate; //beg = (int)round(beg / (double)sourceRate); //end = (int)round(end / (double)sourceRate); |