previous next Title Contents

7 Sample errgen rules file

#############################################################

## Example of rules for the _errgen_ package.

## These rules have been used to produce the error items related

## in the TEMAA report D13.

## Most rules are meant for errors specific to the Italian language.

## last modified by Sandra Manzi, Oct. 1995

## <sandra@divsun.unige.ch>

##

#############################################################

Declaration

$Vowel="[aeiou]"

End

Declaration

$Consonant="[bcdfghlmnpqrstvz]"

End

## easiest way for the cqu/qu/cu errors

Declaration

$NotC="[abdefghilmnopqrstuvz]"

End

## inserts extra "b" in words like "amabile", "fattibili", etc.

Rule bbil

s/($Vowel)bil($Vowel)/$1bbil$2/

End

## exchanges cu/qu

Rule squola

s/($NotC)cu($Vowel)/$1qu$2/

End

## exchanges cqu/cu

Rule aqua

s/cqu($Vowel)/cu$1/

End

## exchanges qu/cu

Rule cincue

s/($NotC)qu($Vowel)/$1cu$2/

End

## introduces a "g" in given context;

## must correctly restrict preceding character to obtain desired result.

## desired result: miliardo -> migliardo

## undesired resul: ampliare -> ampgliare

Rule gli

s/($Vowel)(li$Vowel)/$1g$2/

End

## undoubles a consonant pair

Rule sdoppia

s/($Consonant)\1/$1/

End

## exhanges an "n" for an "m" and vice versa

Rule mn

s/m/n/

s/n/m/

End

Rule doubleanychar

# double some character

s/(.)/$1$1/

End

Rule doublevowel

# double some vowel

s/($Vowel)/$1$1/

End

Rule undoublevowel

# undouble some vowel (note the \1)

s/($Vowel)\1/$1/

End

Rule swap

# permutation: the -> teh/hte

s/(.)(.)/$2$1/

End

Rule nextkey

# replace letter by a neighbouring key on my keyboard (Not the nicest..)

s/a/s/

s/w/e/

s/e/r/

s/r/t/

s/t/y/

s/d/f/

s/k/l/

s/i/o/

s/b/n/

s/c/v/

s/f/g/

s/v/b/

# etc etc, as you see I'm using a qwerty

End


previous next Title Contents