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

Don't show numbers as spelling errors #34

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

edemaine
Copy link

This is a fix for #32. I just check whether the word matches /^[0-9]+$/ and ignore it if so.

Along the way, I cleaned up the tokenizer to use regular expressions to detect word characters. This has two advantages:

  • Simpler code.
  • More efficient. Old code was checking "very long string".includes which will check against each character individually. Regular expressions should (I think) build a map to check for matching characters. Also, regular expressions should allow us to read the entire word at once instead of character by character.

@edemaine
Copy link
Author

edemaine commented Jan 17, 2017

By the way, the checks report 'customWords' is assigned a value but never use but this was true in the original code. I assume you were in the middle of implementing #16.

stream.next();
}

if(CodeMirrorSpellChecker.typo && !CodeMirrorSpellChecker.typo.check(word) && !~customWords.indexOf(word))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you removed the one line that used customWords.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, indeed! Sorry about that. I put it back.

@WesCossick
Copy link
Member

Thanks for making the change. One last thing—can you set up a JSFiddle to demonstrate this change?

@alexrothenberg
Copy link

any updates on getting this merged and released?

@edemaine
Copy link
Author

edemaine commented May 1, 2017

I couldn't figure out how to get a JSFiddle working...

@edemaine
Copy link
Author

At long last, here is a working CodePen: https://codepen.io/edemaine/pen/QoooOa

I had to update a few more things to get this working again:

  • The existing customWords code was broken in the case that customWords weren't specified.
  • gulp needed an explicit (older) version to work.
  • Some small lint updates.

Hopefully this can now be merged. @WesCossick if you'd rather hand off maintenance, I could try.

@kaleemullah
Copy link

Hey @WesCossick
Can you please look into this?
Thank you!

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

Successfully merging this pull request may close these issues.

4 participants