Unicode Normalization of Identifiers
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
Related to #2287
All identifiers must be normalized to the NFC form.
Normalization is used to treat equally strings which consists of different codepoints but practiaclly the same.
It is useful when a program is linked to other Rust libraries,
NFC Normalization takes two steps:
- Some kinds of characters are decomposed to one or multiple chatacters. (This is called NFD form)
- Then, some kinds of chatacters are composed to a single character. (This is called NFC form)
For example,
https://unicode.org/reports/tr15/images/UAX15-NormFig4.jpg
Implementation
Unicode data file parser
- written in python
- add type annotation for mypy
Decomposition
- recursive decomposition with Decompostion_Mapping
- algorithmic decomposition of Hangul
- sort characters with Canonical_Combining_Class
- algorithmic decomposition of Hangul
Composition
- recompose a starter with its following chartacters if composable
- do not recompose characters with the Composition_Exclusion property
- algorithmic composition of Hangul
Optimization
- quick check
- use trie for composition mapping table
- but the current implementation is not so slow
Tests
many testcases are needed!
Ref
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the Unicode data file parser and the decomposition and composition work described in the issue, including the linked implementation pull requests. Then assess the remaining optimization items, especially the quick check and composition mapping trie, and expand the unspecified test coverage. Done means identifiers are normalized to NFC and the needed normalization tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python, rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100