[Module] SpellCheck (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
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: 282
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: 1366
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: 1366
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: 1431
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

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?
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Post Reply