You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Description
Should raise an error when
custom_dict
is passed intoword_tokenizer
function but the selected engine is not supported custom_dictExpected results
Should either:
NotImplementedError
if the user passed in custom_dict to unsupported tokenizer enginesor
Current results
The current code completely ignores custom dict behavior when its engine not supported
pythainlp/pythainlp/tokenize/core.py
Lines 228 to 235 in 3aa57c6
Steps to reproduce
PyThaiNLP version
Commit hash 3aa57c6
Python version
all
Operating system and version
all
More info
No response
Possible solution
No response
Files
No response
The text was updated successfully, but these errors were encountered: