Re: [Tutor] Fwd: thesaurus

2009-07-09 Thread Alan Gauld
"Angus Rodgers" wrote parsing these two sentences: Time flies like an arrow. Fruit flies like a banana. Or the translation program that translated the expression Out of sight, out of mind from English to Russian and back with the result: Invisible, lunatic Alan G.

Re: [Tutor] Fwd: thesaurus

2009-07-09 Thread Angus Rodgers
>Date: Thu, 9 Jul 2009 04:12:55 +0100 >From: Rich Lovely >Message-ID: > > >Natural language parsers are one of the hardest things to create. I think the most famous illustration of this is the problem of parsing these two sentences: Time flies like an arrow. Fruit flies like a banana. --

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Pete Froslie
oops.. I just realized I attached the wrong example for the API-- it was off by number, this one works: print urllib.urlopen(' http://words.bighugelabs.com/api/2/e413f24701aa30b8d441ca43a64317be/moving/').read( ) The example makes sense to me and I can see how it is difficult to figure out a natu

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Rich Lovely
2009/7/9 Pete Froslie : > I see.. that makes sense. Kind of new with python -- sorry for that. > > after printing using this: > > print > urllib.urlopen('http://words.bighugelabs.com/api/2/e413f24801aa30b8d441ca43a64317be/moving/').read() > > I'm getting a format like this returned: > > adjective|s

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Pete Froslie
I see.. that makes sense. Kind of new with python -- sorry for that. after printing using this: print urllib.urlopen(' http://words.bighugelabs.com/api/2/e413f24801aa30b8d441ca43a64317be/moving/').read( ) I'm getting a format like this returned: adjective|sim|streaming adjective|sim|swirling ad

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Rich Lovely
2009/7/9 Pete Froslie : > No problem, thanks for taking the time. > > I'm actually trying to resolve this error now: > >    buff.append(" ".join(lookup(Word) for Word in line.split())) > NameError: global name 'lookup' is not defined > > ..also assume I need to change 'Word' to something that check

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Pete Froslie
No problem, thanks for taking the time. I'm actually trying to resolve this error now: buff.append(" ".join(lookup(Word) for Word in line.split())) NameError: global name 'lookup' is not defined ..also assume I need to change 'Word' to something that checks the next word in the text file and

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Rich Lovely
2009/7/9 Pete Froslie : > Great Richard, thanks.. > > I'm getting an error as follows: > > from __future__ import with_statement > SyntaxError: from __future__ imports must occur at the beginning of the file > > I don't think this is the issue in need of rework and have tried a few quick > reworks.

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Pete Froslie
Great Richard, thanks.. I'm getting an error as follows: from __future__ import with_statement SyntaxError: from __future__ imports must occur at the beginning of the file I don't think this is the issue in need of rework and have tried a few quick reworks.. I'll read up a bit on 'with' cheers

Re: [Tutor] Fwd: thesaurus

2009-07-08 Thread Rich Lovely
2009/7/9 Pete Froslie : > > > -- Forwarded message -- > From: Pete Froslie > Date: Wed, Jul 8, 2009 at 8:53 PM > Subject: Re: [Tutor] thesaurus > To: Robert Berman > > > Thanks Robert, > > I will try this out.. at the moment I'm playing with an API from > 'http://words.bighugelabs

[Tutor] Fwd: thesaurus

2009-07-08 Thread Pete Froslie
-- Forwarded message -- From: Pete Froslie Date: Wed, Jul 8, 2009 at 8:53 PM Subject: Re: [Tutor] thesaurus To: Robert Berman Thanks Robert, I will try this out.. at the moment I'm playing with an API from ' http://words.bighugelabs.com/'. It works and pulls the synonyms into p