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

Recursion bug found in EnglishTokenizer #1

Open
hankcs opened this issue Nov 25, 2021 · 0 comments
Open

Recursion bug found in EnglishTokenizer #1

hankcs opened this issue Nov 25, 2021 · 0 comments

Comments

@hankcs
Copy link

hankcs commented Nov 25, 2021

Some text in Wikipedia might trap the EnglishTokenizer into infinite recursion. E.g.,

from elit_tokenizer import EnglishTokenizer

tokenizer = EnglishTokenizer()
sentences = tokenizer.decode(
    '<graph>{"version":2,"width":440,"height":258,"data":[{"name":"table","values":[{"x":1801,"y":5},{"x":1881,"y":5},{"x":1901,"y":5},{"x":1911,"y":5},{"x":1921,"y":4},{"x":1951,"y":4},{"x":1961,"y":5},{"x":1971,"y":6},{"x":1981,"y":9},{"x":1991,"y":16},{"x":2001,"y":22},{"x":2011,"y":29}]}],"scales":[{"name":"x","type":"ordinal","range":"width","zero":false,"domain":{"data":"table","field":"x"}},{"name":"y","type":"linear","range":"height","nice":true,"domain":{"data":"table","field":"y"}}],"axes":[{"type":"x","scale":"x"},{"type":"y","scale":"y"}],"marks":[{"type":"rect","from":{"data":"table"},"properties":{"enter":{"x":{"scale":"x","field":"x"},"y":{"scale":"y","field":"y"},"y2":{"scale":"y","value":0},"fill":{"value":"steelblue"},"width":{"scale":"x","band":"true","offset":-1}}}}]}</graph>',
    segment=2)

Error log:
err.log

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