apertium / apertium-recursive

Recursive structural transfer module for Apertium
https://wiki.apertium.org/wiki/Apertium-recursive
GNU General Public License v3.0
6 stars 4 forks source link

rule (line) numbers on -T parse tree #84

Open unhammer opened 2 years ago

unhammer commented 2 years ago

The parse tree is very handy and succinct, but would be even nicer if we could see the rule line number there. The -r output quickly gets noisy when lots of rules are rejected, just a few words can give pages of output. Something like

^lærebog<DP><ut><sg><ind>{         // rule 27 "main dp rule" line 204
        ^en<det><qnt><m><sg>/en<det><ind><ut><sg>$
        ^lærebog<NP><ut><sg><ind>{         // rule 19 "adj noun phrase" line 139
                ^relativ<A><sint><pst><nt><sg><ind>{         // rule 11 "adjmain" line 115
                        ^relativ<adj><pst><nt><sg><ind>/relativ<adj><sint><pst><nt><sg><ind>$
                }$
                ^lærebog<NP><ut><sg><ind>{         // rule 19 "adj noun phrase" line 139
                        ^fin<A><sint><pst><ut><sg><ind>{         // rule 11 "adjmain" line 115
                                ^fin<adj><sint><pst><mf><sg><ind>/fin<adj><sint><pst><ut><sg><ind>$
                        }$
                        ^lærebog<NP><ut><sg><ind>{         // rule 3 "basic noun phrase" line 107
                                ^lærebog<N><ut><sg><ind>{         // rule 1 "nouns" line 101
                                        ^lærebok<n><m><sg><ind>/lærebog<n><ut><sg><ind>$
                                }$
                        }$
                }$
        }$
}$