I have been analyzing the history of poker hands over the past year, and have generally understood parsing.
We started with regular expressions, but quickly realized that they would not scale easily. We skipped languages from ruby to C ++ and finally realized that this is an algorithm that was supposed to change.
We raised Boost :: Spirit and watched our speed increase dramatically in order of more than 10 times our initial speed. We then moved on to java and currently use antlr to create grammars for each site. This is by far the fastest method, and it is very thorough, and that’s good, because you know exactly where you stand in terms of “full” grammar. Unfortunately, I spent a huge amount of time working with these grammars - they work pretty well, but not quite.
In any case, taking into account the question, it’s enough to answer the question - are there any “exotic” or lesser-known methods of analysis that I don’t know about? I only know about lexing / parsing grammar, and another lower regex / loop method.
For those of you who are not familiar with poker hand histories, I'll post them so you can find out what a structure is.
Full Tilt Poker Game #12037626529: Table durrrr (heads up, deep) - $500/$1000 -
Pot Limit Omaha Hi - 2:00:48 ET - 2009/05/05
Seat 1: durrrr ($196,456.50)
Seat 2: Gus Hansen ($65,499)
durrrr posts the small blind of $500
Gus Hansen posts the big blind of $1,000
The button is in seat #1
*** HOLE CARDS ***
durrrr raises to $3,000
Gus Hansen raises to $9,000
durrrr calls $6,000
*** FLOP *** [3d 4d 7d]
Gus Hansen has 15 seconds left to act
Gus Hansen checks
durrrr checks
*** TURN *** [3d 4d 7d] [Jh]
Gus Hansen checks
durrrr checks
*** RIVER *** [3d 4d 7d Jh] [Ah]
Gus Hansen has 15 seconds left to act
Gus Hansen checks
durrrr has 15 seconds left to act
123stayfree (Observer): GUS I NOW BRING U LUCK
durrrr bets $7,600
Gus Hansen has 15 seconds left to act
Gus Hansen has requested TIME
Hernandez777 (Observer): Gus has the super-duper nuts
Gus Hansen calls $7,600
Podobed45 (Observer): fluuuuuuuuuush
*** SHOW DOWN ***
durrrr shows [Kc 3s Qd As] two pair, Aces and Threes
Gus Hansen mucks
durrrr wins the pot ($33,199.50) with two pair, Aces and Threes
*** SUMMARY ***
Total pot $33,200 | Rake $0.50
Board: [3d 4d 7d Jh Ah]
Seat 1: durrrr (small blind) collected ($33,199.50)
Seat 2: Gus Hansen (big blind) mucked
I am well aware of other methods of gathering information (for example, screenwriting and pasting dlls), but the need to transform hand history into structured data still exists, so I am only looking for methods that capture such as regex / grammars ...
I think that if I do not find something, I am going to rewrite our grammars with ocamllex / ocamlyacc.
Update
fyi: ~ 60 /, 600+ /... xml , ... 20-30 ( ) , ... lexer/parser ( )
, ocamllex/ocamlyacc.... - .