Computational Formal Semantics: Parsing (Part 1)
Sun 26 May 2013 by Adrian BrasoveanuPlan for the May 28 (11 am-12 pm) meeting: we will begin our discussion of natural language parsing (based primarily on ch. 9 of the “Computational Semantics” textbook). Please download the files below and place them in the same folder:
- basic definitions — trees, positions in a tree, subtrees, (proper) dominance, sisterhood, c-command, precedence etc.: BasicDef.hs
- a toy recognizer and parser for palindromes: Palindromes.hs
- a small set of parser combinators: ParserCombinatorsMini.hs
- a first GHCI script that introduces the basic notions: ParsingGhci1.hs
- a second GHCI script that introduces the parser-combinator idea and builds a parser for a very small grammar of English: ParsingGhci2.hs
More information about the parser-combinator approach to parsing and its advantages and disadvantages is available here:
- S. Doaitse Swierstra (2009): Combinator Parsing: A Short Tutorial
For a standard example in Haskell, take a look at Parsec. A Parsec tutorial is available here: http://book.realworldhaskell.org/read/using-parsec.html.