[Corpora-List] fast string replacement

Leif Arda Nielsen nielsen at dcs.kcl.ac.uk
Fri Mar 11 15:31:49 UTC 2005


You can use sed, pre-installed on most linux distributions. The rules
you wrote would be :

sed -e 's/nice/nice\/adj/g' -e 's/books/books\/v:3:pres;n:plur' input >
output

Instead of a one-liner, you can also write it in a program form if you
prefer.

Leif

js at cis.uni-muenchen.de wrote:

>Hello,
>
>I am looking for a program that
>
>- takes as input a string (!) rewriting dictionary and and a corpus
>- applies all rewriting rules to all lines of the corpus
>- is fast, stable and free
>- works under Linux
>
>Example:
>
>Some rewriting rules:
>
> book3, books/v:3:pres;n:plur
> nice, nice/adj
>
>A "corpus" before transduction:
>
> John reads nice books.
>
>The same corpus after transduction:
>
> John reads nice/adj books/v:3:pres;n:plur
>
>Does anyone know such a program?
>
>Jörg Schuster
>
>
>
>
>
>
>
>



More information about the Corpora mailing list