I am going about transliteration from one source language(input file) to a target language(target file) so I am checking for equivalent mappings in a dictionary in my source code, certain characters in the source code don’t have an equivalent mapping like comma(,) and all other such special symbols. How do I check if the character belongs to the dictionary for which I have an equivalent mapping and to even take care of those special symbols to be printed in the target file which don’t have an equivalent mapping in the dictionary. Thank you:).
I am going about transliteration from one source language(input file) to a target language(target
Share
I think you want something like this:
If there’s a translation in the dictionary (e.g. “&&” -> “and”), it will use that. Else it will translate to “transliteration unknown”.
Hope that helped.
EDIT: As LeafStorm suggested, a dictionary’s
getfunction can be used to simplify the above code. The code line in the loop would become