• 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 12:07:41 -0400

On Oct 4, 2004, at 9:06 AM, Jan Steinman wrote:

From: Graff <email@hidden>

you can use the "grep" command:
...
		do shell script "grep " & quotedWord & "  /usr/share/dict/words"

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

If you aren't going to use regular expressions, then fgrep(1) is much faster than grep, although the difference is hardly noticeable unless you're really crunching a huge file. ("f" as is "fixed strings" as opposed to regular expressions.)

I did use a regular expression. I added the start-of-line marker "^" and the end-of-line marker "$" to the string before I quoted it. I did this so that I would get only unique matches rather than any line that contained the string. For example:


using:
    grep '^youth$' /usr/share/dict/words
gives me:
    youth

using:
    fgrep 'youth' /usr/share/dict/words
gives me:
    overyouthful
    preyouthful
    reyouth
    unyouthful
    unyouthfully
    youth
    youthen
    youthful
    youthfullity
    youthfully
    youthfulness
    youthhead
    youthheid
    youthhood
    youthily
    youthless
    youthlessness
    youthlike
    youthlikeness
    youthsome
    youthtide
    youthwort
    youthy

- Ken


_______________________________________________ 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: "Dennis W. Manasco" <email@hidden>
    • Re: Spellcheck a list
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Spellcheck a list (From: Jan Steinman <email@hidden>)

  • Prev by Date: Re: "choose from list" with custom buttons?
  • Next by Date: Re: Spellcheck a list
  • Previous by thread: Re: Spellcheck a list
  • Next by thread: Re: Spellcheck a list
  • Index(es):
    • Date
    • Thread