-
Notifications
You must be signed in to change notification settings - Fork 5
Implement detect restriction level #9
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
Conversation
I'd have the API take a RestrictionLevel and return bool instead |
OK. And where should we implement the |
src/mixed_script.rs
Outdated
if !GeneralSecurityProfile::identifier_allowed(ch) { | ||
return RestrictionLevel::Unrestricted; | ||
} | ||
if ch as u32 > 0x7F { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an is_ascii method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/mixed_script.rs
Outdated
let ch_set = ch.into(); | ||
set = set.intersect(ch_set); | ||
if !ch_set.base.contains_script(Script::Latin) { | ||
exclude_latin_set.intersect(ch_set); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intersect()
does not mutate.
Perhaps we should have an intersection()
and intersect_with()
pair of methods on unicode-script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
Yes, please add it to unicode-script. While you're at it can you split the public |
ok. I'll create a branch and PR when i return from work today. |
fd51b23
to
b80d8f1
Compare
I made the changes upstream. |
This is a draft implementation. I implemented the algorithm itself, however there's a
Recommended
script concept which is defined in TR31. For now thisis_recommended()
method is not defined.