[Module] SpellCheck (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] SpellCheck (all OS)

Post by Thorsten1867 »

SpellCheck - Module (all OS / 64Bit)

Check spelling & suggest corrections (Damerau-Levenshtein-Distance)

Code: Select all

; SpellCheck::AddToUserDictionary()   - add a word to the user dictionary
; SpellCheck::ClearCheckedWords()     - clears all check words from map
; SpellCheck::CorrectionSuggestions() - returns a list with correction suggestions (Damerau-Levenshtein-Distance)
; SpellCheck::FreeDictionary()        - removes dictionary from memory
; SpellCheck::LoadDictionary()        - loads a dictionary
; SpellCheck::Query()                 - returns whether a word is right, misspelled or unknown.
; SpellCheck::SaveUserDictionary()    - saves user dictionary
; SpellCheck::Text()                  - checks a text for spelling mistakes
; SpellCheck::Word()                  - checks if a word is spelled correctly
Download: SpellCheckModule.pbi
Last edited by Thorsten1867 on Sat Nov 23, 2019 2:49 pm, edited 2 times in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
vwidmer
Enthusiast
Enthusiast
Posts: 286
Joined: Mon Jan 20, 2014 6:32 pm

Re: [Module] SpellCheck (all OS)

Post by vwidmer »

This is nice.. But how can you show the correct suggestions?

Thanks
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] SpellCheck (all OS)

Post by Thorsten1867 »

You can only check the spelling.
To find suggestions would require a completely different algorithm.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] SpellCheck (all OS)

Post by Thorsten1867 »

Update: correction suggestions on the basis of the 'Damerau-Levenshtein-Distance'
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
jacdelad
Addict
Addict
Posts: 2000
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: [Module] SpellCheck (all OS)

Post by jacdelad »

I may be stupid, but trying to start it tells me "DamerauLevenshteinDistance" is not a function, array etc.
And I can't find the function in the source. Do I need any addon?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [Module] SpellCheck (all OS)

Post by Quin »

jacdelad wrote: Mon Jul 19, 2021 6:13 pm I may be stupid, but trying to start it tells me "DamerauLevenshteinDistance" is not a function, array etc.
And I can't find the function in the source. Do I need any addon?
Sorry to revive such an old thread, but this stumped me today ,and I just found the solution, so thought I'd share for anyone in the future. viewtopic.php?p=539717&hilit=DamerauLevenshtein Distance#p539717
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] SpellCheck (all OS)

Post by Thorsten1867 »

There was apparently a conflict during synchronisation and the procedures are missing from the file.

I have uploaded the correct file again and hope it works now.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [Module] SpellCheck (all OS)

Post by Quin »

Thorsten1867 wrote: Tue Sep 03, 2024 10:41 am There was apparently a conflict during synchronisation and the procedures are missing from the file.

I have uploaded the correct file again and hope it works now.
Even better, thank you! :)
User avatar
jacdelad
Addict
Addict
Posts: 2000
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: [Module] SpellCheck (all OS)

Post by jacdelad »

Finally, an answer. :D
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [Module] SpellCheck (all OS)

Post by Quin »

Hi,
Just tried to redownload the file, and it seems to still have the same problem. The page says it was last modified in 2019.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] SpellCheck (all OS)

Post by Thorsten1867 »

Sorry, had only updated GIT-Hub.
Hope the download works now.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [Module] SpellCheck (all OS)

Post by Quin »

It all works now! Thanks 8)
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [Module] SpellCheck (all OS)

Post by Quin »

Feature request: CatchDictionary(*Buffer, Size)
for easily embedding dictionaries in DataSections etc.
Post Reply