Help testing LCB wrapper around Hunspell

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Help testing LCB wrapper around Hunspell

Post by trevordevore » Wed Apr 22, 2020 2:30 pm

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.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by AndyP » Thu Apr 23, 2020 1:23 pm

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.
Attachments
2020-04-23_14-18-29.gif
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by trevordevore » Thu Apr 23, 2020 3:25 pm

Thanks for testing @AnydP!

Which version of Windows and LC did you test with?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by AndyP » Thu Apr 23, 2020 5:25 pm

9.6 dp2 Indy and 9.51 rc1 Indy

OS Name Microsoft Windows 10 Pro
Version 10.0.18362 Build 18362
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

Tonaras
Posts: 18
Joined: Mon Jul 03, 2017 1:25 am

Re: Help testing LCB wrapper around Hunspell

Post by Tonaras » Tue Mar 23, 2021 11:14 pm

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.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by trevordevore » Sat Mar 27, 2021 6:42 pm

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.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Tonaras
Posts: 18
Joined: Mon Jul 03, 2017 1:25 am

Re: Help testing LCB wrapper around Hunspell

Post by Tonaras » Sun Mar 28, 2021 1:05 pm

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?

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by trevordevore » Sun Mar 28, 2021 2:05 pm

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?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Tonaras
Posts: 18
Joined: Mon Jul 03, 2017 1:25 am

Re: Help testing LCB wrapper around Hunspell

Post by Tonaras » Sun Mar 28, 2021 4:09 pm

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!!

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by trevordevore » Tue Mar 30, 2021 7:44 pm

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.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Tonaras
Posts: 18
Joined: Mon Jul 03, 2017 1:25 am

Re: Help testing LCB wrapper around Hunspell

Post by Tonaras » Thu Apr 01, 2021 4:13 pm

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.

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: Help testing LCB wrapper around Hunspell

Post by seaniepie » Sat Apr 03, 2021 9:44 pm

Hi,
Can it be made universal at all, ie, for Windows, Mac and Linux? Maybe even iOS and Android?
Sean

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by trevordevore » 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
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

PaulDaMacMan
Posts: 617
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Help testing LCB wrapper around Hunspell

Post by PaulDaMacMan » Tue Apr 06, 2021 12:36 am

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
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”