Skip to content

Commit

Permalink
Tests for reparse #80
Browse files Browse the repository at this point in the history
  • Loading branch information
unhammer committed Sep 5, 2023
1 parent 7a112a7 commit d045e26
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/Reparse.input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^ja<cnjcoo>/ja<cnjcoo>$ ^Jämtlánda<np><top><sg><gen><@→N>/Jämtlánnda<np><top><sg><gen><@→N>$ ^regiovdna<n><sem_plc><sg><gen><@→P>/regiåvnnå<n><sem_plc><sg><gen><@→P>$ ^dáfus<post><@ADVL>/gáktuj<post><@ADVL>$^.<sent>/.<sent>$
1 change: 1 addition & 0 deletions tests/Reparse.output
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^ja<cnjcoo>$ ^Jämtlánnda<np><sg><gen>$ ^regiåvnnå<n><sg><gen>$ ^gáktuj<post>$^.<sent>$
42 changes: 42 additions & 0 deletions tests/Reparse.rtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
!!!!!!!!!!!!!!!
!! ATTRIBUTE CATEGORIES
!!!!!!!!!!!!!!!

function = "@→N" "@→P" "@ADVL" ;
number = sg du pl ;
case = acc nom gen loc ine ela com ess ill ;

!!!!!!!!!!!!!!!
!! OUTPUT PATTERNS
!!!!!!!!!!!!!!!

NP: _.number.case.function ;
PP: _ ;

Name: _.number.case.function ;
N: _.number.case.function ;
n: <n>.number.case;

post: _ ;

np: <np>.number.case ;


!!!!!!!!!!!!!!!
!! REDUCTION RULES
!!!!!!!!!!!!!!!

N -> "N:n" %n { %1 } ;

Name -> "N:np" %np { %1 }
| "NP:N Name" N %Name {1 _ %2 } !gonagas Harald
| "NP:N Name" np %Name {1 _ %2 } !
| "NP:N Name" Name %N {1 _ %2 } ! ! Verdens Gang aviisii
;

NP -> "NP: N" %N { %1 } ;


PP -> "PP N post" N %post { 1 _ %2 }
| "lone post" %post { 1 }
;

0 comments on commit d045e26

Please sign in to comment.