npgall / concurrent-trees

Concurrent Radix and Suffix Trees for Java
Apache License 2.0
511 stars 82 forks source link

Custom Comparator<NodeCharacterProvider> #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to (be able to) set custom NodeCharacterProvider for locale sensitive 
Character comparison. I use RadixTree to provide autocompletion. Right now, 
RadixTree#getKeysStartingWith(CharSequence) returns keys in "not so useful" 
order.

NodeCharacterComparator, the only available comparator implementation, is only 
used only 10 times in whole source code. It should be relatively easy to 
substitute it with something configurable.

Original issue reported on code.google.com by michal.s...@gmail.com on 19 Jun 2015 at 9:44

GoogleCodeExporter commented 9 years ago
Hi Michal,

I'm open to making improvements, but I don't think I understand in enough 
detail what you are trying to do yet.

Could you provide a test case which shows what you are trying to do, and what 
you would like changed to allow it? You can find examples of the kind of test 
cases which would be useful in issue 2.

Thanks,
Niall

Original comment by ni...@npgall.com on 30 Jun 2015 at 10:54

GoogleCodeExporter commented 9 years ago
Hi!

I was thinking about application of collation rules for node's children 
sorting. While preparing tests, I realized that my proposition probably makes 
no sense.

Some rules assume equality between different chars (a=ä, o=ö ü=Ü), other 
use digraphs (ä=ae, ö=oem ü=ue)... It would require storing collation key 
instead of single characters (or even both at the same time).

I'm not really sure now If trie is best suited for the following type of 
sorting:
Müller, A. < Mueller, B. < Müller, C.
Maybe I'll figure out something, as I'm still working on this.

Right now, this issue may be considered to be invalid.

Thank you for your willingness!

Michal

Original comment by michal.s...@gmail.com on 1 Jul 2015 at 9:30

GoogleCodeExporter commented 9 years ago
No problem. I will close this for now then. If you figure it out, you can open 
another issue.

Original comment by ni...@npgall.com on 1 Jul 2015 at 6:25