SlideShare ist ein Scribd-Unternehmen logo
1 von 20
TYPES OF PARSERS
By,
M. Sabiha
MCA 2nd Year
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.
TYPES OF PARSERS
TYPES OF PARSERS
Link Parser Chart Parser
Simple
Transition
Networks
Recursive
Transition
Networks
Augmented
Transition
Networks
Definite Clause
Grammar
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).
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.
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+
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.
Rules of Chart Parsing
Rules Rule Number Dictionary Words
<S>  <NP><VP> 1 <Det>  a|the|an
<NP>  <Det> <Noun> 2 <Noun>  girl|apple|song
<NP>  <Det> <Adj> <Noun> 3 <Adj>  cute|smart
<NP>  <Adj> <Noun> 4 <Verb>  sings|ate
<VP>  <Verb> 5
<VP>  <Verb> <NP> 6
Example of Chart Parsing
1 The 2 cute 3 girl 4 sings 5 a 6 song 7
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
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
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.
Example of Recursive Transition Network
Alice jumps and Bob runs
Noun Verb S
and
Alice jumps
Bob runs
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.
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))
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.
Rules of DCG
Ordinary Prolog Rule Conditional Prolog Rule
Sentence --> Noun Phrase (NP), Verb Phrase (VP)
NP --> Det, Noun
NP --> Adjective (ADJ), Noun
VP --> Verb, NP
VP --> Verb, Sentence
Example of DCG
The cat scares the mouse
Det --> The
Noun --> cat
Verb --> scares
Det --> the
Noun --> mouse
Types of parsers

Weitere ähnliche Inhalte

Was ist angesagt?

14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
koolkampus
 

Was ist angesagt? (20)

Apriori Algorithm
Apriori AlgorithmApriori Algorithm
Apriori Algorithm
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
 
SRS(software requirement specification)
SRS(software requirement specification)SRS(software requirement specification)
SRS(software requirement specification)
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
Interface specification
Interface specificationInterface specification
Interface specification
 
Introduction to Software Project Management
Introduction to Software Project ManagementIntroduction to Software Project Management
Introduction to Software Project Management
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineering
 
Software Size Estimation
Software Size EstimationSoftware Size Estimation
Software Size Estimation
 
NLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit DistanceNLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit Distance
 
5. phases of nlp
5. phases of nlp5. phases of nlp
5. phases of nlp
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Design notation
Design notationDesign notation
Design notation
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
 

Ähnlich wie Types of parsers

Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
DhruvKushwaha12
 
Understanding Natural Languange with Corpora-based Generation of Dependency G...
Understanding Natural Languange with Corpora-based Generation of Dependency G...Understanding Natural Languange with Corpora-based Generation of Dependency G...
Understanding Natural Languange with Corpora-based Generation of Dependency G...
Edmond Lepedus
 
Chinese Word Segmentation in MSR-NLP
Chinese Word Segmentation in MSR-NLPChinese Word Segmentation in MSR-NLP
Chinese Word Segmentation in MSR-NLP
Andi Wu
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
Abdullah al Mamun
 

Ähnlich wie Types of parsers (20)

Natural Language Processing Course in AI
Natural Language Processing Course in AINatural Language Processing Course in AI
Natural Language Processing Course in AI
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
 
Phrase Structure Grammar
Phrase Structure GrammarPhrase Structure Grammar
Phrase Structure Grammar
 
https://www.slideshare.net/amaresimachew/hot-topics-132093738
https://www.slideshare.net/amaresimachew/hot-topics-132093738https://www.slideshare.net/amaresimachew/hot-topics-132093738
https://www.slideshare.net/amaresimachew/hot-topics-132093738
 
Usage of regular expressions in nlp
Usage of regular expressions in nlpUsage of regular expressions in nlp
Usage of regular expressions in nlp
 
Usage of regular expressions in nlp
Usage of regular expressions in nlpUsage of regular expressions in nlp
Usage of regular expressions in nlp
 
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
 
CS-4337_03_Chapter3- syntax and semantics.pdf
CS-4337_03_Chapter3- syntax and semantics.pdfCS-4337_03_Chapter3- syntax and semantics.pdf
CS-4337_03_Chapter3- syntax and semantics.pdf
 
sabesta3.ppt
sabesta3.pptsabesta3.ppt
sabesta3.ppt
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Natural Language Processing basics presentation
Natural Language Processing basics presentationNatural Language Processing basics presentation
Natural Language Processing basics presentation
 
Junki Matsuo - 2015 - Source Phrase Segmentation and Translation for Japanese...
Junki Matsuo - 2015 - Source Phrase Segmentation and Translation for Japanese...Junki Matsuo - 2015 - Source Phrase Segmentation and Translation for Japanese...
Junki Matsuo - 2015 - Source Phrase Segmentation and Translation for Japanese...
 
2021-0509_JAECS2021_Spring
2021-0509_JAECS2021_Spring2021-0509_JAECS2021_Spring
2021-0509_JAECS2021_Spring
 
Collin F. Baker - 2017 - Graph Methods for Multilingual FrameNets
Collin F. Baker - 2017 - Graph Methods for Multilingual FrameNetsCollin F. Baker - 2017 - Graph Methods for Multilingual FrameNets
Collin F. Baker - 2017 - Graph Methods for Multilingual FrameNets
 
Understanding Natural Languange with Corpora-based Generation of Dependency G...
Understanding Natural Languange with Corpora-based Generation of Dependency G...Understanding Natural Languange with Corpora-based Generation of Dependency G...
Understanding Natural Languange with Corpora-based Generation of Dependency G...
 
haenelt.ppt
haenelt.ppthaenelt.ppt
haenelt.ppt
 
Topic Segmentation in Dialogue
Topic Segmentation in DialogueTopic Segmentation in Dialogue
Topic Segmentation in Dialogue
 
Chinese Word Segmentation in MSR-NLP
Chinese Word Segmentation in MSR-NLPChinese Word Segmentation in MSR-NLP
Chinese Word Segmentation in MSR-NLP
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 

Mehr von Sabiha M

Mehr von Sabiha M (13)

Cybersecurity
CybersecurityCybersecurity
Cybersecurity
 
Top-Down Estimation Approach
Top-Down Estimation ApproachTop-Down Estimation Approach
Top-Down Estimation Approach
 
Kernel Computing
Kernel ComputingKernel Computing
Kernel Computing
 
Goal-Setting Theory of Motivation
Goal-Setting Theory of MotivationGoal-Setting Theory of Motivation
Goal-Setting Theory of Motivation
 
Decomposition
DecompositionDecomposition
Decomposition
 
Advanced SQL
Advanced SQLAdvanced SQL
Advanced SQL
 
Job Sequencing with Deadlines
Job Sequencing with DeadlinesJob Sequencing with Deadlines
Job Sequencing with Deadlines
 
LAN, WAN, MAN
LAN, WAN, MANLAN, WAN, MAN
LAN, WAN, MAN
 
Next Generation Internet
Next Generation InternetNext Generation Internet
Next Generation Internet
 
Near Field Communication
Near Field CommunicationNear Field Communication
Near Field Communication
 
Green Cloud Computing
Green Cloud ComputingGreen Cloud Computing
Green Cloud Computing
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Apache web server
Apache web serverApache web server
Apache web server
 

Kürzlich hochgeladen

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
cupulin
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 

Kürzlich hochgeladen (20)

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Pharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfPharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 

Types of parsers

  • 1. TYPES OF PARSERS By, M. Sabiha MCA 2nd Year
  • 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.
  • 9. Rules of Chart Parsing Rules Rule Number Dictionary Words <S>  <NP><VP> 1 <Det>  a|the|an <NP>  <Det> <Noun> 2 <Noun>  girl|apple|song <NP>  <Det> <Adj> <Noun> 3 <Adj>  cute|smart <NP>  <Adj> <Noun> 4 <Verb>  sings|ate <VP>  <Verb> 5 <VP>  <Verb> <NP> 6
  • 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.
  • 18. Rules of DCG Ordinary Prolog Rule Conditional Prolog Rule Sentence --> Noun Phrase (NP), Verb Phrase (VP) NP --> Det, Noun NP --> Adjective (ADJ), Noun VP --> Verb, NP VP --> Verb, Sentence
  • 19. Example of DCG The cat scares the mouse Det --> The Noun --> cat Verb --> scares Det --> the Noun --> mouse