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

Spellchecker in Markdown and Heading cells #3216

Closed
damianavila opened this Issue Apr 24, 2013 · 44 comments

Comments

Projects
None yet
@damianavila
Contributor

damianavila commented Apr 24, 2013

I would be great to have a spellchecker in text cells: headings and markdown cells...
Currently in Chrome and Firefox under Linux I have the "native" browser spellchecker not working. I think the problem is that Codemirror is filtering the cell content to not be spellcheked, but I would be great to have it functional... If we let the "native" spellchecker to do the job in text cells, we don't have to care about different languages and so on because it is a user configurable option at the browser level...
What do you think about that?

Damián.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau May 1, 2013

Member

I'm not sure it is possible, because the 'real' input area is hidden. I might be wrong though.
If it works I'm neutral, because my spell checker is french, and I write ipynb in english, so everything would be red.

Member

Carreau commented May 1, 2013

I'm not sure it is possible, because the 'real' input area is hidden. I might be wrong though.
If it works I'm neutral, because my spell checker is french, and I write ipynb in english, so everything would be red.

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk May 1, 2013

Member

I think it is possible, because not long ago we had a bug where we failed to disable autocorrect, which I believe is a sibling functionality.

Member

minrk commented May 1, 2013

I think it is possible, because not long ago we had a bug where we failed to disable autocorrect, which I believe is a sibling functionality.

@damianavila

This comment has been minimized.

Show comment
Hide comment
@damianavila

damianavila May 2, 2013

Contributor

@Carreau , in the browser, you would choose the default language for the
spellchecker, so if you write in english, you could set up the
spellchecker in english, but when you write in french, you would like to
had it set up in french, in this way nothing but errors would be red...

Contributor

damianavila commented May 2, 2013

@Carreau , in the browser, you would choose the default language for the
spellchecker, so if you write in english, you could set up the
spellchecker in english, but when you write in french, you would like to
had it set up in french, in this way nothing but errors would be red...

@damianavila

This comment has been minimized.

Show comment
Hide comment
@damianavila

damianavila May 2, 2013

Contributor

@minrk yeah, I remember that issue... maybe it is possible...

Contributor

damianavila commented May 2, 2013

@minrk yeah, I remember that issue... maybe it is possible...

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jun 18, 2014

Contributor

Here is a method described for adding spelling checker to codemirror:

http://stackoverflow.com/questions/12343922/codemirror-with-spell-checker

Contributor

dsblank commented Jun 18, 2014

Here is a method described for adding spelling checker to codemirror:

http://stackoverflow.com/questions/12343922/codemirror-with-spell-checker

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jun 18, 2014

Contributor

Here is a server-side solution:

https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/aspell

But this is more complicated than just doing it in-browser. Might have security issues, too (eg, everything you type is being checked over a communication channel). Also, makes setting up an IPython server more complicated.

Contributor

dsblank commented Jun 18, 2014

Here is a server-side solution:

https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/aspell

But this is more complicated than just doing it in-browser. Might have security issues, too (eg, everything you type is being checked over a communication channel). Also, makes setting up an IPython server more complicated.

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jul 2, 2014

Contributor

Some ideas:

  1. Allow spelling checking in the Raw format cell. It doesn't do anything other than allow text, so why not just make it a text field with browser's default spelling checker? Then one can switch back and forth (from code/markdown to Raw) to do spell check.

  2. It appears that CodeMirror is responsible for the live typing format of markdown cells. Add typo.js (or something) per stack overflow question above.

  3. Markdown live typing formatting doesn't add that much (formats strings, lists, and ...?) Why not just make the Markdown cells be text fields (much like this comment box on GitHub)?

Contributor

dsblank commented Jul 2, 2014

Some ideas:

  1. Allow spelling checking in the Raw format cell. It doesn't do anything other than allow text, so why not just make it a text field with browser's default spelling checker? Then one can switch back and forth (from code/markdown to Raw) to do spell check.

  2. It appears that CodeMirror is responsible for the live typing format of markdown cells. Add typo.js (or something) per stack overflow question above.

  3. Markdown live typing formatting doesn't add that much (formats strings, lists, and ...?) Why not just make the Markdown cells be text fields (much like this comment box on GitHub)?

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Jul 2, 2014

Member

It doesn't do anything other than allow text, so why not just make it a text field with browser's default spelling checker?

The raw cell contains raw nbconvert output format, so it contains raw source code, in any of rst, latex, etc.

Member

minrk commented Jul 2, 2014

It doesn't do anything other than allow text, so why not just make it a text field with browser's default spelling checker?

The raw cell contains raw nbconvert output format, so it contains raw source code, in any of rst, latex, etc.

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jul 2, 2014

Contributor

Couldn't we make a distinction between editing the raw cell and seeing it formatted (executed), just like every other cell type? That way, editing the cell could be done in a text box (spell checking), and then shown as it is now (formatted).

Contributor

dsblank commented Jul 2, 2014

Couldn't we make a distinction between editing the raw cell and seeing it formatted (executed), just like every other cell type? That way, editing the cell could be done in a text box (spell checking), and then shown as it is now (formatted).

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Jul 2, 2014

Member

The entire point of the raw cell is that the frontend doesn't understand the rendered form, so it's raw input only, and never rendered. Spell checking is okay, as long as you don't mind it spell checking code keywords, etc.

Member

minrk commented Jul 2, 2014

The entire point of the raw cell is that the frontend doesn't understand the rendered form, so it's raw input only, and never rendered. Spell checking is okay, as long as you don't mind it spell checking code keywords, etc.

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jul 2, 2014

Contributor

@minrk Ok, so one wouldn't normally want to see spell checking on raw cell text. Perhaps this could be an toggle option: "Spell check raw cells". When that is active, raw cells would use a text box.

Or we could do this same for Markdown cells. But then when not checked, there would be no formatting.

Contributor

dsblank commented Jul 2, 2014

@minrk Ok, so one wouldn't normally want to see spell checking on raw cell text. Perhaps this could be an toggle option: "Spell check raw cells". When that is active, raw cells would use a text box.

Or we could do this same for Markdown cells. But then when not checked, there would be no formatting.

@asmeurer

This comment has been minimized.

Show comment
Hide comment
@asmeurer

asmeurer Jul 2, 2014

Contributor

If you don't want to see spell checking, you can disable it.

If you must have a spell check option you could make it always a text box, but change the spell check setting for it (I don't know what this is called, but there's a way to indicate to the browser that a text box should not be spell checked).

Contributor

asmeurer commented Jul 2, 2014

If you don't want to see spell checking, you can disable it.

If you must have a spell check option you could make it always a text box, but change the spell check setting for it (I don't know what this is called, but there's a way to indicate to the browser that a text box should not be spell checked).

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jul 30, 2014

Contributor

Spell check has now been implemented in JavaScript. Install with:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

and add to custom.js or %%javascript call:

IPython.load_extensions('calico-spell-check');

[fixed typo in above]

Stats:

Should consider to be added to IPython... this will change the way that you write notebooks, in my humble opinion :)

Contributor

dsblank commented Jul 30, 2014

Spell check has now been implemented in JavaScript. Install with:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

and add to custom.js or %%javascript call:

IPython.load_extensions('calico-spell-check');

[fixed typo in above]

Stats:

Should consider to be added to IPython... this will change the way that you write notebooks, in my humble opinion :)

@rcrehuet

This comment has been minimized.

Show comment
Hide comment
@rcrehuet

rcrehuet Oct 16, 2014

@dsblank I've installed the extension, but when I run in an IPython cell:

%%javascript
IPython.install_extensions('calico-spell-check');

I get the following error:

Javascript error adding output!
TypeError: IPython.install_extensions is not a function
See your browser Javascript console for more details.

What am I doing wrong?

rcrehuet commented Oct 16, 2014

@dsblank I've installed the extension, but when I run in an IPython cell:

%%javascript
IPython.install_extensions('calico-spell-check');

I get the following error:

Javascript error adding output!
TypeError: IPython.install_extensions is not a function
See your browser Javascript console for more details.

What am I doing wrong?

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 16, 2014

Contributor

What version of IPython is this? Note that once you get this part working, there is a bug for IPython 2.x. I'll try to fix that today.

Contributor

dsblank commented Oct 16, 2014

What version of IPython is this? Note that once you get this part working, there is a bug for IPython 2.x. I'll try to fix that today.

@rcrehuet

This comment has been minimized.

Show comment
Hide comment
@rcrehuet

rcrehuet Oct 16, 2014

You're right. I'm using IPython 2.0.0 So I need to upgrade?
I have now upgraded to the latest stable version, but it is 2.3.0, which means I still in the 2.x an the error remains...

rcrehuet commented Oct 16, 2014

You're right. I'm using IPython 2.0.0 So I need to upgrade?
I have now upgraded to the latest stable version, but it is 2.3.0, which means I still in the 2.x an the error remains...

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 16, 2014

Contributor

Looks like you do need to upgrade. And I just fixed the issue for 2.2, so please execute this line again:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
Contributor

dsblank commented Oct 16, 2014

Looks like you do need to upgrade. And I just fixed the issue for 2.2, so please execute this line again:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
@rcrehuet

This comment has been minimized.

Show comment
Hide comment
@rcrehuet

rcrehuet Oct 16, 2014

I'm sorry, but using ipython 2.3.0 I still get the same error. Here is the full output from the web console, in case it helps.

TypeError: IPython.install_extensions is not a function
Stack trace:
@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f line 564 > eval:1:1
IPython</append_javascript@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:564:13
IPython</OutputArea.prototype.append_mime_type@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:522:32
IPython</OutputArea.prototype.append_display_data@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:488:13
IPython</OutputArea.prototype.append_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:306:13
IPython</OutputArea.prototype.handle_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:234:9
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_output_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:583:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_iopub_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:594:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486

rcrehuet commented Oct 16, 2014

I'm sorry, but using ipython 2.3.0 I still get the same error. Here is the full output from the web console, in case it helps.

TypeError: IPython.install_extensions is not a function
Stack trace:
@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f line 564 > eval:1:1
IPython</append_javascript@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:564:13
IPython</OutputArea.prototype.append_mime_type@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:522:32
IPython</OutputArea.prototype.append_display_data@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:488:13
IPython</OutputArea.prototype.append_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:306:13
IPython</OutputArea.prototype.handle_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:234:9
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_output_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:583:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_iopub_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:594:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 16, 2014

Contributor

Could be using older Javascript cached in browser.

Can you try clearing/refreshing your browser cache (shift+reload maybe)? Or
try accessing the page from a secure browser window (eg, "New incognito
window" in Chrome).

On Thu, Oct 16, 2014 at 11:44 AM, Ramon Crehuet notifications@github.com
wrote:

I'm sorry, but using ipython 2.3.0 I still get the same error. Here is the
full output from the web console, in case it helps.

TypeError: IPython.install_extensions is not a function
Stack trace:
@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f line 564 > eval:1:1
IPython</append_javascript@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:564:13
IPython</OutputArea.prototype.append_mime_type@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:522:32
IPython</OutputArea.prototype.append_display_data@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:488:13
IPython</OutputArea.prototype.append_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:306:13
IPython</OutputArea.prototype.handle_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:234:9
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_output_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:583:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_iopub_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:594:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486


Reply to this email directly or view it on GitHub
#3216 (comment).

Contributor

dsblank commented Oct 16, 2014

Could be using older Javascript cached in browser.

Can you try clearing/refreshing your browser cache (shift+reload maybe)? Or
try accessing the page from a secure browser window (eg, "New incognito
window" in Chrome).

On Thu, Oct 16, 2014 at 11:44 AM, Ramon Crehuet notifications@github.com
wrote:

I'm sorry, but using ipython 2.3.0 I still get the same error. Here is the
full output from the web console, in case it helps.

TypeError: IPython.install_extensions is not a function
Stack trace:
@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f line 564 > eval:1:1
IPython</append_javascript@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:564:13
IPython</OutputArea.prototype.append_mime_type@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:522:32
IPython</OutputArea.prototype.append_display_data@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:488:13
IPython</OutputArea.prototype.append_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:306:13
IPython</OutputArea.prototype.handle_output@http://localhost:8889/static/notebook/js/outputarea.js?v=b7a027e8d15c522578a4142b8342789f:234:9
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_output_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:583:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486
IPython</Kernel.prototype._handle_iopub_message@http://localhost:8889/static/services/kernels/js/kernel.js?v=4f7e3edf038579ed584b87f5c10a24ad:594:13
.proxy/i@http://localhost:8889/static/components/jquery/jquery.min.js?v=ccd0edd113b78697e04fb5c1b519a5cd:4:5486


Reply to this email directly or view it on GitHub
#3216 (comment).

@rcrehuet

This comment has been minimized.

Show comment
Hide comment
@rcrehuet

rcrehuet Oct 17, 2014

I'm sorrt but I cannot make it work. I must be missing something because the problem is not that it doesn't find the extension, the problem is that IPython.install_extensions is not defined as a javascript function. That is, I get the same error whether the argument I put in that funcion is calico-spell-check or foo.

rcrehuet commented Oct 17, 2014

I'm sorrt but I cannot make it work. I must be missing something because the problem is not that it doesn't find the extension, the problem is that IPython.install_extensions is not defined as a javascript function. That is, I get the same error whether the argument I put in that funcion is calico-spell-check or foo.

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 17, 2014

Contributor

Oh, sorry! I had a typo above. The Javascript is:

IPython.load_extensions("calico-spell-check");

(that is load not install). I'm very sorry that I made that, and then didn't catch it.

Contributor

dsblank commented Oct 17, 2014

Oh, sorry! I had a typo above. The Javascript is:

IPython.load_extensions("calico-spell-check");

(that is load not install). I'm very sorry that I made that, and then didn't catch it.

@rcrehuet

This comment has been minimized.

Show comment
Hide comment
@rcrehuet

rcrehuet Oct 17, 2014

I'm glad it was that simple!
And it works!
And it is going to change the way I write notebooks, indeed!
THANKS!
One last question: if I need to change the language, do I have to change line 103 of calico-spell-check.js ? That's all?

rcrehuet commented Oct 17, 2014

I'm glad it was that simple!
And it works!
And it is going to change the way I write notebooks, indeed!
THANKS!
One last question: if I need to change the language, do I have to change line 103 of calico-spell-check.js ? That's all?

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 17, 2014

Contributor

Yes, that should do it:

https://bitbucket.org/ipre/calico/src/master/notebooks/nbextensions/calico-spell-check.js#cl-103

This is a typos.js name. If typo.js doesn't come with your language, then you can perhaps add yours:

http://www.chrisfinke.com/2011/03/31/announcing-typo-js-client-side-javascript-spellchecking/

Contributor

dsblank commented Oct 17, 2014

Yes, that should do it:

https://bitbucket.org/ipre/calico/src/master/notebooks/nbextensions/calico-spell-check.js#cl-103

This is a typos.js name. If typo.js doesn't come with your language, then you can perhaps add yours:

http://www.chrisfinke.com/2011/03/31/announcing-typo-js-client-side-javascript-spellchecking/

@aloctavodia

This comment has been minimized.

Show comment
Hide comment
@aloctavodia

aloctavodia Jan 23, 2015

There is a keyboard shortcut to toggle on/off the spell checker? There is a way to alternate dictionaries without having to change the source code?

aloctavodia commented Jan 23, 2015

There is a keyboard shortcut to toggle on/off the spell checker? There is a way to alternate dictionaries without having to change the source code?

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Jan 23, 2015

Contributor

Keyboard shortcut? No, not yet. We could also make the default "on". Change dictionaries? No, not yet. Pull Requests accepted! You can do that, and carry on this conversation here:

https://bitbucket.org/ipre/calico/issues?status=new&status=open

We hope to move these nbextensions out from this huge repo soon. Probably over to here:

https://github.com/calysto/

Contributor

dsblank commented Jan 23, 2015

Keyboard shortcut? No, not yet. We could also make the default "on". Change dictionaries? No, not yet. Pull Requests accepted! You can do that, and carry on this conversation here:

https://bitbucket.org/ipre/calico/issues?status=new&status=open

We hope to move these nbextensions out from this huge repo soon. Probably over to here:

https://github.com/calysto/

@rlabbe

This comment has been minimized.

Show comment
Hide comment
@rlabbe

rlabbe Apr 4, 2015

I want to note that I needed to put the following in custom.js to get this to work with IPython 3.0 (I'm on Windows 8, not sure that matters):

require([ 
     'base/js/namespace', 
     'base/js/events' 
], function(IPython, events) { 
     events.on('app_initialized.NotebookApp', function(){ 
         IPython.load_extensions('calico-spell-check'); 
     }); 
 });

With the simpler

IPython.load_extensions('calico-spell-check'); 

mentioned above I got the javascript' undefined is not a function' error.

rlabbe commented Apr 4, 2015

I want to note that I needed to put the following in custom.js to get this to work with IPython 3.0 (I'm on Windows 8, not sure that matters):

require([ 
     'base/js/namespace', 
     'base/js/events' 
], function(IPython, events) { 
     events.on('app_initialized.NotebookApp', function(){ 
         IPython.load_extensions('calico-spell-check'); 
     }); 
 });

With the simpler

IPython.load_extensions('calico-spell-check'); 

mentioned above I got the javascript' undefined is not a function' error.

@NelisW

This comment has been minimized.

Show comment
Hide comment
@NelisW

NelisW Apr 7, 2015

First of all, thanks Doug and rlabbe!

Marco Pinto maintains a UK English hunspell-style list here. To implement the UK dictionary in an Anaconda IPython 3 installation on Windows:

  1. Download the two files en-GB.aff and en-GB.dic into the (new) folder C:\Anaconda\share\jupyter\nbextensions\typo\dictionaries\en_GB\.
  2. Rename the two files to use underscore instead of dash/hyphen (look at the en_US equivalent). Change en-GB.aff to en_GB.aff and change en-GB.dic to en_GB.dic.
  3. Edit the file C:\Anaconda\share\jupyter\nbextensions\calico-spell-check.js to replace var lang = "en_US"; with var lang = "en_GB";.

It should be a simple matter to find the equivalent directories in Linux.

NelisW commented Apr 7, 2015

First of all, thanks Doug and rlabbe!

Marco Pinto maintains a UK English hunspell-style list here. To implement the UK dictionary in an Anaconda IPython 3 installation on Windows:

  1. Download the two files en-GB.aff and en-GB.dic into the (new) folder C:\Anaconda\share\jupyter\nbextensions\typo\dictionaries\en_GB\.
  2. Rename the two files to use underscore instead of dash/hyphen (look at the en_US equivalent). Change en-GB.aff to en_GB.aff and change en-GB.dic to en_GB.dic.
  3. Edit the file C:\Anaconda\share\jupyter\nbextensions\calico-spell-check.js to replace var lang = "en_US"; with var lang = "en_GB";.

It should be a simple matter to find the equivalent directories in Linux.

@NelisW

This comment has been minimized.

Show comment
Hide comment
@NelisW

NelisW Apr 7, 2015

BTW, it appears that you can edit (add new words?) dictionaries with Marco Pinto's tool available at http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html

NelisW commented Apr 7, 2015

BTW, it appears that you can edit (add new words?) dictionaries with Marco Pinto's tool available at http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Apr 7, 2015

Contributor

Thanks for all of these bits of information!

Also, one can add words to the calico-spell-check extension by making a
JSON object in a file named words.json and putting it next to
calico-spell-check.js.

BTW, we'll be splitting these Javascript extensions into their own project
so that it will be easier to make PRs.

-Doug

On Tue, Apr 7, 2015 at 4:13 AM, Nelis Willers notifications@github.com
wrote:

BTW, it appears that you can edit (add new words?) dictionaries with Marco
Pinto's tool available at
http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html


Reply to this email directly or view it on GitHub
#3216 (comment).

Contributor

dsblank commented Apr 7, 2015

Thanks for all of these bits of information!

Also, one can add words to the calico-spell-check extension by making a
JSON object in a file named words.json and putting it next to
calico-spell-check.js.

BTW, we'll be splitting these Javascript extensions into their own project
so that it will be easier to make PRs.

-Doug

On Tue, Apr 7, 2015 at 4:13 AM, Nelis Willers notifications@github.com
wrote:

BTW, it appears that you can edit (add new words?) dictionaries with Marco
Pinto's tool available at
http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html


Reply to this email directly or view it on GitHub
#3216 (comment).

@NelisW

This comment has been minimized.

Show comment
Hide comment
@NelisW

NelisW Apr 7, 2015

Hi Doug,

I must thank you! I am smiling ear-to-ear with my nice new spel checker in
IPython!

regards

n

On 7 April 2015 at 12:09, Doug Blank notifications@github.com wrote:

Thanks for all of these bits of information!

Also, one can add words to the calico-spell-check extension by making a
JSON object in a file named words.json and putting it next to
calico-spell-check.js.

BTW, we'll be splitting these Javascript extensions into their own project
so that it will be easier to make PRs.

-Doug

On Tue, Apr 7, 2015 at 4:13 AM, Nelis Willers notifications@github.com
wrote:

BTW, it appears that you can edit (add new words?) dictionaries with
Marco
Pinto's tool available at
http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html


Reply to this email directly or view it on GitHub
#3216 (comment).


Reply to this email directly or view it on GitHub
#3216 (comment).

NelisW commented Apr 7, 2015

Hi Doug,

I must thank you! I am smiling ear-to-ear with my nice new spel checker in
IPython!

regards

n

On 7 April 2015 at 12:09, Doug Blank notifications@github.com wrote:

Thanks for all of these bits of information!

Also, one can add words to the calico-spell-check extension by making a
JSON object in a file named words.json and putting it next to
calico-spell-check.js.

BTW, we'll be splitting these Javascript extensions into their own project
so that it will be easier to make PRs.

-Doug

On Tue, Apr 7, 2015 at 4:13 AM, Nelis Willers notifications@github.com
wrote:

BTW, it appears that you can edit (add new words?) dictionaries with
Marco
Pinto's tool available at
http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html


Reply to this email directly or view it on GitHub
#3216 (comment).


Reply to this email directly or view it on GitHub
#3216 (comment).

@damianavila

This comment has been minimized.

Show comment
Hide comment
@damianavila

damianavila Apr 7, 2015

Contributor

This issue is largely solved by @dsblank extension... so, I will close this issue, @dsblank please link here your project once splitted. Thanks.

Contributor

damianavila commented Apr 7, 2015

This issue is largely solved by @dsblank extension... so, I will close this issue, @dsblank please link here your project once splitted. Thanks.

@damianavila damianavila closed this Apr 7, 2015

@asmeurer

This comment has been minimized.

Show comment
Hide comment
@asmeurer

asmeurer Apr 7, 2015

Contributor

So there's no hope of this ever working natively?

Contributor

asmeurer commented Apr 7, 2015

So there's no hope of this ever working natively?

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Apr 7, 2015

Contributor

By natively, do you mean installed by default with the rest of ipython? I don't think that will probably happen because:

  • it is a pretty large addon (700k expanded)
  • ipython is breaking things up into smaller pieces as we speak
  • it could still use some UI/development (changing languages, add words, picking suggested words, etc)

Of course, we would love to make it as easy to install as possible. There has been some discussion about whether pip should be used for something like this, or if Jupyter will have its own packaging system. I'm waiting to see what the recommendation is.

Contributor

dsblank commented Apr 7, 2015

By natively, do you mean installed by default with the rest of ipython? I don't think that will probably happen because:

  • it is a pretty large addon (700k expanded)
  • ipython is breaking things up into smaller pieces as we speak
  • it could still use some UI/development (changing languages, add words, picking suggested words, etc)

Of course, we would love to make it as easy to install as possible. There has been some discussion about whether pip should be used for something like this, or if Jupyter will have its own packaging system. I'm waiting to see what the recommendation is.

@asmeurer

This comment has been minimized.

Show comment
Hide comment
@asmeurer

asmeurer Apr 7, 2015

Contributor

Yeah, or, better, support for the built in browser/OS spellchecker.

Contributor

asmeurer commented Apr 7, 2015

Yeah, or, better, support for the built in browser/OS spellchecker.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Apr 8, 2015

Member

It looks like @Carreau looked into that and thought that Codemirror broke the native browser spellchecker. Does anyone know otherwise?

Member

takluyver commented Apr 8, 2015

It looks like @Carreau looked into that and thought that Codemirror broke the native browser spellchecker. Does anyone know otherwise?

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Apr 8, 2015

Member

I think the issue is when CM is backed by a textarea instance, to OSX for example try to be "smart" and pop the completion window in a place innapropriate, which lock-up the UI. Also the wiggly underlines are in the textarea itself and not in CM so won't be seen, and no API to access the Browser spellcheck....

Member

Carreau commented Apr 8, 2015

I think the issue is when CM is backed by a textarea instance, to OSX for example try to be "smart" and pop the completion window in a place innapropriate, which lock-up the UI. Also the wiggly underlines are in the textarea itself and not in CM so won't be seen, and no API to access the Browser spellcheck....

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Apr 8, 2015

Member

Long term solution: maybe we should ask browser makers for APIs to access spellchecking features.

Member

takluyver commented Apr 8, 2015

Long term solution: maybe we should ask browser makers for APIs to access spellchecking features.

@minrk minrk modified the milestones: no action, wishlist Apr 12, 2015

@amueller

This comment has been minimized.

Show comment
Hide comment
@amueller

amueller Oct 2, 2015

Is the calico extension still working? It uses the deprecated nbextension and I couldn't make it work on ipython4.0:

%install_ext https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

Installed calico-spell-check-1.0.zip. To use it, type:
%load_ext calico-spell-check-1.0

%load_ext calico-spell-check-1.0

ImportError: No module named calico-spell-check-1.0

%load_ext calico-spell-check

ImportError: No module named calico-spell-check

I also tried

%%javascript
require(['base/js/utils'],
function(utils) {
   utils.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');
});

but that has no effect.

amueller commented Oct 2, 2015

Is the calico extension still working? It uses the deprecated nbextension and I couldn't make it work on ipython4.0:

%install_ext https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

Installed calico-spell-check-1.0.zip. To use it, type:
%load_ext calico-spell-check-1.0

%load_ext calico-spell-check-1.0

ImportError: No module named calico-spell-check-1.0

%load_ext calico-spell-check

ImportError: No module named calico-spell-check

I also tried

%%javascript
require(['base/js/utils'],
function(utils) {
   utils.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');
});

but that has no effect.

@amueller

This comment has been minimized.

Show comment
Hide comment
@amueller

amueller Oct 2, 2015

Ah, I guess %install_ext installs IPython extensions, not notebook extensions. Whoops. Still doing ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zipalso didn't help :-/

amueller commented Oct 2, 2015

Ah, I guess %install_ext installs IPython extensions, not notebook extensions. Whoops. Still doing ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zipalso didn't help :-/

@rlabbe

This comment has been minimized.

Show comment
Hide comment
@rlabbe

rlabbe Oct 4, 2015

Is your notebook trusted? It won't show up if the notebook is not trusted.

edit: it works for me, Python 3.4.3, IPython 3.2,Anaconda install.

rlabbe commented Oct 4, 2015

Is your notebook trusted? It won't show up if the notebook is not trusted.

edit: it works for me, Python 3.4.3, IPython 3.2,Anaconda install.

@aloctavodia

This comment has been minimized.

Show comment
Hide comment
@aloctavodia

aloctavodia Oct 22, 2015

@amueller On Linux I did
sudo jupyter nbextension install https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
followed by
jupyter nbextension enable calico-spell-check

BTW, I added an Spanish dictionary (to have both English and Spanish spellcheckers) but words with accents are marked as erroneous (this did not happen in previous Ipython and or callico versions). Any idea?

aloctavodia commented Oct 22, 2015

@amueller On Linux I did
sudo jupyter nbextension install https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
followed by
jupyter nbextension enable calico-spell-check

BTW, I added an Spanish dictionary (to have both English and Spanish spellcheckers) but words with accents are marked as erroneous (this did not happen in previous Ipython and or callico versions). Any idea?

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 22, 2015

Contributor

@aloctavodia Would you be willing to add or point to the spanish dictionary, and make an issue regarding the accented characters here:

https://github.com/Calysto/notebook-extensions/

Contributor

dsblank commented Oct 22, 2015

@aloctavodia Would you be willing to add or point to the spanish dictionary, and make an issue regarding the accented characters here:

https://github.com/Calysto/notebook-extensions/

@aloctavodia

This comment has been minimized.

Show comment
Hide comment
@aloctavodia

aloctavodia Oct 22, 2015

@dsblank Done it!
PS: sorry for posting the problem in the wrong place.

aloctavodia commented Oct 22, 2015

@dsblank Done it!
PS: sorry for posting the problem in the wrong place.

@dsblank

This comment has been minimized.

Show comment
Hide comment
@dsblank

dsblank Oct 22, 2015

Contributor

Thanks! I'll take a look and try to replicate.

Contributor

dsblank commented Oct 22, 2015

Thanks! I'll take a look and try to replicate.

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