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

Migrate to regex package #7

Closed
dveselov opened this issue Dec 26, 2016 · 2 comments
Closed

Migrate to regex package #7

dveselov opened this issue Dec 26, 2016 · 2 comments

Comments

@dveselov
Copy link
Contributor

For now tokenizer uses built-in re package for splitting sentences into separate words, but it can't handle some special cases, but regex package can do it right:

>>> text = 'тест ... 1 одiн, Леве́к'
>>> [x.group(0) for x in re.finditer('(\w+)', text)]
['тест', '1', 'одiн', 'Леве', 'к']
>>> [x.group(0) for x in regex.finditer('(\w+)', text)]
['тест', '1', 'одiн', 'Леве́к']
@dveselov dveselov changed the title Migrate to regex instead of re Migrate to regex package Dec 26, 2016
@dveselov
Copy link
Contributor Author

May be it not good idea, because regex package is C-based and PyPy platform'll get significant performance reduction.

@dveselov
Copy link
Contributor Author

Better solution found: prepare your texts (remove diacritics and so on) before passing it to parser, like I'm do in Pinkerton

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