EXERCISE 2
Spelling rules for verbs
Goal
Write a transducer which, given the root of a (regular) verb and its ending,
determines the correct spelling for this form.
Endings are +ed, +ing or +s.
Examples:
-
work+ed => worked
-
bake+ed => baked
-
try+s => tries
Data
The files you need are (download or copy from ~gosse/NLP/exercise2/)
Makefile
morph.pl
replace.pl
test_data.eng
data.eng
Use the file morph.pl as a starting point and improve this.
The test material is test_data.eng
After you checked with fsa -tk whether everything works, you can test
your solution with
make errors
This processes the first column of the test data, and produces surface
forms. The result is results Differences between the second column
of the test data and results are written to the file errors.
To do a fresh test it is sometimes necessary to do
make clean
first.
Report
Mail the programmorph.pl in, and the file errors.
Document your program
Deadline: Friday, May, 9.
N.b.
-
The rule morph uses the sigma macro: sigma(Input,Output,Regex)
restricts a reducer Regex to inputs consisting of symbols in Input
and outputs with symbols in Output. If this fails, the transduces
will not produce any output, and the scores for the number of errors
will be wrong. (When this happens, '0 outputs' will flash on the screen).
-
The test data are 10% of the available material. The rest is in data.eng.
You can check this for inspiration...