Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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