- Notifications
You must be signed in to change notification settings - Fork5
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Manishearth commentedJan 2, 2020
I'd have the APItake a RestrictionLevel and return bool instead |
crlf0710 commentedJan 2, 2020
OK. And where should we implement the |
src/mixed_script.rs Outdated
| if !GeneralSecurityProfile::identifier_allowed(ch){ | ||
| returnRestrictionLevel::Unrestricted; | ||
| } | ||
| if chasu32 >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 anintersection() andintersect_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
Manishearth commentedJan 2, 2020
Yes, please add it to unicode-script. While you're at it can you split the public |
crlf0710 commentedJan 2, 2020
ok. I'll create a branch and PR when i return from work today. |
fd51b23 tob80d8f1CompareManishearth commentedJan 2, 2020
I made the changes upstream. |
This is a draft implementation. I implemented the algorithm itself, however there's a
Recommendedscript concept which is defined in TR31. For now thisis_recommended()method is not defined.