Tweak lexicon_filter.in for GNU sed

This commit is contained in:
Kevin Ballard 2014-10-01 18:02:01 -07:00
parent b592da41f6
commit 47c357a354
2 changed files with 3 additions and 3 deletions

View file

@ -414,7 +414,7 @@ lexicon_filter: lexicon.txt lexicon_filter.in
if echo x | $(SED) "/[[:<:]]x/d" 2>/dev/null; then \ if echo x | $(SED) "/[[:<:]]x/d" 2>/dev/null; then \
WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \ WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \
else \ else \
WORDBL='\<'; WORDBR='\>'; \ WORDBL='\\<'; WORDBR='\\>'; \
fi; \ fi; \
$(SED) <lexicon.txt >>$@.tmp -n \ $(SED) <lexicon.txt >>$@.tmp -n \
-e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" \ -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" \

View file

@ -530,7 +530,7 @@ s/\n$//g
# characters. Basically the inverse of the 'patternflush' action, with # characters. Basically the inverse of the 'patternflush' action, with
# additional trailing characters stripped. # additional trailing characters stripped.
x x
/^\<@[^}]*$/ ! { /^<@[^}]*$/ ! {
s/[^\<]*// s/[^\<]*//
s/^ *\\\n//g s/^ *\\\n//g
s/\n *\\//g s/\n *\\//g
@ -551,7 +551,7 @@ x
} }
s/\\\n/\ s/\\\n/\
/ /
s/\< \n// s/< \n//
s/^[a-z][a-z]* \n// s/^[a-z][a-z]* \n//
#. #.
# Swap the buffers back. # Swap the buffers back.