Re: Parsing a search string

2004-12-31 Thread Fuzzyman
That's not bad going considering you've only run out of alcohol at 6 in the morning and *then* ask python questions. Anyway - you could write a charcter-by-character parser function that would do that in a few minutes... My 'listquote' module has one - but it splits on commas not whitespace.

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
Freddie wrote: Happy new year! Since I have run out of alcohol, I'll ask a question that I haven't really worked out an answer for yet. Is there an elegant way to turn something like: moo cow farmer john -zug into: ['moo', 'cow', 'farmer john'], ['zug'] I'm trying to parse a

Re: Parsing a search string

2004-12-31 Thread It's me
I am right in the middle of doing text parsing so I used your example as a mental exercise. :-) Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E E

Re: Parsing a search string

2004-12-31 Thread M.E.Farmer
Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
M.E.Farmer wrote: Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) I'm also positively surprised how many cute little additions are there every new Python version.

Re: Parsing a search string

2004-12-31 Thread It's me
Andrew Dalke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E

Re: Parsing a search string

2004-12-31 Thread Brian Beck
Freddie wrote: I'm trying to parse a search string so I can use it for SQL WHERE constraints, preferably without horrifying regular expressions. Uhh yeah. If you're interested, I've written a function that parses query strings using a customizable version of Google's search syntax. Features

Re: Parsing a search string

2004-12-31 Thread John Machin
Andrew Dalke wrote: It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E E E E E E T3 Now if I only had an NDFA for

Re: Parsing a search string

2004-12-31 Thread It's me
John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Andrew Dalke wrote: It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E

Re: Parsing a search string

2004-12-31 Thread Freddie
Reinhold Birkenfeld wrote: Freddie wrote: Happy new year! Since I have run out of alcohol, I'll ask a question that I haven't really worked out an answer for yet. Is there an elegant way to turn something like: moo cow farmer john -zug into: ['moo', 'cow', 'farmer john'], ['zug'] I'm trying to