Skip to content
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

For some inputs, there is error message when calling dimsim.get_candidates #15

Open
tbright17 opened this issue May 16, 2022 · 0 comments

Comments

@tbright17
Copy link

tbright17 commented May 16, 2022

dimsim.get_candidates("大侠") works fine.
But when calling dimsim.get_candidates("龌龊"), it gives this error

Traceback (most recent call last):
  File "gen_sim_data.py", line 15, in <module>
    print(get_similar_phrase("龌龊"))
  File "gen_sim_data.py", line 8, in get_similar_phrase
    return dimsim.get_candidates(phrase, mode="simplified", theta=int(num_candid/2))[:-1]
  File "/usr/local/lib/python3.7/dist-packages/dimsim/core/model.py", line 80, in get_candidates
    candid = _get_close_pinyin_candids(word, theta)
  File "/usr/local/lib/python3.7/dist-packages/dimsim/core/model.py", line 109, in _get_close_pinyin_candids
    res.append(Pinyin(newPy))
  File "/usr/local/lib/python3.7/dist-packages/dimsim/utils/pinyin.py", line 15, in __init__
    self.pinyinRewrite()
  File "/usr/local/lib/python3.7/dist-packages/dimsim/utils/pinyin.py", line 41, in pinyinRewrite
    if 'v' in self.vowel:
TypeError: argument of type 'NoneType' is not iterable

any thoughts?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant