What is the fastest transliteration strategy? Currently I generate a set of functions that translate each code point from one number system to another and then join them. Is there a faster/better method? Would using map lookups be faster? These would all be “small maps” (< 32 entries) since the set of digits is defined to be 0..9, +, -, \s, ., E
Also, remember, that both, 0-9 as well as ٠-٩ are arabic digits. The first is european or western style, the other one eastern style. Roman numerals are I, M, C, X, L, etc.
PS: The codesnippet is not tested, but should give you an idea. I’m pretty sure I got the quoting/unquoting wrong, as I do always
Thanks, much appreciated. This is basically what I’m doing now other than you’re using a binary comprehension which may be faster than joining at the end so I’ll benchmark the difference for sure.
There are about 80 different number systems I’m transliterating between. Most of them have digits 1…10 though a few have algorithmic transliteration (like the Hebrew numbering system). Fun with numbers!
Thanks! Thats very similar to my current implementation - I’ll need to run some benchmarks to check what works out to be best. At least you and @NobbZ are agreeing on using the multi-clause function approach which I’m also using.