Looking for a way to search a dictionary using English and Devanagari script?
from bullshitter@lemmy.ml to programming@programming.dev on 27 Jun 2024 09:52
https://lemmy.ml/post/17353074

I want to create an incremental search function for a language. It has to show the same result when I use either Devnagri or English ( how it sounds) For example : ‘Kya’ should show क्या , ‘क्या’ should show क्या

Please suggest some guide or tutorial, I am okayish in programming and open to learning

Cheers.

#programming

threaded - newest

Dunstabzugshaubitze@feddit.org on 27 Jun 2024 10:55 next collapse

sounds like you want a MultiKeyMap and a way to store the data from which you build the map, so i’d suggest to look up that data structure. incremental search could than be implemented by filtering on the key sets or subsets of it.

DontNoodles@discuss.tchncs.de on 28 Jun 2024 09:36 collapse

I don’t think I’m getting it right, but isn’t it just a matter of checking the character set in the query and determining if it belongs to English or Devnagri part of Unicode and applying transliteration if the query is in English.

If you are looking for a self hosted Devnagri transliteration tool, look into AI4Bharat, a tool developed by IIT Madras.