Skip to content

Parser of CCG (Combinatory Categorial Grammar) implemented in Haskell

License

Notifications You must be signed in to change notification settings

SatoMichi/CCG_Parser_in_Haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CCG_Parser_in_Haskell

Parser of CCG (Combinatory Categorial Grammar) implemented in Haskell
HaskellによるCCG (組み合わせ範疇文法) パーサーの実装

What is CCG (Combinatory Categorial Grammar)

CCGはProfessor. Mark Steedmanによって提案された文法理論の一つである。CFG(文脈自由文法)などに代表される文法との違いは各単語が各カテゴリ(自然言語でいえば形態素など)に加えてセマンティクスを担う部分として型付きラムダ式を保持している点であるといえる。
CCG is a grammatical theory proposed by Professor. Mark Steedman, which differs from grammars such as CFG (Context-Free Grammar) in that each word has a typed lambda expression as its semantics in addition to its category (e.g. part of speech tag in natural language).

例(example):
ccg1
A/B = function which takes category B at the right side and return category A
A\B = function which takes category B at the left side and return category A

There is several gramatical rules:

Application combinators
ccg2
">" = forward composition applying function forward (left to right)
"<" = backward composition applying function backward (right to left)

Composition combinators
ccg3

Type-raising combinators
ccg4

Substitution

(X/Y)/Z Y/Z => X/Z 
(X/Y)\Z Y\Z => X\Z
Y\Z (X\Y)\Z => X\Z
Y/Z (X\Y)/Z => X/Z

retireved from https://qiita.com/q-ikawa/items/cf1bb593185333d88d66

Example of Proof:
ccg5

In the above steps, we only forcused on category of the each words and (sub-)sentence since we only concentrated on the category of the word and sentences. However by combining semantic lambda function, it is possible to construct the semantic of the whole sentence from semantic of each words.

Example of Proof with semantic:
ccg6
image from (Lee, K. et al, 2014)

References

About

Parser of CCG (Combinatory Categorial Grammar) implemented in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published