Stream-based Text Processing Flashcards
1
Q
What is DFA ?
A
Deterministic Finite Automaton
Formallydefinedasa5-tuple:(Q,Σ,δ,q0,F) – Qisasetofstates
– Σ is an input alphabet
– δ:Q×Σ→Qisatransitionfunction
– q0 ∈ Q is the start state
– F ⊂ Q is a set of final or accepting states
2
Q
What is NFA ?
A
Non-deterministic Finite Automaton
Formally:(Q,Σ,δ,q0,F)
3
Q
Reguler expression : Literal ?
A
/words/
4
Q
REX: Character class ?
A
/./ (any character)
5
Q
REX: any of the characters ?
A
/[abc]/ (a or b or c)
6
Q
REX: range of characters ?
A
/[0-9]/, /[a-z]/, /[A-Za-z0-9_-]/
7
Q
REX: case sensitive ?
A
/[_-]/
/[A-Z_-]/
8
Q
A
start of line
9
Q
$
A
end of line
10
Q
\s
A
white space
11
Q
\S
A
not white space
12
Q
\d
A
digit
13
Q
\D
A
not digit
14
Q
\w
A
word
15
Q
\W
A
not word