|
|
Definition 7.1 (Finite State Machine)
start state, and
∈ S
The tuple (S, I, E, F, T, A) is called a FSM.
FSM can be used to recognize patterns.
For example:
A graphical representation:
= 0
The FSM detects also ``grumbleplan 9''!
Next iteration:
= -1
PostS plan9_2
The FSM doesn't detect ``‡‡plan 9‡. ‡ ∈ wordSeperator.
Next iteration:
= -1
The FSM detects ``‡plxplan 9‡. ‡ ∈ wordSeperator. Next iteration:
= -1
The FSM detects only ``‡plan 9‡. ‡ ∈ wordSeperator.
The definition ot the FSM:
Define a FSM which recognizes sequences of letters that have subsequences
aeiou.
For example:
-- adventitious -- facetious -- sacrilegious
A graphical representation:
The definition:
Find the words
-- Kenya -- Kansas -- Kauder -- Kunta Kintein an input stream.
Find the words with
-- the first letter must be an 'p' -- the second letter must be an 'r' -- the third letter can be an 'o' or 'e' -- the rest ot the word is 'klap'
in an input stream.
Find the words with the substring
-- Yps and -- Ilon
in an input stream.
|
|
Last modified 22/May/97