Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Manishearth merged 2 commits intomasterfromdraft_detect_restriction_level
Jan 2, 2020

Conversation

@crlf0710
Copy link
Collaborator

This is a draft implementation. I implemented the algorithm itself, however there's aRecommended script concept which is defined in TR31. For now thisis_recommended() method is not defined.

@Manishearth
Copy link
Member

I'd have the APItake a RestrictionLevel and return bool instead

@crlf0710
Copy link
CollaboratorAuthor

OK. And where should we implement theis_recommended() API? Should we add it tounicode-script?

if !GeneralSecurityProfile::identifier_allowed(ch){
returnRestrictionLevel::Unrestricted;
}
if chasu32 >0x7F{
Copy link
Member

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

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok

let ch_set = ch.into();
set = set.intersect(ch_set);
if !ch_set.base.contains_script(Script::Latin){
exclude_latin_set.intersect(ch_set);
Copy link
Member

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

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

oops

@Manishearth
Copy link
Member

Yes, please add it to unicode-script. While you're at it can you split the publicintersect() method into aself -> Selfintersection() and a&mut selfintersect() orintersect_with()?

@crlf0710
Copy link
CollaboratorAuthor

ok. I'll create a branch and PR when i return from work today.

@ManishearthManishearthforce-pushed thedraft_detect_restriction_level branch fromfd51b23 tob80d8f1CompareJanuary 2, 2020 03:20
@Manishearth
Copy link
Member

I made the changes upstream.

crlf0710 reacted with thumbs up emoji

@ManishearthManishearth marked this pull request as ready for reviewJanuary 2, 2020 03:21
@ManishearthManishearth merged commitdca4718 intomasterJan 2, 2020
@ManishearthManishearth deleted the draft_detect_restriction_level branchJanuary 2, 2020 03:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ManishearthManishearthManishearth approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@crlf0710@Manishearth

[8]ページ先頭

©2009-2025 Movatter.jp