Lesson 14 Intro to Grammars - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Lesson 14 Intro to Grammars

Description:

The ABNF format is similar to the format for grammars used by compiler writers. ... chartreuse {$='green'} item chartreuse tag $='green' /tag /item use of tag ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 11
Provided by: jala4
Category:

less

Transcript and Presenter's Notes

Title: Lesson 14 Intro to Grammars


1
Lesson 14Intro to Grammars
2
Two W3C standard SRGS formats
  • The XML format is an XML language.
  • The ABNF format is similar to the format for
    grammars used by compiler writers.

3
Why use grammars
  • Recognize words relevant to the application 
  • Increase response time and recognition accuracy
  • Recognize when a user fails to answer the prompt

4
  • ltgrammar type "application/grammarxml" root
    "single_digit" version "1.0" xmllang
    "en"gt     ltrule id "single_digit"gt  
          ltone-ofgt             ltitemgt zero
    lt/itemgt             ltitemgt one lt/itemgt  
              ltitemgt two lt/itemgt             ltitemgt
    three lt/itemgt             ltitemgt four lt/itemgt  
              ltitemgt five lt/itemgt             ltitemgt
    six lt/itemgt             ltitemgt seven lt/itemgt  
              ltitemgt eight lt/itemgt            
    ltitemgt nine lt/itemgt         lt/one-ofgt    lt/rulegt
    lt/grammargt

5
Types of grammars
6
ltrulerefgt and ltitemgt
  • ltgrammar type "application/grammarxml"
    root "zero_to_ten"
  • mode "voice" version
    "1.0" xmllang "en"gt      ltrule id
    "zero_to_ten"gt          ltone-ofgt              
    ltruleref uri "single_digit"/gt              
    ltitemgt ten lt/itemgt          lt/one-ofgt    
    lt/rulegt     ltrule id "single_digit"gt       
      ltone-ofgt               ltitemgt zero
    lt/itemgt               ltitemgt one lt/itemgt      
            ltitemgt two lt/itemgt               ltitemgt
    three lt/itemgt               ltitemgt four
    lt/itemgt               ltitemgt five lt/itemgt      
            ltitemgt six lt/itemgt               ltitemgt
    seven lt/itemgt               ltitemgt eight
    lt/itemgt               ltitemgt nine lt/itemgt     
       lt/one-ofgt     lt/rulegtlt/grammargt

7
Repeat and optional
  • ltrule id "goodness" scope
    "public"gt         I am ltitem repeat "0-3" gt
    very lt/itemgt          hungrylt/rulegt
  • ltrule id "good_or_bad" scope
    "public"gt        ltitem repeat "0-1" gt not
    lt/itemgt goodlt/rulegt

8
garbage
  • ltrule name "James_Lewis"gt    ltitemgt James
    ltruleref special "GARBAGE"/gt Lewis
    lt/itemgtlt/rulegt

9
XML and ABNF
10
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com