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
I'm using hypher.js with transliterated Sanskrit, and it doesn't play well with characters such as ṇ, ṣ, ḍ, ṭ, etc. The problem seems to be the long regex used to split a string into words (line 107 of hypher.js). I guess your character class doesn't include the unicode ranges for underdot characters. I've replaced it with a simpler expression: var words = str.split(/([\s\n\r\t.,:;'"!?-])/g);
which matches word boundary characters instead of word characters. It works for me but it's not totally comprehensive... you would have to add a few more boundary characters to it to make it work for more languages...
The text was updated successfully, but these errors were encountered:
Hi,
I'm using hypher.js with transliterated Sanskrit, and it doesn't play well with characters such as ṇ, ṣ, ḍ, ṭ, etc. The problem seems to be the long regex used to split a string into words (line 107 of hypher.js). I guess your character class doesn't include the unicode ranges for underdot characters. I've replaced it with a simpler expression:
var words = str.split(/([\s\n\r\t.,:;'"!?-])/g);
which matches word boundary characters instead of word characters. It works for me but it's not totally comprehensive... you would have to add a few more boundary characters to it to make it work for more languages...
The text was updated successfully, but these errors were encountered: