Skip to content

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

@tbright17

Description

@tbright17

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions