Hint
It's not very difficult to change our recognizer to work with FSA
specifications that, like the above:
- define their transitions in terms of categories instead of
symbols and
- use a lexicon to map those
categories to symbols or the other way round.
The only thing that changes is the definition of the traverse
predicate. We don't simply compare the label of the arc with the next
symbol of the input anymore, but have to access the lexicon to check
whether the next symbol of the input is a word of the category
specified by the label of the arc.
Solution
Back to lab 1.