-
Notifications
You must be signed in to change notification settings - Fork 11
support DefineTokens with AloneTokenOption and IgnoreCaseTokenOption
#38
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
base: master
Are you sure you want to change the base?
support DefineTokens with AloneTokenOption and IgnoreCaseTokenOption
#38
Conversation
refactor: rename ignoreCaseAlphabet to upperCaseAlphabet for clarity
|
It doesn't work with unicode, but unicode one of the main feature. |
you mean IgnoreCase with unicode not work? I checked the encoding table. Both unicode and ascii have lowercase letters, and the difference is 32 |
How is the progress of the Unicode feature currently? |
|
I mean: |
|
The problem you mentioned does indeed exist. however, when the |
|
There is a new implementation method.
tokenizer.DefineTokens(HelloKey,[]string{"hello","哈喽"}, IgnoreCaseTokenOption) // panic , because "哈喽" is not alphabet |
This is a Breaking API change though (see: https://go.dev/blog/module-compatibility#adding-to-a-function). You should add a new function like |
AloneTokenOptionAfter defining the token, if there are consecutive letters after the token value, it will be split independently.
after
AloneTokenOptionOnly supports independent match
helloIgnoreCaseTokenOptionmake token value case-insensitive match (#12 )
use example: