GSoC/GCI Archive
Google Code-in 2014 Apertium

Add support for reordering to a bison syntax tree AST

completed by: Stan K.

mentors: Kevin Brubeck Unhammer, Francis Tyers

Take some code for a bison syntax tree AST and add support for node reordering. For example:

 

S -> NP VP { $1 $2 }

VP -> V NP { $2 $1 }

DP -> Det NP { $2 $1 }

NP -> N { $1 } | AP N { $2 $1 } | DP { $1 }

AP -> A { $1 } | A AP { $2 $1 }

A -> adjec { $1 }

N -> noun { $1 }

Det -> det { $1 } 

V -> verb { $1 } 

 

Would produce two trees for the following sentence:

 

The bear eats a small tree .

The<det> bear<n> eats<vblex> a<det> small<adj> tree<n> .<sent>

 

Tree (1) -- unordered source language tree (SL):

 

[S [DP [Det the<det>] [NP [N bear<n>]]] [VP [V eats<vblex>] [DP [Det a<det>] [NP [AP [A small<adj>]] [N tree<n>]]]]]

 

Tree (2) -- reordered target language tree (TL)

 

[S [DP [NP [N bear<n>]] [Det the<det>]] [VP [DP [NP  [N tree<n>] [AP [A small<adj>]]] [Det a<det>] ] [V eats<vblex>]]]