Download presentation
Presentation is loading. Please wait.
Published byAnnabel Gilmore Modified over 9 years ago
1
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds of FSAs –Deterministic (DFSAs) –Non-deterministic (NFSAs) Any NFSA can be converted into a corresponding DFSA. A FSA (a regular expression) represents a regular language. Regular Expressions Finite Automata Regular Languages
2
BİL711 Natural Language Processing2 A DFSA and A NFSA 01 2 a b b ba 01 a,b A DFSA : a | b + A NFSA: a*(a|b)b*
3
BİL711 Natural Language Processing3 Formal Definition of Finite-State Automata FSA is Q x x q 0 x F x Q: a finite set of N states q 0, q 1, … q N : a finite input alphabet of symbols q 0 : the start state F: the set of final states -- F is a subset of Q (q,i): transition function –DFSA : There is exactly one arc leaving a state q with a symbol a. There is no arc with the empty string. –NFSA : There can be more than one arc leaving a state q with a symbol a. There can be arcs with empty string.
4
BİL711 Natural Language Processing4 Transition Tables for FSAs ab 123 2** 3*3 ab€ 11,22* 2*2* A DFSA A NFSA We can use transition tables to show FSAs.
5
BİL711 Natural Language Processing5 Implementation of FSAs To implement DFSA is simpler. To implement NFSAs, we need a search algorithm. –Depth-first – be careful about infinite loops –Breadth-first 12 a,b ab Tape: aaab Search Space 1,aaab 2,aab 1,aab 2,ab 1,ab 2,b 1,b 2,- 2,- fail success
6
BİL711 Natural Language Processing6 Regular Languages Operations on regular languages and FSAs: –concatenation, closure, union Properties of regular languages –closed under concatenation, union, disjunction, intersection, difference, complementation, reversal, closure. Equivalent to finite-state automata.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.