Skip to content

Allow CPT get_range() accept a value transformation fn as arg #1532

@echeran

Description

@echeran

In ICU's implementation of getRange() for a CodePointTrie, it allows an extra arg that is a function that transforms the trie values before computing ranges of code points sharing the same value (called ValueFilter in ICU4J, called UCPMapValueFilter in ICU4C). ICU uses this in various ways, such as for pulling out data for a single property out of a trie that efficiently stores data for multiple properties at once.

The port of getRange() in #1529 omits this argument, which returns the trie values as-is. Adding this functionality could have multiple benefits.

One thing that might need to be considered is the type of the transformation function arg (Fn trait?) and whether that has any implications (ex: FFI) that may have follow-on considerations.

@markusicu

Metadata

Metadata

Assignees

Labels

C-unicodeComponent: Props, sets, triesS-smallSize: One afternoon (small bug fix or enhancement)T-enhancementType: Nice-to-have but not requiredblockedA dependency must be resolved before this is actionable

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions