Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LINAGORA
L
LGS
Labs
kaldi-modelgen
Commits
2428cce8
Commit
2428cce8
authored
Dec 06, 2017
by
Abdelwahab HEBA
Browse files
Fix problem of gen pronunciation
parent
5f9e8281
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
local/prepare_dict.sh
local/prepare_dict.sh
+6
-5
No files found.
local/prepare_dict.sh
View file @
2428cce8
...
...
@@ -93,14 +93,15 @@ fi
if
[
$stage
-le
2
]
;
then
echo
"Combining the CMUdict pronunciations with the autogenerated ones ..."
awk
'NR==FNR{a[$1]=1; next} ($1 in a)'
$vocab
$cmudict_plain
|
\
cat
-
$dst_dir
/lexicon_autogen.txt |
sort
>
$lexicon_raw_nosil
||
exit
1
#awk 'NR==FNR{a[$1]=1; next} ($1 in a)' $vocab $cmudict_plain |\
# cat - $dst_dir/lexicon_autogen.txt | sort >$lexicon_raw_nosil || exit 1
cat
$cmudict_plain
$dst_dir
/lexicon_autogen.txt |
sort
>
$lexicon_raw_nosil
||
exit
1
raw_lex_size
=
$(
cat
$lexicon_raw_nosil
|
awk
'{print $1}'
|
sort
-u
|
wc
-l
)
vocab_size
=
$(
wc
-l
<
$vocab
)
# TODO Fixe problem
[[
"
$vocab_size
"
-eq
"
$raw_lex_size
"
]]
||
{
echo
"Inconsistent lexicon(
$raw_lex_size
) vs vocabulary(
$vocab_size
) size!"
;
exit
1
;
}
#
[[ "$vocab_size" -eq "$raw_lex_size" ]] || {
#
echo "Inconsistent lexicon($raw_lex_size) vs vocabulary($vocab_size) size!";
#
exit 1; }
echo
"Combined lexicon saved to '
$lexicon_raw_nosil
'"
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment