twitter/twitter-cldr-rb — pull request #46 by KL-7 (2012-07-01 16:25:02+00:00)
Title: Add locale-specific tailoring for collation.

It's not yet ready to be merged, but I'd like to open a PR for review and discussion. Things that I think need to be done:

1. Tailoring resources for more locales should be added. For that I need to improve the [script](https://gist.github.com/069e012c2d8f1136f6b6) that I'm using for exporting CLDR tailoring data and processing it with ICU4J.

2. I'm going to extract `Collator#load_tailored_trie` method somewhere, most likely into the `TrieBuilder`.

3. It's the first implementation, so things are a little bit messy (including specs). I'm going to work on it and make everything cleaner and easier to read.

4. I started with completely copying all required contractions into the tailored trie, because it's the easiest solution. Maybe we can optimize it by referencing node in the default FCE table, but for some case this optimization can be quite complicated.

5. I'm a bit worried about the fact that `Collator.default_fce_trie` returns the whole FCE trie and makes it available for modification from the outside. As the whole system relies on this trie it sounds pretty dangerous. The problem is that we need it to be available inside a `Collator` instance (here we can make sure that the trie is not modified), but nowhere else.