Recently I found myself needing to fetch name aliases for a given character and it was not implemented in rust-unic yet. So I implemented it and thought it might be good to merge it back.
In the unic-inspector app, if a character's Unicode name is not available, check if it has name abbreviations and fallback to the first name abbreviations if available, otherwise display <none>
Notes
All of the APIs return a vector of string references because the comments of NameAliases.txt mentions:
Parsers of this data file should take note that the same code point can (and does) occur more than once.
Some unic-inspector examples after the change:
$ unic-inspector \U0010\U000A\U0041\U007F\U0098\U0530
| U+0010 | DLE | Control
| U+000A | LF | Control
A | U+0041 | LATIN CAPITAL LETTER A | Uppercase_Letter
| U+007F | DEL | Control
| U+0098 | SOS | Control
| U+0530 | <none> | Unassigned
Didn't find a GitHub issue for name aliases but #127 might be related.
Recently I found myself needing to fetch name aliases for a given character and it was not implemented in rust-unic yet. So I implemented it and thought it might be good to merge it back.
Changes
NameAliasType
andname_aliases_of()
unic-inspector
app, if a character's Unicode name is not available, check if it has name abbreviations and fallback to the first name abbreviations if available, otherwise display<none>
Notes
All of the APIs return a vector of string references because the comments of
NameAliases.txt
mentions:Some
unic-inspector
examples after the change:Didn't find a GitHub issue for name aliases but #127 might be related.
This change is![Reviewable](https://reviewable.io/review_button.svg)