AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Spell 1.1
Goto page 1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sat Jun 21, 2008 1:53 pm    Post subject: Spell 1.1 Reply with quote

 

_________________


Last edited by majkinetor on Fri Feb 05, 2010 2:57 pm; edited 2 times in total
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Sat Jun 21, 2008 2:11 pm    Post subject: Reply with quote

They're missing dictionary for my language Sad
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
View user's profile Send private message
Zippo()
Guest





PostPosted: Sat Jun 21, 2008 5:00 pm    Post subject: Reply with quote

Excellent. Thanks.
Back to top
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Sat Jun 21, 2008 10:49 pm    Post subject: Reply with quote

Looks useful. Thanks. Very Happy
Back to top
View user's profile Send private message Send e-mail
silveredge78



Joined: 25 Jul 2006
Posts: 481
Location: Midwest, USA

PostPosted: Thu Apr 16, 2009 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
sugardaddy



Joined: 05 Aug 2006
Posts: 41

PostPosted: Sun Jun 14, 2009 5:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
sugardaddy



Joined: 05 Aug 2006
Posts: 41

PostPosted: Tue Jun 16, 2009 7:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
siafulinux



Joined: 01 Dec 2009
Posts: 3

PostPosted: Tue Dec 01, 2009 6:26 pm    Post subject: Thanks Reply with quote

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
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Tue Feb 02, 2010 3:32 pm    Post subject: Reply with quote

The link to the Hunspell documentation appears to be bad (404). Here's what is posted on the documentation page for this library:
http://sourceforge.net/docman/display_doc.php?docid=115683&group_id=143754

... and here's the link from the main Hunspell page (I think it goes to the same place):
http://sourceforge.net/docman/?group_id=143754

Does anyone have the correct link (if any) or worst case, can anyone load a copy of the API documentation to AutoHokey.net (or anywhere including email) so I can have a look/see?

Thanks.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Tue Feb 02, 2010 4:41 pm    Post subject: Reply with quote

This link was available from sourceforge main page (it still is). However, even there it doesn't work anymore.

This is the first thing I found, c .h file:
http://hunspell.sourcearchive.com/documentation/1.1.9/hunspelldll_8h-source.html


At this moment, I guess module can be upgraded in AHKL to handle Unicode dictionaries.
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Wed Feb 03, 2010 1:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Wed Feb 03, 2010 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Feb 05, 2010 3:03 pm    Post subject: Reply with quote

*** 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
View user's profile Send private message
Gauss



Joined: 10 Sep 2009
Posts: 203

PostPosted: Wed Apr 28, 2010 3:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Wed Apr 28, 2010 4:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group