Help on finding word is valid as per English Dictionary through python

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jun 25 16:44:36 EDT 2010


Please don't top post!

On 25/06/2010 15:20, Shashwat Anand wrote:
> why do you need that ?
> which platform are you onto ?
>
> On OSX you can use 'DictionaryServices' API
> eg.,
>
> import sys
> import DictionaryServices
> word = " ".join(sys.argv[1:])
> print DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word)))
>
> Gives the meaning of the input word (works with python 2.5)
>
> You can use this script for Vi  (~/.vimrc) if you want, control+a will do a
> spell check.
>
> " Toggle Spell-Check
> set spell spelllang=
> function ToggleSpellCheck()
>   if&spelllang == "en"
> set spelllang=
> else
>   set spelllang=en
> endif
> endfunction
> command! ToggleSpellChecking call ToggleSpellCheck()
> nmap<c-a>  :ToggleSpellChecking<cr>
>
> But again am not aware of your use case.
>
> On Fri, Jun 25, 2010 at 7:19 PM, Thomas Jollans<thomas at jollans.com>  wrote:
>
>> On 06/25/2010 03:30 PM, anu python wrote:
>>> Hi,
>>>                I have a text file ,
>>> a.txt
>>> ------------------------
>>>
>>> this is a lcose button
>>>
>>> where u can observer  "lcose"  is not a valid word.It's typing
>>> mistake.Actual word is "close".

How do you discover the difference between e.g. use and sue, or are you 
not interested in that?

>>>
>>> How can i check that each word entered in txt file having correct
>>> meaningful words as per English Dictionary.
>>>
>>> Do you have any package which can check "English Dictionary"
>>
>> In a pinch, I might use open("/usr/share/dict/words", "r") as a
>> thesaurus, and check for words in there. Read the file and create a
>> giant frozenset or something. For something a bit more civilized, I
>> expect that there's a python package interfacing at least one of
>> (ispell, aspell, hunspell, myspell) (and what they're all called.
>>
>> There is a multitude of "English dictionaries". Some don't even include
>> "neighbour", imagine that!
>>
>>>
>>> Please help me.
>>>
>>> Thanks,
>>> Anu
>>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>

Are you talking about correct English, as in that from Angleland, or are 
you going for one of those silly foreign ones, like USA, South Africa, 
Australia, New Zealand or wherever?

Kindest regards.

Mark Lawrence.

p.s. my mum was a Celt as in Welsh!!!




More information about the Python-list mailing list