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

lt-proc -z loops output indefinitely when null not preceded by whitespace #112

Closed mr-martian closed 2 years ago

mr-martian commented 3 years ago

Specifically, when a line ends with multiple analyzable characters immediately before the null, output will be the analysis of the line followed by endless repetitions of the line minus the first character.

$ printf "PATTERNS\n[X]|[XY]\n" | lexd > blah.att
$ lt-comp lr blah.att blah.bin
main@standard 3 2
$ printf "X \0" | lt-proc -z blah.bin
^X/X$
$ printf "X\0" | lt-proc -z blah.bin
^X/X$
$ printf "XY\0" | lt-proc -z blah.bin
^XY/XY$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$^Y/Y$