A CCG parser library written in Haskell with a CYK parsing algorithm.
I hope to make the interface a bit more intuitive in the future, but for the time being, this is a rough guide to using the library.
Use the createLexicon function imported from Lex to create a new lexicon. Lexicons are maps from string keys to list of categories as values.
Example:
let l = createLexicon [
("I", [CmplxLeaf NP]),
("am", [CmplxTree (CmplxTree (CmplxLeaf S) Back (CmplxLeaf NP)) Forw (CmplxLeaf NP)]),
("a",[CmplxTree (CmplxLeaf NP) Forw (CmplxLeaf N)]),
("parser",[CmplxLeaf N])
]
Once you have a lexicon, simply call the parse function imported from Parser on your lexicon and a list of string input tokens:
parse l ["I", "am", "a", "parser"]
The parser will return an empty list if it fails to find a valid parse or it will return the list of valid parse trees.
The CYK parsing algorithm used here is an adaptation of the algorithm developed by Peter Ljunglöf. See his original repo for the more generalized algorithm. Those further interested in this algorithm or other Haskell parsing algorithms are encouraged to consult his excellent thesis on the subject.