3 ms·
hfst (open source rewrite of the Xerox finite state toolkit) includes negation: $ echo 'a b c b c d*' | hfst-regexp2fst > ab.fst $ echo 'c ?+'
by unhammer 6y ago
hfst (open source rewrite of the Xerox finite state toolkit) includes negation:
$ echo 'a b
c b
c d*' | hfst-regexp2fst > ab.fst
$ echo 'c ?+' | hfst-regexp2fst >cdotplus.fst
$ hfst-intersect ab.fst cdotplus.fst | hfst-expand -c3
cb
cd
cdd
cddd
cdddd
$ hfst-expand -c3 ab.fst
ab
cb
c
cd
cdd
cddd
The regex syntax is a bit quirky due to backwards compatibility with lexicons written in XFST, see https://github.com/hfst/hfst/wiki/Regular-Expression-Operators https://github.com/hfst/hfst/wiki/Regular-Expression-Operato...