mugli / libavrophonetic

Go module providing classic (rule-based) and dictionary backed transliterators for Avro Phonetic
MIT License
21 stars 0 forks source link

Add comprehensive tests for classic phonetic #1

Open mugli opened 3 years ago

mugli commented 3 years ago

testdata.txt is just a placeholder now. Need to add comprehensive testcases to cover all the patterns and exceptions.

milon commented 2 years ago

One question bhai, why do you use a string for is completed value for the Trie Node instead of a boolean? Just curious.

mugli commented 2 years ago

Storing the complete word to avoid traversing and rebuilding them every time we reach a complete node. It saves both time and unnecessary allocation (lot of string concatenation). And since the complete words are saved anyway in the right nodes, we don't need another marker for that, saves at least a byte for each word.