Spellcheck

Post Reply
robm06
Posts: 14
Joined: Fri Jun 11, 2010 1:02 am

Spellcheck

Post by robm06 »

Any hopes of getting a spell check feature?
aspell.net/

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Spellcheck

Post by Vadi »

Been discussed before. Would be a welcome option, although no time to add it in atm (patches welcome).

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: Spellcheck

Post by Iocun »

If you have some dictionary file in text form on your computer, you can make something rudimentary with grep (on Unix-like systems). Maybe something similar exists for Windows.

On my Mac I use:
Code: [show] | [select all] lua
function dict(term)
	return io.popen([[egrep ]]..term..[[ /usr/share/dict/words]]):read("*a")
end
With this you can simply do a regex dictionary lookup. dict("^house$") will for instance simply return "house", dict("^house") will return any words found that begin with "house" (such as "housework"), or dict("^ho.se$") will return hoise, hoose, horse, house.

I also have:
Code: [show] | [select all] lua
function spellcheck(word)
	if dict("^"..word.."$") ~= "" then
		return ("<green>Word spelt correctly.")
	else
		return ("<red>Word not found in dictionary.")		
	end
end

Which merely gives a string (for cecho()) to show whether a given word was found in the dictionary exactly like that.

But yeah, it would of course be much more useful if a spellcheck feature checked everything without having to type in additional commands for every word you want to check.

My spellchecker also has the problem that this dictionary file only knows American spellings and doesn't recognize British spellings as correct.

The fun thing about the dict() function is though that you can use it for totally different purposes. Such as finding rhymes! (Just do dict("^.*ortive$") to find out that unsportive rhymes with contortive! Yay!)

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Spellcheck

Post by Heiko »

Added Hunspell spell checking.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Spellcheck

Post by Vadi »

Cool

User avatar
Proxy
Posts: 27
Joined: Sun May 08, 2016 4:57 pm

Re: Spellcheck

Post by Proxy »

Is there any way to add your own words to the inbuilt spellchecker?

Post Reply