Skip to content
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

Split unfold functionality into separate type #3759

Merged
merged 16 commits into from
Aug 1, 2023

Conversation

Manishearth
Copy link
Member

@Manishearth Manishearth commented Aug 1, 2023

Part of #3234

(the first commit is a related minor change that I'm sneaking in)

Some things I'm not sure about:

  • CaseMapCloser vs CaseCloser (we had proposed the latter but it was an abrupt discussion due to time constraints and we didn't really discuss it)
  • Should we do this Borrow thing, or should we just have CaseCloser's methods take in an &CaseMapper as an argument

Whatever design we end up with here will probably be exactly what I do for titlecase as well!

ffi/diplomat/src/casemap.rs Outdated Show resolved Hide resolved
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
Comment on lines +152 to +153
/// In other words, this adds all strings/characters that this casemaps to, as
/// well as all characters that may casemap to this one.
Copy link
Member

Choose a reason for hiding this comment

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

Question: Does this include all case mapping operations, or only case folding?

Copy link
Member Author

Choose a reason for hiding this comment

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

all mapping

experimental/casemap/src/closer.rs Show resolved Hide resolved
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
experimental/casemap/src/casemapper.rs Outdated Show resolved Hide resolved
experimental/casemap/src/closer.rs Show resolved Hide resolved
self.cm.as_ref().add_case_closure(c, set);
}

/// Finds all characters and strings which may casemap to `s` and adds them to the set.
Copy link
Member

Choose a reason for hiding this comment

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

Question: does it also include all characters and strings which s casemaps to? Or only those which casemap to s?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, just the reverse

Comment on lines 194 to 198
/// let cm = CaseMapCloser::new();
/// let mut builder = CodePointInversionListBuilder::new();
/// let found = cm.add_string_case_closure("ffi", &mut builder);
/// assert!(found);
/// let set = builder.build();
Copy link
Member

Choose a reason for hiding this comment

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

Question: what happens if my string is ffiss? Do I get ffiss, ffiß, and ffiß all added to my set?

Copy link
Member Author

Choose a reason for hiding this comment

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

nothing, it's only for the atomic casemappings.

I don't think there's good terminology around this unfortunately.

ffi/diplomat/src/casemap.rs Outdated Show resolved Hide resolved
@Manishearth Manishearth requested review from sffc and removed request for robertbastian August 1, 2023 17:57
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
experimental/casemap/src/closer.rs Outdated Show resolved Hide resolved
sffc
sffc previously approved these changes Aug 1, 2023
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

LGTM modulo _to

@Manishearth Manishearth merged commit cc1b4a1 into unicode-org:main Aug 1, 2023
25 checks passed
@Manishearth Manishearth deleted the unfold-separate branch August 1, 2023 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants