You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can we have the answer placed into grid same as what we see in answer dialog (yellow tick mark on the screen shot)?
When added to grid it is broken as per the consonant and associated character (HALANT or VIRAM sign)
Expected letter in grid is : क्षति
whereas Actual letters in grid : क ् ष त ि
Thanks and best regards,
Vidyesh.
The text was updated successfully, but these errors were encountered:
Hello HoldOffHunger,
Thanks for the reply.
I came across a function in python which uses the UNICODEDATA library.
This produces the desired result. That is breaking DEVANAGARI words into
*clusters*.
Attaching the function for reference and the URL.
Function splitclusters Taken from:
https://stackoverflow.com/questions/6805311/combining-devanagari-characters
Any idea of using a python library in jQuery?
Below are two libraries on:
1. https://github.com/mikekap/unicodedata2
2. https://github.com/iwsfutcmd/unicodedataplus
Can you simulate/ retro-fit above function in jQuery ?
Also, if it works, then there is a need to make the max-cell-width to
accommodate 3 characters.
How to increase this width, please guide.
*best regards,Vidyesh Ranade+91 9850 88 91 88*
import unicodedata, re
def splitclusters(s):
"""Generate the grapheme clusters for the string s. (Not the full
Unicode text segmentation algorithm, but probably good enough for
Devanagari.)
Function Taken from: https://stackoverflow.com/questions/6805311/combining-devanagari-characters
"""
virama = u'\N{DEVANAGARI SIGN VIRAMA}'
cluster = u''
last = None
for c in s:
cat = unicodedata.category(c)[0]
if cat == 'M' or cat == 'L' and last == virama:
cluster += c
else:
if cluster:
yield cluster
cluster = c
last = c
if cluster:
yield cluster
a = "बिक्रम मेरो नाम हो"
print (list(splitclusters(re.sub(r'\s', '', a))))
a = "क्षति"
print (list(splitclusters(re.sub(r'\s', '', a))))
Hello HoldOffHunger,
I am referring to the demo at this link for Hindi Language.
This is working absolutely correct. However, while reading the words from DEVNAGARI script (Used to write many Indic Languages) letters are formed with respective associated character (HALANT or VIRAM signs).
Demo URL: https://www.earthfluent.com/hindi/nouns-concepts-part-35/play.php?action=CrosswordPuzzle&previousquizzes=10
How can we have the answer placed into grid same as what we see in answer dialog (yellow tick mark on the screen shot)?
When added to grid it is broken as per the consonant and associated character (HALANT or VIRAM sign)
Expected letter in grid is : क्षति
whereas Actual letters in grid : क ् ष त ि
Thanks and best regards,
Vidyesh.
The text was updated successfully, but these errors were encountered: