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

Fix custom dict error for unsupported tokenization engines #1066

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

wannaphong
Copy link
Member

Fixes #1065

Add error handling for unsupported custom dictionaries in word_tokenize function.

  • Add a check for unsupported engines in the word_tokenize function in pythainlp/tokenize/core.py.
  • Raise a NotImplementedError if custom_dict is passed to an unsupported engine such as attacut, icu, nercut, sefr_cut, tltk, and oskut.
  • Update the docstring for the word_tokenize function to reflect the changes.

Fixes #1065

Add error handling for unsupported custom dictionaries in `word_tokenize` function.

* Add a check for unsupported engines in the `word_tokenize` function in `pythainlp/tokenize/core.py`.
* Raise a `NotImplementedError` if `custom_dict` is passed to an unsupported engine such as `attacut`, `icu`, `nercut`, `sefr_cut`, `tltk`, and `oskut`.
* Update the docstring for the `word_tokenize` function to reflect the changes.
@coveralls
Copy link

Coverage Status

coverage: 52.714% (-0.1%) from 52.836%
when pulling 315fe43 on wannaphong/fix-custom-dict-error
into 3aa57c6 on dev.

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

Successfully merging this pull request may close these issues.

bug: Should raise error for using custom dict with unsupported word tokenization engine
2 participants