2. What is meant by Parsing?
Parsing is the process of analyzing a string
of symbols, either in natural language,
computer languages or data structures,
conforming to the rules of a formal
grammar.
4. TYPES OF PARSERS
Link Parser Chart Parser
Simple
Transition
Networks
Recursive
Transition
Networks
Augmented
Transition
Networks
Definite Clause
Grammar
5. 1. LINK PARSER
• Proposed by Davy Temperley and Daniel Sleator in
the year 1993.
• Builds relations between pairs of words.
• Uses SVO (Subj Verb Obj) language.
• Rightward links are represented with +
• Leftward links are represented with –
• Optional links are contained in curly brackets {…}
• Undesirable links are contained in any no. of square
brackets […]
• Multiple links are joined either by conjunction (&) or
disjunction (or).
6. Link Grammar Rules for SVO Language
Link Grammar Rules Interpretation of Rules
<Determiner>: Det+; Det connected to word to its right in a sentence
<Noun_Sub>: {Det-} & Sub+; Sub connected to word on its right and Det on
left (optional)
<Noun_Obj>: {Det-} & Obj-; Obj is a last word in a sentence and connected to
Det on left (optional)
<Verb> : Sub- & {Obj+}; Verb connected to Obj on right (optional) and
connected to Sub on left.
7. Example of Link Parser
The girl sings a song
Here, The:d, girl:n, sings:v, a:d and song:n
Then, Link Grammar representation is
The(d) girl(n) sings(v) a(d) song(n)
| | | |
Det- + +Sub- + + Det- + Sub+
8. 2. CHART PARSER
• Chart parsing is generally credited
to Martin Kay.
• Chart is a data structure which is
maintained to keep a record of the
positions of the words and new structure
derived from the sentence.
• Keeps the record of rules which are
recorded as the active arcs on the chart.
10. Example of Chart Parsing
1 The 2 cute 3 girl 4 sings 5 a 6 song 7
11. 3. SIMPLE TRANSITION NETWORK
• Convenient for visualizing grammar.
• Consists of nodes and labeled arcs.
• The final arc is called as Pop.
d np1 vp d np2 pop
n1 n2 n3 n4 n5 n6
12. Example of Simple Transition Network
A girl is standing at the bus-stop
d
np
1
t vp pp d
np
2
A girl is standing at the bus-stop
Pop
13. 4. RECURSIVE TRANSITION NETWORK
• Similar to Simple Transition Network.
• Allows arc labels that refer to other
networks rather than word categories.
• The structural elements of a well-formed
sentence may also be well-formed
sentences by themselves.
14. Example of Recursive Transition Network
Alice jumps and Bob runs
Noun Verb S
and
Alice jumps
Bob runs
15. 5. AUGMENTED TRANSITION
NETWORK
• Extension of Recursive Transition
Network.
• Produces the data structure suitable for
further processing.
• Capable of storing semantic details.
• Internally performs tests and takes actions
during arc transitions.
16. Example of Augmented Transition Network
John will hit the door
(S SUBJ (NP NAME John)
MAIN VERB will
ADV hit
TENSE FUTURE
OBJ (NP DET the
HEAD door))
17. 6. DEFINITE CLAUSE GRAMMAR
• Developed by Fernando Pereira and David
Warren in the year 1980.
• Extension of Context Free Grammar (CFG).
• One of the important applications of Prolog.
• Used to express any natural language grammar in
limited sense.
• Rules are separated by an arrow symbol - - >
• Left side of the rule contains a part of ordinary
Prolog rules.
• Right side of the rule contains a condition or
body of Prolog.