Parsing a search string

John Machin sjmachin at lexicon.net
Fri Dec 31 22:02:40 CET 2004


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 parsing that syntax...

Parsing your sentence as written ("if I only had"): If you were the
sole keeper of the secret??

Parsing it as intended ("if only I had"), and ignoring the smiley:
Looks like a fairly straight-forward state-transition table to me. The
column headings are not aligned properly in the message, b means blank,
a-Z is bletchworthy, but the da Vinci code it ain't.

If only we had an NDFA (whatever that is) for guessing what acronyms
mean ...

Where I come from:
DFA = deterministic finite-state automaton
NFA = non-det......
SFA = content-free
NFI = concept-free
NDFA = National Dairy Farmers' Association

HTH, and Happy New Year!




More information about the Python-list mailing list