Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Common contractions are marked as misspelled #5

Closed
CharlieHess opened this issue Jan 13, 2015 · 8 comments
Closed

Common contractions are marked as misspelled #5

CharlieHess opened this issue Jan 13, 2015 · 8 comments

Comments

@CharlieHess
Copy link
Contributor

We're using the spellchecker module within the preload script of a renderer process, and have followed the basic steps for setting it up as the provider via web-frame.

However, it seems to break words at the apostrophe mark rather than process the complete contraction. I'm not sure if this is an issue with the dictionary or the affix file, but the result is undesirable:

Any ideas on what's happening?

@kevinsawicki
Copy link
Contributor

What platform is that screenshot from?

@CharlieHess
Copy link
Contributor Author

That's on OS X.

@kevinsawicki
Copy link
Contributor

Not sure how you are integrating but I'm not seeing the same results from the command line:

$ node
> s = require('./lib/spellchecker')
{ isMisspelled: [Function],
  getCorrectionsForMisspelling: [Function] }
> s.isMisspelled("doesn't")
false
> s.isMisspelled("would't")
false

Can you share the code of how you are calling it?

@kevinsawicki
Copy link
Contributor

/cc @zcbenz since he might have some insight if you are following the example from the <web-frame> doc.

@CharlieHess
Copy link
Contributor Author

global.spellChecker = require 'spellchecker'

...

require('web-frame').setSpellCheckProvider "en-US", false,
  spellCheck: (text) ->
    return true unless global.spellChecker?
    ret = not global.spellChecker.isMisspelled(text)
    logger.debug "Spell checking: #{text} returned: #{ret}"
    ret 

And the log file produces:

2015-01-13T23:16:20.701Z - debug: [main.coffee] - Spell checking: doesn returned: false
2015-01-13T23:16:20.707Z - debug: [main.coffee] - Spell checking: doesn returned: false
2015-01-13T23:16:22.702Z - debug: [main.coffee] - Spell checking: doesn returned: false
2015-01-13T23:16:22.706Z - debug: [main.coffee] - Spell checking: doesn returned: false
2015-01-13T23:16:28.142Z - debug: [main.coffee] - Spell checking: doesn't returned: true

So it's definitely getting the right result. But the input field in the renderer is out of sync (perhaps I should file this on atom-shell since this module seems to be behaving correctly 😅)

@zcbenz
Copy link
Contributor

zcbenz commented Jan 13, 2015

@CharlieHess Can you move this issue to atom-shell? I believe it is a bug of how we handle contractions.

@CharlieHess
Copy link
Contributor Author

@zcbenz Will do.

@kevinsawicki
Copy link
Contributor

Closing this out here.

soundar-m pushed a commit to soundar-m/node-spellchecker that referenced this issue May 15, 2020
commit 84b6708
Merge: fef5593 1a0243e
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 19:43:16 2019 -0700

    Merge pull request atom#6 from goddessfreya/goddessfreya-patch-1

    Add clang testing

commit 1a0243e
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 19:37:34 2019 -0700

    Update nodejs.yml

commit 18e838f
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 19:35:27 2019 -0700

    Delete package-lock.json

commit d17cf27
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 19:22:57 2019 -0700

    Update nodejs.yml

commit 81c5ae6
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 19:12:42 2019 -0700

    Update nodejs.yml

commit 2db0f18
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:56:33 2019 -0700

    Update nodejs.yml

commit 855c3c1
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:49:38 2019 -0700

    Update nodejs.yml

commit f80be0a
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:38:49 2019 -0700

    Update nodejs.yml

commit 3c52d66
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:35:04 2019 -0700

    Update nodejs.yml

commit 5fe3493
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:34:31 2019 -0700

    Update nodejs.yml

commit 8c41771
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:34:05 2019 -0700

    Update nodejs.yml

commit 5bd03fe
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:33:49 2019 -0700

    Update nodejs.yml

commit aab4c50
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:33:35 2019 -0700

    Update nodejs.yml

commit 0e6f86f
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:30:31 2019 -0700

    Update nodejs.yml

commit fef5593
Merge: 0c83612 e99e477
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:16:48 2019 -0700

    Merge pull request atom#5 from abetomo/fix_deprecated_callback

    Fix deprecated callback

commit 0c83612
Merge: 2c0d135 5cbdece
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:04:18 2019 -0700

    Merge pull request atom#4 from goddessfreya/Add-Github-actions

    Add Github actions

commit 5cbdece
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:01:01 2019 -0700

    Delete appveyor.yml

commit 4ddcbd3
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 18:00:49 2019 -0700

    Delete .travis.yml

commit c6f6c63
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 17:57:45 2019 -0700

    Update nodejs.yml

commit 84bccbd
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 17:55:23 2019 -0700

    Update nodejs.yml

commit f6720ea
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 17:50:59 2019 -0700

    Update nodejs.yml

commit 514a3f9
Author: Freya Gentz <zegentzy@protonmail.com>
Date:   Thu Dec 19 17:31:31 2019 -0700

    Add Github actions

commit e99e477
Author: abetomo <abe@enzou.tokyo>
Date:   Thu Jul 5 10:25:35 2018 +0900

    Fix deprecated callback

    The following warning.

    ```
    ../src/worker.cc: In member function ‘virtual void
    CheckSpellingWorker::HandleOKCallback()’:
    ../src/worker.cc:44:25: warning: ‘v8::Local<v8::Value>
    Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated
    [-Wdeprecated-declarations]
       callback->Call(2, argv);
    ```

Signed-off-by: Freya Gentz <zegentzy@protonmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants