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

detokenize and correct_spaces problem with hyphens and En dashes #51

Open
atlijas opened this issue Sep 17, 2024 · 0 comments
Open

detokenize and correct_spaces problem with hyphens and En dashes #51

atlijas opened this issue Sep 17, 2024 · 0 comments

Comments

@atlijas
Copy link

atlijas commented Sep 17, 2024

Using the newest version of Tokenizer, 3.4.5:

>>> from tokenizer import split_into_sentences, detokenize, tokenize, correct_spaces
# En dash and detokenize
>>> sent = 'Hamarinn dugir – og meira en það.'
>>> detokenize(tokenize(sent))
# Expected output: 'Hamarinn dugir – og meira en það.'
# Output: 'Hamarinn dugir–og meira en það.'

# En dash and correct_spaces
>>> s = list(split_into_sentences(sent))[0]
>>> correct_spaces(s)
# Expected output: 'Hamarinn dugir – og meira en það.'
# Output: 'Hamarinn dugir–og meira en það.'

# Hyphen and detokenize
>>> sent = 'Hamarinn dugir - og meira en það.'
>>> detokenize(tokenize(sent))
# Expected output: 'Hamarinn dugir - og meira en það.'
# Output: 'Hamarinn dugir-og meira en það.'

# Hyphen and correct_spaces
>>> s = list(split_into_sentences(sent))[0]
>>> correct_spaces(s)
# Expected output: 'Hamarinn dugir - og meira en það.'
# Output: 'Hamarinn dugir- og meira en það.'
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