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

Improve basic tokenizer #320

Open
jenstroeger opened this issue Jun 2, 2024 · 0 comments
Open

Improve basic tokenizer #320

jenstroeger opened this issue Jun 2, 2024 · 0 comments

Comments

@jenstroeger
Copy link

Environment

Python 3.10.14 (main, Mar 21 2024, 01:58:23) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin

Additional context

n/a

Steps to Reproduce

>>> list(enchant.tokenize.basic_tokenize("He’d said, “Hello”"))
[('He’d', 0), ('said', 5), ('“Hello”', 11)]

Expected behavior

>>> list(enchant.tokenize.basic_tokenize("He’d said, “Hello”"))
[('He’d', 0), ('said', 5), ('Hello', 12)]

Additional context

The tokenizer uses these characters when l/rstripping a word:

# Chars to remove from start/end of words
strip_from_start = '"' + "'`(["
strip_from_end = '"' + "'`]).!,?;:"

but I think “‘ and ”’ should also be considered.

Happy to provide a PR.

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