jupyterlab-contrib / spellchecker

Spellchecker for JupyterLab notebook markdown cells and file editor.
BSD 3-Clause "New" or "Revised" License
205 stars 20 forks source link

Some changes #40

Closed ocordes closed 3 years ago

ocordes commented 3 years ago

Hi,

I've written this pull request, because we want to use the spell checking in a learning environment and your package still has some unimplemented feature and a small BUG.

I guess the whole request is not useful, but please check a few changes. First there was a small BUG when hitting the Cancel-Button of the language picker. The value test was wrong and creates a unusable picker.

Then the code is now saving the language selection in the user settings and reading the setting back during activation. Also changing manually the setting works fine now. There is a simple test that only languages which are predefined are accepted otherwise the change will be ignored but only mentioned in the console.log. A dialog would be interesting, but not necessary since many will change the language with the picker.

For my own purpose I've added the german language de-de to the predefined languages. There are also more, but I want to implement something like special node-package(s) which contain separate language sets, because noboday needs all languages at the same time.

If you like, we can work together. I'm a programmer for several languages and also a python teacher and IT admin.

Cheers, Oliver

krassowski commented 3 years ago

Very nice! It would probably help if you could track down what is the license for the German dictionary (to make sure it can be redistributed) and where it came from, so that it can be updated in the future.

krassowski commented 3 years ago

There are also more, but I want to implement something like special node-package(s) which contain separate language sets, because noboday needs all languages at the same time.

There are plans to handle that in the framework of language packs of JupyterLab 3.0 (pending JupyterLab 3.0 release), have a look here: https://github.com/jupyterlab/team-compass/issues/85. It would be great to see it happen! I am currently swamped with my studies but hope to catch up over the Christmas break. I would love to collaborate with you and we could kick off by moving this repo into the JupyterLab organization.

In other words, do not invest too much time into language packages now, because the new extensions system in JupyterLab 3.0 will render quite a few things obsolete and better do it then in coordination with others working on localization :) Thank you for this PR!

ocordes commented 3 years ago

BTW, I've checked some of the dictionaries for other languages and it seems that for a good internationalization typo-js has some problems. I have a working example for german, french, Spanish, Portuguese, but I cannot get the files working for italiano. The problem is that the list of words which is generated from the rules is maybe to long and the generating to time consuming that typo.js is not useful. I briefly checked the code and maybe someone should think of a better implementation of the hunspell algorithm in JS. Therefor I suggest to move also the typo.js repo into jupyter as well or do a integration into the spell checking repo to have a better control of the code ... Maybe it is worth to think about this, before moving ...

ijmbarr commented 3 years ago

Thanks for the changes!