Grammars and Languages - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Grammars and Languages

Description:

Give a definition of a formal language, and give a ... Haptic. Control. Commands root = hard to direction | easy to direction | steady as she goes ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 14
Provided by: jwi6
Category:

less

Transcript and Presenter's Notes

Title: Grammars and Languages


1
Grammars and Languages
  • Objectives
  • Tell the difference between a natural language
    and a formal language
  • Give a definition of a formal language, and give
    a definition for a simple formal language
  • Create a grammar using the Backus-Naur form
  • Describe one use of BNF grammars
  • Outline
  • Natural vs. Formal Languages
  • Grammars
  • BNF form
  • Speech Recognition
  • Chapter 11, Section 1

2
Natural languages
  • English Grammar Set of rules to determine
    whether a combination of words is valid.
  • The dog barks loudly
  • Green runs vinegar squishy
  • Blue red loud dogs ponder slowly

3
Natural Language
  • Snytax the structure of a statement
  • Semantics the meaning of a statement
  • Natural languages syntax much too complicated
  • Formal Language specified by a well-defined set
    of rules of syntax.

4
Formal Language Example
  • Sentence Noun Phrase (NP) followed by a Verb
    Phrase (VP)
  • Noun Phrase an Article followed by Adjective
    followed by a noun.
  • Noun Phrase an Article followed by a noun.
  • Verb Phrase A verb followed by an adverb.
  • Verb Phrase A verb.
  • Article a, the Adjective purple,
    emaciated, jovial
  • Noun grape, brick, goose Verb
    flails, falls, flaps
  • Adverb wildly, sadly

5
Formal language example
  • New Rule
  • Adjective An adjective followed by an adjective.

6
Phrase-Structure Grammars
  • Vocabulary (alphabet) V is a finite set of
    symbols
  • Sentence (word) over V is a string of finite
    length of elements of V
  • Language a subset of all sentences (words) over
    all possible sentences.

7
Backus-Naur Form
  • ltidentifiergt ltlettergt ltidentifiergtltlettergt
  • ltidentifiergtltdigitgt
  • ltlettergt a b c d e ... x y
    z
  • ltdigitgt 0 1 2 3 4 5 6 7
    8 9

8
Backus Naur Form
  • Which of the following are valid Identifiers
  • tmp
  • x
  • ham43
  • 4loop
  • 2
  • the_quick_7_brown_4837_foxes

9
Voice-Based Control
NCSAs Translator Voice Recognition Software
http//woodall.ncsa.uiuc.edu/dbock/Tools/Translato
r/
10
HapticControl
11
Commands
  • ltrootgt hard to ltdirectiongt
  • easy to ltdirectiongt
  • steady as she goes
  • sound the alarm.
  • ltdirectiongt starboard port.

12
Advanced command structure for Control
  • ltrootgt hard to ltdirectiongt
  • easy to ltdirectiongt
  • steady as she goes
  • set throttle to ltlevelgt
  • ltclutch_statusgt the clutch
  • set transmission to ltgeargt
  • set heading to ltbearinggt
  • set position to point ltpoint_namegt
  • honk the horn
  • sound the alarm
  • call for help
  • good job.
  • ltdirectiongt starboard port.
  • ltlevelgt low medium high.
  • ltclutch_statusgt engage disengage.
  • ltgeargt reverse forward low forward high.
  • ltbearinggt north south east west
    northeast northwest southeast southwest.
  • ltpoint_namegt alpha bravo charlie.

13
HCI Example
  • ltrootgt ltgogt ? ltgo_modegt
  • ltstart_stopgt ltpickinggt
  • ltstopgt
  • ltselectgt ltselect_whatgt ?
  • ltshow_getgt information about that
    object.
  • ltgogt go.
  • ltgo_modegt forward backward faster
    slower.
  • ltstart_stopgt start stop.
  • ltpickinggt pick mode picking.
  • ltstopgt stop.
  • ltselectgt select.
  • ltselect_whatgt that one that.
  • ltshow_getgt show get.
Write a Comment
User Comments (0)
About PowerShow.com