Predelnik / DSpellCheck

Notepad++ Spell-checking Plug-in
GNU General Public License v2.0
198 stars 33 forks source link

Common dictionaries #161

Open ferenczy opened 5 years ago

ferenczy commented 5 years ago

First, I would like to note that this is rather a subject for discussion than an issue with the plugin.

The spell checking on Windows platform is fundamentally broken, that's obvious I guess. I also have to note that I'm primarily working on Windows 7 so I'm describing the situation there. I think that on Windows 8/10, there's some new spell checking feature in the system AFAIK, but I don't know details.

But definitely up to at least Windows 7, there's no spell checking feature or at least support in the system, even though that's one of few features an operating system should provide.

The result is that every single application which wants to have such feature implements it on its own. And user has to configure each one and what's worse, manage dictionaries and mainly "train" user dictionaries separately.

Ideally, the operating system should automatically provide spell checking for all text input controls in all applications by default and a spell checking service to be used by applications for their custom controls. Configured and managed at a single place.

It's great there are frameworks/libraries like Hunspell/Aspell but only from developer's point of view - he doesn't have to implement it himself. I don't understand why it's not implemented as a service instead of library. I would install and maintain a single Hunspell instance and any application supporting it could use it.

So to summarize it, my point is that it would be great to not try to add another instance of spell checker by the plugin if there's one already. For example when there's Open/LibreOffice or Firefox installed and contains the Hunspell/Aspell library and dictionaries, then use it (or let user choose of course).

The worst case, share with other applications at least the dictionaries. I don't know how much are various (at least minor) versions compatible, for example in case of Hunspell library interface. But dictionary format is, hopefully, simple and stable enough to use the same dictionary files using various versions of the library.

What do you think?

ferenczy commented 5 years ago

I just noticed it has been briefly discussed in #11 already.

Predelnik commented 5 years ago

To be honest I'm not sure if any other OS beside Windows 8/10 support spell-checking as api, I mean linux is even more invested on libraries like Aspell in its applications.

So for libraries: Currently - Aspell library is reused through system installed dll but it's hardly supported, especially windows version. Hunspell is not traditionally used as dynamic library or installed in any way, usually linked statically and sometimes even modified (e.g. Chrome).

Dictionaries: In some cases can possibly be reused. However some programs do some custom repacking of dictionaries, store it in zip archives and so on. Also they may change the location where they store them without notice and I have to endlessly support it, this may get frustrating.

Personally I don't use open/libreoffice, that's why it was never a priority task for me. But I may look into it (at least into how and where various Hunspell dictionaries are stored) sometime in the future.

ferenczy commented 5 years ago

I see, that doesn't sound very feasible.

In case of LibreOffice, .otx file format is just a distribution format of Open/LibreOffice extensions. When you install it, it's being unpacked. Both dictionaries installed with Open/LibreOffice themselves and user-installed dictionaries packed as extensions are regular aff and dic files and I have been able to use them with DSpellChek. The default dictionaries are installed in something like c:\Program Files\LibreOffice\share\extensions\dict-en\, the user-installed ones are unpacked in some cache directory with a generasted name like c:\users\<username>\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu6723gq8sg.tmp_\english-dictionaries-2018-10.oxt\, so it might be a bit complicated to detect it.

Well, I'm not sure it's worth your time. I don't know how many people use Open/LibreOffice and Notepad++ with DSpellCheck together. It would be nice to have it but ideally simply as a spell checker service which would work for any application in the system.

It just annoys me to configure one spell checker in an e-mail client, one in an office suite, another one in an editor, etc.