FSA Transducers Tutorial


Regular expressions for Transducers

Exercises

American and British English

There are a number of well-known differences in spelling between American and British English. Some more or less systematic differences are listed on Spelling differences between American and British English. To the extent that these differences a regular, one might design spelling rules which automatically transform American to British spelling.

Hyphenation

A syllable in general consists of an onset (consisting of zero or more consonants), followed by a nucleus (a single vowel), followed by a coda (zero or more consonants). Assume a language where coda's consist of at most one consonant. Furthermore, if a single consonant occurs between two vowels, it is part of the second syllable.
abba
-->
ab-ba
aba
-->
a-ba
baab
-->
ba-ab
  1. Give a regular expression which inserts a hyphen after each syllable. One approach is to define a transducer which inserts hyphens optionally first, and to compose this transducer with a recognizer which filters illegal hyphenation patterns.
  2. Ensure that no hyphen is inserted after the last syllable. One approach is to add an end-of-word marker (say #) to each word and to specify a filter which refers to this marker.