coli-saar / alto

Alto, the Algebraic Language Toolkit
Other
16 stars 2 forks source link

TAG grammars with weird closing brackets #44

Closed alexanderkoller closed 4 years ago

alexanderkoller commented 5 years ago

When a tulipac grammar has extra closing brackets, it is silently read, but no sentences can be parsed. The grammar below should parse "der mann ruht", but does not.

family alphaintrans: { intrans1, intrans2, intrans3 }

tree intrans1:
  S {
    NP![case=nom] []
    V+ 
    }

tree intrans2:
  S {
    V+
    NP![case=nom] [] 
    }

tree intrans3:
  S {
    D! [] []
    NP![case=nom] []
    V+ 
    }
}

word 'schl"ä"ft': <alphaintrans> 
word 'ruht': <alphaintrans> 

tree d:
  D+

tree np_n:
  NP[][case=?case, gen=?gen] {
    Det! [case=?case, gen=?gen] []
    N+   [case=?case, gen=?gen] []
  }

tree aux_adj:
  N [][case=?case, gen=?gen] {
    Adj+ [case=?case, gen=?gen, art=?a][]
    N* [case=?case, art=?a][]
  }

tree det:
  Det+

word 'mann': np_n[case=nom, gen=m]
word 'mann': np_n[case=acc, gen=m]
word 'mann': np_n[case=dat, gen=m]

word 'der': det[case=nom, gen=m,art=bes]
word 'ein': det[case=nom, gen=m,art=unb]

lemma 'blond': aux_adj {
  word 'blonde': [case=nom]
  word 'blondes': [case=nom, art=unb, gen=n]
  word 'blonden': [case=dat]
  word 'blonde': [case=acc, art=bes, gen=n]
  word 'blondes': [case=acc, art=unb, gen=n]
}