Recent

Author Topic: Lazspell - spellcheker  (Read 507 times)

Raf20076

  • Full Member
  • ***
  • Posts: 123
Lazspell - spellcheker
« on: September 25, 2020, 03:49:30 pm »
Hello guys.

I was working on hunspell spellchecker and I managed to do a nice example using hunspell.dll and memo component.

In this example; Lazspell you can use a few dictionaries coded in UTF8 like de_De, en_GB, es_ES, fr_FR, it_IT, pl_PL,
pt_PT and ru_RU (dicts are included and hunspell.dll everything you need it)

At the moment lazspell is kept on my google drive but feel free if you want to improve it and keep it online anywhere.

Lazspell is based on my example in https://wiki.lazarus.freepascal.org/spelling#Demo_3_-_Spellchecker_-_non_characters.2C_carriage_return.2C_split_string but of course is more advanced

Lazspell finds errors and list them in errors box - click the error in errorsbox, the error will be highlighted in text, then click a word in suggestionsbox if you want to change the error.

Link to Lazspell https://drive.google.com/file/d/1vE-Rd5a20y2IjMsq-c3V2Fo3IBaEfU0k/view?usp=sharing


Alextp

  • Hero Member
  • *****
  • Posts: 1149
    • UVviewsoft
Re: Lazspell - spellcheker
« Reply #1 on: September 25, 2020, 07:01:10 pm »
 You can
-create account on GitHub
-create new repo there
-don't install git! Go to your repo, and use web site to Make new file (button "Add file" above file list), to Edit it later, etc. All via browser!

Raf20076

  • Full Member
  • ***
  • Posts: 123
Re: Lazspell - spellcheker
« Reply #2 on: September 26, 2020, 09:15:16 am »
Ok Lazspell is available on github https://github.com/Raf20076/Lazspell

To use dictionaries create dict folder in Lazspell folder and put there all dictionaries.

QEnnay

  • Jr. Member
  • **
  • Posts: 57
Re: Lazspell - spellcheker
« Reply #3 on: September 27, 2020, 10:23:28 pm »
Ok Lazspell is available on github https://github.com/Raf20076/Lazspell

To use dictionaries create dict folder in Lazspell folder and put there all dictionaries.

Sounds good, what do I have to do to use this with Linux Mint? Did you make any changes to Hunspell.dll? If so, what files do I need to make those changes to for Linux?
Laz 2.0.8
Linux-Mint 20.04.0 + Cinnamon, Kernel 5.8 (NOT stock Ubuntu/Mint 5.4 Kernel)
Lenovo Flex 5 Ryzen 5 4500, 512GB-NVMe, 16GB memory

Raf20076

  • Full Member
  • ***
  • Posts: 123
Re: Lazspell - spellcheker
« Reply #4 on: September 28, 2020, 01:34:06 pm »
No changes were made to libhunspell.dll

If you want use it in any Linux see this topic https://wiki.lazarus.freepascal.org/spelling and https://wiki.lazarus.freepascal.org/spelling#Linux

In Linux usually you have to install hunspell in your system. So Lazspell doesnt use hunspell.dll

This part of code check in Linux if you have hunspell installed in '/usr/share/hunspell/';

Code: Pascal  [Select][+][-]
  1. procedure TForm1.SetDefaultDicPath();
  2. begin
  3.     {$ifdef LINUX}
  4.     DictPath := '/usr/share/hunspell/';
  5.     {$ENDIF}
  6.     {$ifdef WINDOWS}
  7.     DictPath := ExtractFilePath(Application.ExeName);
  8.     //DictPath := 'C:\Program Files\LibreOffice 5\share\extensions\dict-en\';
  9.     {$ENDIF}
  10.     {$ifdef DARWIN}
  11.     DictPath := '/Applications/Firefox.app/Contents/Resources/dictionaries/';
  12.     //DictPathAlt := ExtractFilePath(Application.ExeName);
  13.     {$endif}
  14. end;
  15.  
« Last Edit: September 28, 2020, 01:38:40 pm by Raf20076 »

QEnnay

  • Jr. Member
  • **
  • Posts: 57
Re: Lazspell - spellcheker
« Reply #5 on: September 28, 2020, 08:31:28 pm »
In Linux usually you have to install hunspell in your system. So Lazspell doesnt use hunspell.dll

Thanks for that, I should have mentioned I know the .dll is not a Linux file, I just wondered if changes had been made to the source for windows and recompiled. If so, I would need to make those changes to the counterpart files in Linux.

I am already using Hunspell checker in my own email client, but it is cumbersome to manage at times so thought I'd check this out for Linux.

Laz 2.0.8
Linux-Mint 20.04.0 + Cinnamon, Kernel 5.8 (NOT stock Ubuntu/Mint 5.4 Kernel)
Lenovo Flex 5 Ryzen 5 4500, 512GB-NVMe, 16GB memory

 

TinyPortal © 2005-2018