Dennis Lee Bieber wrote:
And is it supposed to handle
for london give the weather to me
for the london weather give me
Or
Where can I buy some new weather boarding for my
house in London?
:-)
--
Greg
...
Do a search on "natural language p
On May 16, 2:57 pm, CM wrote:
> > > I need help with getting the useful information how do I get the place
> > > if I don't now how long the string is?
>
> > And is it supposed to handle
>
> > for london give the weather to me
> > for the london weather give me
>
> > ...
>
> > I need help with getting the useful information how do I get the place
> > if I don't now how long the string is?
>
> And is it supposed to handle
>
> for london give the weather to me
> for the london weather give me
>
> ...
>
> Do a search on "natural language
Here's my take on that:
loc = re.search('for\s+(\w+)', string).group(1)
Not much different, really, but it does allow for multiple spaces (\s+) as
well as requiring at least one character in the word (\w+), and I use a
matching group to extract the location directly instead of splitting the
s
superpollo ha scritto:
timo verbeek ha scritto:
I'm planning to create a human word program
A human inputs a string
"Give me the weather for London please."
Then I will strip the string.
"weather for london"
Then I get the useful information.
what:"weather" where:"london"
After that I use the in
timo verbeek ha scritto:
I'm planning to create a human word program
A human inputs a string
"Give me the weather for London please."
Then I will strip the string.
"weather for london"
Then I get the useful information.
what:"weather" where:"london"
After that I use the info.
I need help with ge
On Sat, May 15, 2010 at 9:32 PM, timo verbeek wrote:
> On May 15, 1:02 pm, timo verbeek wrote:
> Place starts always with for
>
Okay, much better.
Given that constraint, it looks like regular expression can do the job. I'm
not very experienced with regex, though.
\w* matches a whole word compo
On May 15, 1:02 pm, timo verbeek wrote:
Place starts always with for
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, May 15, 2010 at 9:12 PM, Xavier Ho wrote:
> You need to have a very, very good set of heruistics and deterministic
> functions to do that.
>
> "How do I get the position of a known word in a string if the length if
> unknown?"
>
And this is what I get for late night e-mailing.
is*
heur
On Sat, May 15, 2010 at 9:02 PM, timo verbeek wrote:
> I'm planning to create a human word program
>
>
> I need help with getting the useful information how do I get the place
> if I don't now how long the string is?
>
> Boy, that is a very hard problem. Are the inputs restricted to anything?
E
I'm planning to create a human word program
A human inputs a string
"Give me the weather for London please."
Then I will strip the string.
"weather for london"
Then I get the useful information.
what:"weather" where:"london"
After that I use the info.
I need help with getting the useful informatio
11 matches
Mail list logo