SLIDE 3 3
CoLi Saarland University
Flex program for filtering out SGML m arkings
/* Call this file StripSGML.lx, and then run: Flex -8 –CF StripSGML.lx; gcc –o StripSGML lex.yy.c –lfl –s To pass this simple filter over a text file called toto, run: StripSGML < toto %% “<“[^\n<>]+“>“; ECHO; ECHO; [\n] %%
Delete SGML markings from an input files
CoLi Saarland University
Flex program for dehyphenating a text
/* Call this file dehyphen.lx, and then run: Flex -8 –CF dehyphen.lx; gcc –o dehyphen lex.yy.c –lfl –s To pass this simple filter over a text file called toto, run: dehyphen < toto %% [a-z]-[\t]*\n[\t] * {printf( “%c“,yytext[0]);} %%
Lower-case letter, followed by a hyphen, then any number of tabs or spaces, followed by a newline character and more spaces.