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

2010-06-25 Thread anu python
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 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"

Please help me.

Thanks,
Anu
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python-list Digest, Vol 81, Issue 266

2010-06-26 Thread anu python
Thanks for your reply  to Shashwat Anand & thomas.sub( Help on finding word
is valid as per English Dictionary through   python )

Let me try.


On Fri, Jun 25, 2010 at 8:57 PM,  wrote:

> Send Python-list mailing list submissions to
>[email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
>[email protected]
>
> You can reach the person managing the list at
>[email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
> Today's Topics:
>
>   1. Re: best way to increment an IntVar? (Alan G Isaac)
>   2. Re: Help on finding word is valid as per English Dictionary
>  through   python (Shashwat Anand)
>   3. Re: Why Is Escaping Data Considered So Magical? (Stephen Hansen)
>   4. Re: GDAL-1.7.1 : vcvarsall.bat missing (kBob)
>   5. Re: GDAL-1.7.1 : vcvarsall.bat missing (kBob)
>   6. Re: Python dynamic attribute creation (Bruno Desthuilliers)
>   7. python source code -> win/dos executable (on linux) (superpollo)
>   8. Re: GDAL-1.7.1 : vcvarsall.bat missing (Christian Heimes)
>   9. Re: python source code -> win/dos executable (on linux)
>  (Grant Edwards)
>  10. os.system: string encoding (Peter Kleiweg)
>  11. Re: deprecated string module issue (Stephen Hansen)
>
>
> -- Forwarded message --
> From: Alan G Isaac 
> To: [email protected]
> Date: Fri, 25 Jun 2010 10:12:21 -0400
> Subject: Re: best way to increment an IntVar?
> On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote:
>
>> It is NOT a numeric "variable" in Python realms.
>>
>
> Sure, but why does it not behave more like one?
> It seems both obvious and desirable, so I'm
> guessing there is a good reason not to do it.
>
> So var+=increment can't be used because Python would rebind the
>> name
>> var to a new object
>>
>
>  import Tkinter as tk
>>>>
>>>> class IntVar2(tk.IntVar):
>>>>
>>> ...   def __iadd__(self, val):
> ... self.set(self.get()+val)
> ... return self
> ...
>
>> root = tk.Tk()
>>>> myintvar2 = IntVar2()
>>>> temp = myintvar2
>>>> myintvar2 += 5
>>>> print(myintvar2.get(),myintvar2 is temp)
>>>>
>>> (5, True)
>
> Alan Isaac
>
>
>
> -- Forwarded message --
> From: Shashwat Anand 
> To: Thomas Jollans 
> Date: Fri, 25 Jun 2010 19:50:55 +0530
> Subject: Re: Help on finding word is valid as per English Dictionary
> through python
> 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  :ToggleSpellChecking
>
> But again am not aware of your use case.
>
> On Fri, Jun 25, 2010 at 7:19 PM, Thomas Jollans 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 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