AutoHotkey Community

It is currently May 26th, 2012, 3:11 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: auto correct request
PostPosted: March 6th, 2009, 12:12 am 
Can somebody please write a code that will autocorrect mispelled words checking from a list of correct words.

Say when you type "voer" it will change to "over", "yhou" to "you" and "hte" to "the".

And you don't have to do it like ::voer::over and ::yhou::you or ::hte::the.

But will just detect words not in the list (separate file) and intelligently match it to closest correct word.

I see this feature in some of the more common auto correct software in the market but need one that's free and possibly born out of the fabulous AHK.

Please can somebody write a code as I'm level 0 in scripting.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 12:19 am 
Offline

Joined: February 19th, 2009, 6:44 pm
Posts: 125
so basically are u referring to the spell check system like microsoft word or firefox? or are u talking about when u type words wrong, it will instantly replace with the correct one like hotstring?

and second question, where do u usually type that the program doesnt have spellcheck function build-in?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 12:52 am 
I'm typing in a form, like here where we post topics, web form I guess you can call it that. The spell check is from Firefox, "check my spelling as I type".

I've made use of ahk auto complete where I can have ::btw::by the way.

What I'm looking for now is to "auto correct" misspelled words 'cause I suck at typing big time.

The program I have in use now is the one I downloaded here, the ahk auto complete, one with entries from wikipedia, foreign words with accents, changing of ign to ing, the Win+H to enter misspelling correction etc.

Basically I'm looking for auto correct not auto complete.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 1:00 am 
Offline

Joined: February 19th, 2009, 6:44 pm
Posts: 125
given the examples u provide:
voer, yhou and hte
how do u determine "the closest" spelling
for example:
voer can be voar (misspell a to e), can be over (misspell ov to vo)
yhou can be you (misspell one extra h), can be thou (misspell t to u)
hte can be the (misspell th to ht), can be ate (misspell a to h)
here are just few examples, i am sure if one checks carefully, there might be a lot of combination for each word
(thats the reason why firefox or microsoft word provide suggestion words instead of auto correct. and for the auto correct function in microsoft, u actually input the list each by each just like ::yhou::you)

here is what i meant in microsoft word:
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 1:13 am 
Offline

Joined: February 19th, 2009, 6:44 pm
Posts: 125
this will be a quick way how u can add words immediately:
Code:
#SingleInstance force
^q::
Gui, add, edit, w100 vwrong,
GUi, add, edit, w100 vcorrect,
Gui, add, button, w50 gok, OK
gui, show
return
ok:
Gui, submit
change = ::%wrong%::%correct%
FileAppend, `n%change%, %A_ScriptFullPath%
sleep 500
reload
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 1:19 am 
Offline

Joined: May 14th, 2008, 9:48 pm
Posts: 110
this should work in real-time but, you have to add all the incorrect spelling's yourself.

Code:
:*?:hye::hey


so basically what you're gonna do is this

Code:
:*?:(incorrect spelling)::(correct spelling)


This will remove the word you typed and replace it with the word you want it to

It also doesn't have to be the incorrect spelling into the correct way, anything will work

example:
Code:
:*?:chicken::french fries

________
Cb1300


Last edited by jmanx on February 10th, 2011, 9:42 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: auto correct request
PostPosted: March 6th, 2009, 1:31 am 
Offline

Joined: February 27th, 2009, 9:11 am
Posts: 693
Location: Burbank, California
ahknice wrote:
Can somebody please write a code that will autocorrect mispelled words checking from a list of correct words.

Say when you type "voer" it will change to "over", "yhou" to "you" and "hte" to "the".

And you don't have to do it like ::voer::over and ::yhou::you or ::hte::the.

But will just detect words not in the list (separate file) and intelligently match it to closest correct word.

I see this feature in some of the more common auto correct software in the market but need one that's free and possibly born out of the fabulous AHK.

Please can somebody write a code as I'm level 0 in scripting.


Have you looked at http://www.autohotkey.com/download/AutoCorrect.ahk. I use it all the time. Works great!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 3:36 am 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
Look all throughout this topic: http://www.autohotkey.com/forum/viewtop ... to+correct .
there are several libraries in that topic, mix/match/edit them for your likings. plus you can easly add/remove them on the fly with win+H.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 10:11 am 
what's this :*?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 1:58 pm 
evan, nice way to add, can you please edit it so I don't have to "tab" to go to OK or click the OK button to send. Can I just, after filling the second field, can enter/send from there.

jmanx, I understand :*?: means it will replace without first pressing on space. It's actually nice. I can use this.

flyingDman and tidbit, I'm sorry I don't have my facts straight. Actually I downloaded the autocorrect.ahk not "auto complete", which I mentioned earlier with entries from wikipedia, foreign words with accent, changing of win +H feature and some correction entries e.g. ::memeber::member. Correction worked great but need to add in more.


Quote:
The program I have in use now is the one I downloaded here, the ahk auto complete


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 4:12 pm 
evan can you please edit the code that will, I have a work flow in mind but don't know how to edit or where to insert from your code. Basically, the work flow goes like this:


0a. "first I will highlight an entry from a list and copy it" (then comes your script)

CODE:
1. paste in field 1 and field 2.
2. click on OK button.

Image

I find this will be easier to manage after I'm gonna run this with VBA macro to arrange them as opposed to individually filling each field, as shown below

Image


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 7:07 pm 
Offline

Joined: February 19th, 2009, 6:44 pm
Posts: 125
if u have a list like:
wrong=correct
then u can just use the following fuction to add the list in corrected format "::wrong::correct" at the end of the script:
Code:
var=
(
ablre=able
ahppy=happy
ands=and
appointmetn=appointment
aroudn=around
arrivied=arrived
buyt=but
)

StringReplace, var, var, `=, ::, All
loop, parse, var, `n, `r
{
list=%list%`n::%A_LoopField%
}
clipboard = %list%
msgbox, List saved in clipboard:`n %list%
 


and here is a modification that does not require u to click OK at the end:
Code:
#SingleInstance force
Gui, add, edit, w100 vwrong,
GUi, add, edit, w100 vcorrect,
Gui, add, button, w50 gok, OK
^q::
Hotkey, Enter, label
gui, show
return
label:
ok:
Gui, submit
change = ::%wrong%::%correct%
FileAppend, `n%change%, %A_ScriptFullPath%
sleep 500
reload
return
Guiclose:
Hotkey, Enter, off
Gui, hide
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2009, 1:27 am 
It's lovely. Now I don't have to individually highlight, copy, run script. Just run new script and walah I got myself a list.

Although when I paste it to notepad it looked like this,

::ablre::able::alos::also::ansd::and::nad::and::appointmetn::appointment

I pasted it to Word,

::ablre::able
::alos::also
::ansd::and
::nad::and
::appointmetn::appointment
::aroudn::around
::arpund::around
::arrvied::arrived

But it's fine. I can always go to Word to have it arranged like so. And this is way, way better. Thanks evan dear :D.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2009, 2:36 am 
Well actually I'm still hoping that someone could sort of like crack the code or write a code that will auto correct much like a program I have, which is a trial. I really hope ahk can do this.

What the software does is it corrects (1) interactively and (2) automatically.

This one below auto corrects interactively, (asking you to choose from a list of suggestions):

Image Image Image Image

This one below auto corrects automatically. It chooses the FIRST suggestion, if you notice:

Image

My wish is to have the code auto correct automatically, intelligently match typo word to closest correct word. I hope somebody can write the code please.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2009, 3:27 am 
Offline

Joined: May 14th, 2008, 9:48 pm
Posts: 110
here's a small script I wrote for an auto correct list on wikipedia that has more than 4k+ corrections

Code:
MyFileLocation=%A_desktop%\Corrections.txt
filedelete, %A_desktop%\AutoCorrect.ahk
int=0
loop, read, %MyFileLocation%
{
currentline:=A_Loopreadline
stringreplace, currentline, currentline, ->, ::
fileappend, :*?:%currentline%`n, %A_desktop%\AutoCorrect.ahk
int++
}


here's a link to the list, just put your caret at the top, scroll all the way down, then whild holding shift, highlight the entire list in 1 click.

Then save in a .txt

http://en.wikipedia.org/wiki/Wikipedia: ... r_machines
________
Arizona Medical Marijuana Dispensaries


Last edited by jmanx on February 10th, 2011, 9:42 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, Google Feedfetcher, nyoe, patgenn123, Tilter_of_Windmills, Yahoo [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group