Page 1 of 1

Help testing LCB wrapper around Hunspell

Posted: Wed Apr 22, 2020 2:30 pm
by trevordevore
Hi everyone,

I've been working on wrapping hunspell in LCB and could use help verifying that it works on Windows systems other than my own. So far I've tested using LiveCode 9.6 dp-4 on Windows 10 and Windows 8. The project currently uses version 1.6.2 for Windows. The last version released is 1.7.0 but that didn't have a project I could open in Visual Studio and my attempts to compile a DLL using Cygwin haven't worked thus far.

If you have a few minutes here is what you can do:

1. Visit the Github repo page: https://github.com/trevordevore/lc-hunspell
2. Follow the "Testing" instructions on the page.
3. Report back here your results. I'm interested in what version of Windows you are running and which version of LiveCode you tested with.

Want to add Linux support?

If someone can compile a version of hunspell for Linux then it can be added to the project.

Re: Help testing LCB wrapper around Hunspell

Posted: Thu Apr 23, 2020 1:23 pm
by AndyP
Hi Trevor, thank you for your efforts on this, i can see a lot of use for the extension.

The extension install perfectly with no problems or errors.

Testing went as you described, I have attached an animated screen grab for your reference.

Re: Help testing LCB wrapper around Hunspell

Posted: Thu Apr 23, 2020 3:25 pm
by trevordevore
Thanks for testing @AnydP!

Which version of Windows and LC did you test with?

Re: Help testing LCB wrapper around Hunspell

Posted: Thu Apr 23, 2020 5:25 pm
by AndyP
9.6 dp2 Indy and 9.51 rc1 Indy

OS Name Microsoft Windows 10 Pro
Version 10.0.18362 Build 18362

Re: Help testing LCB wrapper around Hunspell

Posted: Tue Mar 23, 2021 11:14 pm
by Tonaras
Hi Trevor. In desperate need of a capable spell checker for Livecode, I stumbled on your Hunspell LCB wrapper project. What a insanely amazing and so much needed work!!! You really are my Hero and I am immensely grateful for your excellent contribution!! So, here's my experience with it so far:

I’m on LiveCode Indy 9-6-1 Win 7 x64 on a pretty fast dev machine. Installing the extension in the LC IDE was a breeze and everything worked out of the box as expected. Up and running in less than half an hour.

I built LC standalones, x32 and x64, for testing on my Win 7 x32 laptop and on a Win 10 x64 virgin install on a VM (virtual machine). On the laptop everything was as expected.
Then the nightmare begun, with the Win 10 VM. I constantly got errors thrown by the extension (standalone debugger reported “Type: extension: error occurred with domain” when calling spellcheckerInitialize and _loadDictionaryForLanguage). To make a long story short, after two days of hardcore research, experimentation and trying to find the culprit, I managed to solve the puzzle: I installed LibreOffice (which comes and installs with Hunspell) to see if Hunspell runs via LibreOffice on that machine and OS (which it did perfectly well) and then - TRARAAAA!! - suddenly the LC standalone could run the libhunspell . dll and all associated LC handlers without any problem as well.

So, I wrongly thought that your libhunspell . dll provides everything needed (except the dictionaries) to a LC Standalone App, but this seems not to be the case.

Now I’m stuck, as I cannot find much details about what and how and where to install missing Hunspell components. Strange enough, there’s not much info on the web. I couldn’t even find out where LibreOffice installs its Hunspell components (except the dictionaries of course). I’ve been in Windows, Program Files, AppData, Services and every possible corner and subdirectory on my System Disk... you name it. I desperately try to find out how to include/provide to my users everything needed with my LC Apps so that they can use Hunspell without having to install any other software (like Libreoffice) to make it work. Can you give me some advice? I’d highly appreciate your feedback.

Re: Help testing LCB wrapper around Hunspell

Posted: Sat Mar 27, 2021 6:42 pm
by trevordevore
Hi Tonaras -

I'm glad you will be able to get some use out the project. The DLL doesn't have any outside dependencies in it other than normal Windows libraries. I loaded up the DLLs in Dependencies to verify. Here is a screenshot:

Image

Dependencies shows any outside files that libhunspell.dll relies on. There are only Microsoft libraries in the list. While this list is for the 32-bit version of the DLL, I also checked the 64-bit version and the list is the same, just with paths to the 64-bit Microsoft DLLs.

My best guess is that one of the microsoft DLLs wasn't installed on the VM and Libre Office installed it. FWIW, I have installations of an application using this library that has been installed on all types of corporate and personal systems.

Re: Help testing LCB wrapper around Hunspell

Posted: Sun Mar 28, 2021 1:05 pm
by Tonaras
Hi Trevor! A HUGE thanks for replying and helping out!! What a relief to know that your libhunspell . dll is self-contained (beyond the need for the Win Libraries that you mentioned). You just made more than my day mate!!

What is your suggestion of best practices to make sure these Win Libs (correct versions etc) are on a customer's machine? How the heck does LibreOffice manage to install these and we are not? There should be a way, no?

Re: Help testing LCB wrapper around Hunspell

Posted: Sun Mar 28, 2021 2:05 pm
by trevordevore
I don’t have any suggestions off the top of my head. We don’t actually know the exact cause of the problem yet. All you know is one app didn’t work and then it did after installing another app. The first step would be to restore your VM image to its original state so you can recreate the original problem and determine what libhunspell wasn’t working. Are you able to do that?

Re: Help testing LCB wrapper around Hunspell

Posted: Sun Mar 28, 2021 4:09 pm
by Tonaras
I'll try to replicate the issue by either trying to roll back Windows by restore point, and if that fails (not sure if on a VM that works as seamlessly) than I'll create a fresh VM with a clean Windows 10 installation and see what happens.

What I can tell you though is that I already uninstalled LibreOffice via Settings (Win)->Apps & Features->Libre Office, supposedly with ALL its components... and libhunspell still was working like a charm.

I'll post the results of my endavours as soon as I finish the rollback of the VM...

Whishing you a great Sunday!!

Re: Help testing LCB wrapper around Hunspell

Posted: Tue Mar 30, 2021 7:44 pm
by trevordevore
Tonaras - As fate would have it, one of my support agents was able to recreate the problem on his machine. The issue occurs if you do not have the MSVCP140.dll and VVCRUNTIME140.dll files installed. Here is the screenshot from Dependencies:

Image

In my case the app still runs as 32-bit on Windows so the files needed to be in the SysWOW64 folder but they were not. Installing the x86 version of the Visual Studio 2015, 2017 and 2019 redistributable fixes the issue:

https://support.microsoft.com/en-us/top ... f26a218cc0

My best guess is that LibreOffice included the dll files just in case.

Re: Help testing LCB wrapper around Hunspell

Posted: Thu Apr 01, 2021 4:13 pm
by Tonaras
Hello Trevor, thanks so much for all the detailed info!

I could replicate everything you mentioned. I manually removed MSVCP140 . dll and VCRUNTIME140 . dll from Sys32 and SysWow on the VM machine with Win10. Libhunspell . dll did stop working in LiveCode as expected. I then ran the installer VC_redist . x64 . exe and this immediately solved any issues, with Libhunspell . dll running perfectly in LiveCode again.

I guess I'll have to include the Visual Studio redistributables with distibutions of my App (or at least provide the user with a download link to Microsoft and instructions) just in case the client is missing the dlls in question.

I'll do further testing on other machines as soon as I get the chance to and let you know should any further issues pop up.

Re: Help testing LCB wrapper around Hunspell

Posted: Sat Apr 03, 2021 9:44 pm
by seaniepie
Hi,
Can it be made universal at all, ie, for Windows, Mac and Linux? Maybe even iOS and Android?
Sean

Re: Help testing LCB wrapper around Hunspell

Posted: Sun Apr 04, 2021 12:02 am
by trevordevore
I have a spell checker project on GitHub that uses NSSpellChecker on macOS and hunspell on Windows. If someone were to compile hunspell for Linux and submit a Pull Request then it would work there as well. I’m not sure how it would work on mobile.

https://github.com/trevordevore/spell_checker

Re: Help testing LCB wrapper around Hunspell

Posted: Tue Apr 06, 2021 12:36 am
by PaulDaMacMan
trevordevore wrote:
Sun Apr 04, 2021 12:02 am
I have a spell checker project on GitHub that uses NSSpellChecker on macOS and hunspell on Windows. If someone were to compile hunspell for Linux and submit a Pull Request then it would work there as well. I’m not sure how it would work on mobile.

https://github.com/trevordevore/spell_checker
looks like some people have managed to compile Hunspell for iOS in the past (7 to 9 years ago)
https://github.com/pichak/hunspell-ios
https://github.com/aaronSig/Hunspell-iOS
It also looks like someone ported Hunspell to mac at one point, and I believe Apple themselves ported it at one point (AppleSpell I've read can use Hunspell dictionary files)
Android too
https://github.com/iwo/HunspellCheckerService
https://github.com/mweimerskirch/AndroidHunspellService
https://github.com/rafaelloab/Hunspell-for-Android
Although Android has it's own spell checker:
https://developer.android.com/reference ... ssion.html