-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] prepare_dict support english and chinese in one lexicon.txt #1693
Conversation
if word.encode('utf8').isalpha(): | ||
pieces = sp.EncodeAsPieces(word) | ||
else: | ||
pieces = word | ||
if contain_oov(pieces): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
em, where do you mean add comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# We assume that the lexicon does not contain code-switch, i.e., the word contains both English and Chinese.
# see PR https://github.com/wenet-e2e/wenet/pull/1693
# and Issue https://github.com/wenet-e2e/wenet/issues/1653
if word.encode('utf8').isalpha():
pieces = sp.EncodeAsPieces(word)
else:
pieces = word
please fix the lint problem. |
./tools/fst/prepare_dict.py:44:125: B950 line too long (124 > 80 characters) |
tools/fst/prepare_dict.py, it can't split chinese phrase into character when bpemodel given issus. Now It can process english and chinese in one lexicon.txt .