• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Spellcheck a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spellcheck a list


  • Subject: Re: Spellcheck a list
  • From: Graff <email@hidden>
  • Date: Mon, 04 Oct 2004 00:35:19 -0400

Many Unix-type systems have a few dictionary files located at "/usr/share/dict/", including Mac OS X. The "look" command will do most of the dirty work for you or you can use the "grep" command:

----
on CheckWord(theWord)

	set quotedWord to quoted form of ("^" & theWord & "$")
	try
		do shell script "grep " & quotedWord & "  /usr/share/dict/words"
		display dialog theWord & " is correct"
	on error
		display dialog theWord & " is not correct"
	end try
end CheckWord

CheckWord("youth")
CheckWord("yoot")
----

With a bit of regular expressions thrown in you could have a decently powerful spell checker.

You could also use Fink to install the program "aspell" and then use it through the "do shell script" command:
<http://fink.sourceforge.net/pdb/package.php/aspell>


- Ken

On Oct 3, 2004, at 5:07 PM, Skinner Paul wrote:

I'd like to spellcheck a list of items and separate the misspelled to a new list. Any suggestions? To add to the mix, I need to sort pairs of words where one is invalid to the misspelled list as well.

Data sample
ketchup<TAB> cetchup, catsup, tomato kechup, tomato catsup, condiment, condiments, cechup, tomato cetchup <return>


Code isn't really the problem here, I'm looking for a database, either built-in or not that I can use. I'd wanted to interface with resources.dictionary.com and use their data, as in the future I'd love to get synonym and definition data. Unfortunately, their Terms of use says no commercial use. So, I searched google and found Wordnet <http://www.cogsci.princeton.edu/~wn/> which seems to be the solution. Mind-opening. Unfortunately it's 1006 (Couldn't complete the last command because the application or extension is not scriptable. Result Code = 1006).

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Spellcheck a list
      • From: Emmanuel <email@hidden>
References: 
 >Spellcheck a list (From: Skinner Paul <email@hidden>)

  • Prev by Date: Re: GUI programming
  • Next by Date: Re: GUI programming
  • Previous by thread: Re: Spellcheck a list
  • Next by thread: Re: Spellcheck a list
  • Index(es):
    • Date
    • Thread