apertium / lttoolbox

Finite state compiler, processor and helper tools used by apertium
http://wiki.apertium.org/wiki/Lttoolbox
GNU General Public License v2.0
18 stars 22 forks source link

May swallow last lexical unit if no final newline #104

Closed unhammer closed 4 years ago

unhammer commented 4 years ago
$ printf  ".\n"|apertium-destxt -n|lt-proc -we nob.automorf.bin
^./.<sent><clb>$[][
]

$ printf  "."|apertium-destxt -n|lt-proc -we nob.automorf.bin
[]

$ printf  "r."|apertium-destxt -n|lt-proc -we nob.automorf.bin
^r/ralphabet<n><m><sg><ind>$[]

$ printf  "9"|apertium-destxt -n|lt-proc -we nob.automorf.bin
[]

$ printf  "9\n"|apertium-destxt -n|lt-proc -we nob.automorf.bin
^9/9<det><qnt><un><pl>$[][
]

$ printf  "r"|apertium-destxt -n|lt-proc -we nob.automorf.bin
^r/ralphabet<n><m><sg><ind>$[]

9 and . are in inconditional sections, while r is standard, might have something to do with this.

TinoDidriksen commented 4 years ago

Probably the same issue: echo -e 'États-Unis\0' | lt-proc -w fra.automorf.bin (see https://github.com/apertium/apertium/issues/108)

(Note that -z is not needed to trigger this behavior, and adding -z doesn't change the lack of output.)