Closed dbolton closed 13 years ago
It case it is helpful here is a list of punctuation that I am using to work around this issue (it includes non-English punctuation too):
,.?¿!¡;:'"‘’“”‚„‹›«»–— *†‡
Here's my actual line of code:
word = word.replace(/(^[,.?¿!¡;:'"‘’“”‚„‹›«»–— †‡]|[,.?¿!¡;:'"‘’“”‚„‹›«»–— †‡]$)/g,""); //trim off any punctuation (without removing apostrophes from the middle of the word)
I think, but I am not convinced, that removing all punctuation is outside the realm of what Typo should be doing. In looking through the source of Hunspell, I don't see any references to sanitizing words outside of leading/trailing whitespace and trailing periods: http://hunspell.cvs.sourceforge.net/viewvc/hunspell/hunspell/src/hunspell/hunspell.cxx?view=markup
I've not worked with spell checking before (from a programming side). So I don't know the expectations. Feel free to close if needed.
This is very much needed while implementing custom spell checkers and word suggestions. Any idea if this one is resolved or if there is any work around?
//sentence punctuation such as comma, colon, semi-colon, period, exclamation mark, question mark, etc. should be ignored var is_spelled_correctly = dictionary.check("word,") //should be true, but returns false