Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Words with punctuation should not count as misspellings #1

Closed
dbolton opened this issue Apr 23, 2011 · 4 comments
Closed

Words with punctuation should not count as misspellings #1

dbolton opened this issue Apr 23, 2011 · 4 comments
Assignees

Comments

@dbolton
Copy link

dbolton commented Apr 23, 2011

//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

@ghost ghost assigned cfinke Apr 23, 2011
@dbolton
Copy link
Author

dbolton commented Apr 23, 2011

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)

@cfinke
Copy link
Owner

cfinke commented Apr 23, 2011

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

@dbolton
Copy link
Author

dbolton commented Apr 23, 2011

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.

@dbolton dbolton closed this as completed Apr 25, 2011
@Shiyazudeen
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants