AutoHotkey Community

It is currently May 26th, 2012, 5:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Spell 1.1
PostPosted: June 21st, 2008, 2:53 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
 

_________________
Image


Last edited by majkinetor on February 5th, 2010, 3:57 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 3:11 pm 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 6:00 pm 
Excellent. Thanks.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 11:49 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
Looks useful. Thanks. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 16th, 2009, 6:31 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 6:09 pm 
Offline

Joined: August 5th, 2006, 8:34 pm
Posts: 41
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 )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 8:57 pm 
Offline

Joined: August 5th, 2006, 8:34 pm
Posts: 41
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: December 1st, 2009, 7:26 pm 
Offline

Joined: December 1st, 2009, 7:24 pm
Posts: 3
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2010, 4:32 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2010, 5:41 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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/docum ... ource.html


At this moment, I guess module can be upgraded in AHKL to handle Unicode dictionaries.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2010, 2:02 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2010, 2:44 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 4:03 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
*** 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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2010, 4:52 pm 
Offline

Joined: September 10th, 2009, 5:54 pm
Posts: 203
I wish majkinetor could like noobs alittle bit more
How can I use this with other programs, like msn or yahoo or notepad?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2010, 5:51 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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