We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>>> import regex as re >>> gpt2pat = re.compile(r"""'(?i:[sdmt]|ll|ve|re)|[^\r\n\p{L}\p{N}]?+\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]++[\r\n]*|\s*[\r\n]|\s+(?!\S)|\s+""" ) >>> str = r"""हहिन्दी विकिपीडिया""" >>> print (re.findall(gpt2pat, str )) ['हह', 'िन', '्द', 'ी', ' व', 'िक', 'िप', 'ीड', 'िय', 'ा']
The above got broken at every vovel combining mark It can be fixed by including \p{M} wherever there is \p{L} in the regular expression
>>> gpt2pat = re.compile(r"""'(?i:[sdmt]|ll|ve|re)|[^\r\n\p{L}\p{N}]?+[\p{L}\p{M}]+|\p{N}{1,3}| ?[^\s\p{L}\p{M}\p{N}]++[\r\n]*|\s*[\r\n]|\s+(?!\S)|\s+""" ) >>> print (re.findall(gpt2pat, str )) ['हहिन्दी', ' विकिपीडिया']
The above correctly split at word boundaries
The text was updated successfully, but these errors were encountered:
#71
Sorry, something went wrong.
Ack from tiktoken that they got it wrong. openai/tiktoken#292
@karpathy can you please review?
No branches or pull requests
The above got broken at every vovel combining mark
It can be fixed by including \p{M} wherever there is \p{L} in the regular expression
The above correctly split at word boundaries
The text was updated successfully, but these errors were encountered: