Skip to content

Instantly share code, notes, and snippets.

@mohdsanadzakirizvi
Created January 10, 2020 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohdsanadzakirizvi/b48cb8ae8db62869d12dab0ca664ce85 to your computer and use it in GitHub Desktop.
Save mohdsanadzakirizvi/b48cb8ae8db62869d12dab0ca664ce85 to your computer and use it in GitHub Desktop.
from indicnlp.script import indic_scripts as isc
from indicnlp.script import phonetic_sim as psim
c1='क'
c2='ख'
c3='भ'
lang='hi'
print('Similarity between {} and {}'.format(c1,c2))
print(psim.cosine(
isc.get_phonetic_feature_vector(c1,lang),
isc.get_phonetic_feature_vector(c2,lang)
))
print(u'Similarity between {} and {}'.format(c1,c3))
print(psim.cosine(
isc.get_phonetic_feature_vector(c1,lang),
isc.get_phonetic_feature_vector(c3,lang)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment