[Haskell-cafe] parsing machine-generated natural text

Udo Stenzel u.stenzel at web.de
Sun May 21 04:54:42 EDT 2006


Evan Martin wrote:
> Here's the beginning of
> the file, where it's not obvious to me how to distinguish elements in
> the "::" section from the rest of the file.
>  :: Judge: USDP  Game: dip  Variant: standard
>  :: Deadline: F1901M Mon 20 Feb 2006 20:00 PST
>  :: URL: http://www.diplom.org/dpjudge?game=dip

You could make "::" the start-of-one-line-comment sequence or you could
just parse these three lines.  You can also throw them away like this:

string " ::" >> many (satisfy (/='\n')) >> newline

 
> Movement results for Fall of 1901.  (dip.F1901M)
> I guess I could make "Movement" a reserved word?

Or simply treat it as such.  'reserved "Movement"' expands to 'lexeme
(string "Movement")', so unless "Movement" appears as keyword where some
other identifier could also occur, you don't need to treat it specially.

 
> It's actually just for rendering nicer maps of the game state.
> http://neugierig.org/software/hsdip/mapview.html
> (It's draggable, too.)

That's nice, too.  There's not much Diplomacy software out there that
runs under Linux, and most that does is painfully slow.


Udo.
-- 
"Hey, Perl-Scripte sind wie Klobürsten.  
Da ist man nicht stolz drauf! Und man 
gibt sie auch nicht weiter.  Schon gar 
nicht in benutzter Form."  -- F. v. Leitner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060521/d8681150/attachment.bin


More information about the Haskell-Cafe mailing list