| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Sat Jun 21, 2008 1:53 pm Post subject: Spell 1.1 |
|
|
_________________

Last edited by majkinetor on Fri Feb 05, 2010 2:57 pm; edited 2 times in total |
|
| Back to top |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Sat Jun 21, 2008 2:11 pm Post subject: |
|
|
They're missing dictionary for my language
but well, looks great and well documented as always.
Thanks for sharing majkinetor ! _________________ Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Sat Jun 21, 2008 5:00 pm Post subject: |
|
|
| Excellent. Thanks. |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 748 Location: Texas, USA
|
Posted: Sat Jun 21, 2008 10:49 pm Post subject: |
|
|
Looks useful. Thanks.  |
|
| Back to top |
|
 |
silveredge78
Joined: 25 Jul 2006 Posts: 481 Location: Midwest, USA
|
Posted: Thu Apr 16, 2009 5:31 pm Post subject: |
|
|
Perhaps I'm just not getting it.
How can I use this practically while typing in notepad for example? I would imagine I could press a hotkey, it would select all, and process for misspelled words? Or would it have to do one word at a time?
Can someone give example code as to how to do this? I looked at the example code included in the spell.ahk code, but it doesn't seem to work for me. _________________ SilverEdge78 |
|
| Back to top |
|
 |
sugardaddy
Joined: 05 Aug 2006 Posts: 41
|
Posted: Sun Jun 14, 2009 5:09 pm Post subject: |
|
|
This works fine as long as the script doing the spell check is in the same folder as the Spell code. But I want to be able to call Spell from different programs. I tried making the paths in the Init() absolute instead of relative, but it still didn't work. Any clues?
| Code: | #include C:\Spell_10\Spell.ahk
hSpell_word = win
hSpell := Spell_Init("dic\en_US.aff", "dic\en_US.dic")
if (Spell_Spell(hSpell, hSpell_word)) {
msgbox, 0, , "%hSpell_word%" is spelled correctly.
} else {
hSpell_suggestions_len := Spell_Suggest(hSPell, hSpell_word, hSpell_suggestions)
msgbox These words might match...`n`n%hSpell_suggestions_len% - %hSpell_suggestions%
}
Spell_Uninit( hSpell ) |
|
|
| Back to top |
|
 |
sugardaddy
Joined: 05 Aug 2006 Posts: 41
|
Posted: Tue Jun 16, 2009 7:57 pm Post subject: |
|
|
I figured it out. My Spell.ahk function library was in the same folder as the DLL, but since I was doing an "#include", the base of reference was the file I was running. So I changed all the functions in Spell.ahk to accept another param: the path to the Spell directory. I pass that in, and all is well.
Note: I also changed the DLL calls in Spell.ahk to have the full path. |
|
| Back to top |
|
 |
siafulinux
Joined: 01 Dec 2009 Posts: 3
|
Posted: Tue Dec 01, 2009 6:26 pm Post subject: Thanks |
|
|
| Thank you so much for this. I'm currently working on a script for my job that does multiple things, but one big issue is spell check, because the current software doesn't include it. This is going to make life a lot easier! |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 748 Location: Texas, USA
|
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 748 Location: Texas, USA
|
Posted: Wed Feb 03, 2010 1:02 pm Post subject: |
|
|
majkinetor,
A program that checks your spelling has always been a great value so when this library was released, I (like many) popped my head up and said, "Hey, this is cool!". Unfortunately (for me), I haven't had any real need to incorporate a spell checker into anything until recently so... I took a few minutes (OK, more than a few) to play with the library.
One of the things that popped up rather quickly was a lack of a custom dictionary. It's no big deal at first, but after a lot of use, you grow very weary of having custom words pop up again and again (and again!).
I hope you don't mind but I've been re-working the library to add the following:
- Support for multiple custom dictionaries.
- Support dynamic DLL location (DLL file can be anywhere).
- Improved performance.
After the code settles down, I'll PM you with the changes. If you decide you like it, you can incorporate it (none, some, or all) into the library.
Laters...
I actually used the Spell library to spell check this rambling before I posted it. Pretty cool! |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Wed Feb 03, 2010 1:44 pm Post subject: |
|
|
Custom dicts could be easily compiled.
Aif and Dict files can be generated from AHKL.
Dict file is list of lines containing words with first line containing number of records.
Aif can be just copy of full dictionary.
With PutWord you can temporarily add word to dict. _________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Fri Feb 05, 2010 3:03 pm Post subject: |
|
|
*** v1.1 ***
Updates by jballi:
- To allow for a dynamic DLL file location, the library is defined in one location (Spell_Init) and the rest of the functions use the hSpell variable to get at the API functions which remain in memory until the Spell_Uninit function is run.
- There are two function to support custom dictionaries. One to load the words from the custom dictionary to the active dictionary (very fast. Takes about 7 ms to load 1,000 custom words) and another function to add words to a custom dictionary file. The functions were very deliberately separated so as to be able to support multiple custom dictionaries.
- Custom dictionaries are dictionaries as defined by applications like Microsoft Word, IESpell, etc. They are simple text files that can be edited by the user. They are not compiled dictionaries (or personal dictionaries as defined by HunSpell) that include metadata. There are no special programs or rules to maintain them.
_________________
 |
|
| Back to top |
|
 |
Gauss
Joined: 10 Sep 2009 Posts: 203
|
Posted: Wed Apr 28, 2010 3:52 pm Post subject: |
|
|
I wish majkinetor could like noobs alittle bit more
How can I use this with other programs, like msn or yahoo or notepad? |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Wed Apr 28, 2010 4:51 pm Post subject: |
|
|
Although module is meant to be used with AHK scripts, you could use it with 3thd party tools in different ways.
- By monitoring clipboard
- Via timer, where you can get the text from the child control containing text.
- Perhaps even with hook, but that is far from trivial. _________________
 |
|
| Back to top |
|
 |
|