Next: Leftmost-longest contexted replacement.
Up: Regular Expression Operators in
Previous: Priority Union for lexical
The replace operator.
In [19] a variant of the replace operator is
implemented which is more efficient than previous implementations
provided by Kaplan and Kay [12] and Karttunen
[13]. This improved version crucially depends on the
possibility of manipulating the transitions and states of the underlying
automata directly. The replacement of expression Phi into
Psi in the context of Left and Right is written
replace(Left,Phi,Psi,Right). In the left-to-right interpretation, this
operator can be defined as the following cascade:
![\begin{displaymath}\begin{minipage}[t]{.9\textwidth}\begin{verbatim}macro(repl...
...o replace(Phi,Psi) o l1(L) o l2(L))\end{verbatim}\end{minipage}\end{displaymath}](img27.gif) |
(23) |
This definition and the definitions of the auxiliary operators are
closely modelled on those given in [19]. The
auxiliary operators are defined in the appendix.
A typical example of the use of the replace operator is provided by
the past tense endings of Dutch regular verbs. In Dutch, the singular
past tense is formed by the -de and -te suffixes. If the
previous phoneme is voiced, the suffix -de must be used; in
order circumstances the -te suffix is appropriate. This
phenomenon can be analysed by assuming an underlying, abstract,
-Te suffix. The T is then transformed into a d or
t depending on context. The rule can be defined as follows (the
+ indicates a morpheme boundary):
![\begin{displaymath}\begin{minipage}[t]{.9\textwidth}\begin{verbatim}macro(tkof...
...'T',t,e)
o
replace(+,'T',d, [])\end{verbatim}\end{minipage}\end{displaymath}](img28.gif) |
(24) |
Next: Leftmost-longest contexted replacement.
Up: Regular Expression Operators in
Previous: Priority Union for lexical
2000-07-03