Re: [Corpora-List] fast string replacement

From: Leif Arda Nielsen (nielsen@dcs.kcl.ac.uk)
Date: Fri Mar 11 2005 - 16:31:49 MET

  • Next message: Andrew Kehoe: "RE: [Corpora-List] Query about nomenclature"

    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@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
    >
    >
    >
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2b29 : Fri Mar 11 2005 - 16:48:08 MET