Documente Academic
Documente Profesional
Documente Cultură
AT
NNS
VBD
NP
the
children
ate
AT
NN
the
cake
NLE
NLE
Derivations
E.g., the string a flight can be derived from the grammar above and symbol NP by the (leftmost first) derivation
Derivations can be visualized as PARSE TREES The LANGUAGE defined by a CFG is the set of strings derivable from the start symbol S (for Sentence)
NLE
NLE
NLE
NLE
The language LG GENERATED by a CFG grammar G is the set of strings of TERMINAL symbols that can be derived from the start symbol S using the production rules in G
LG = {w | w is in * and S derives w}
The strings in LG are called GRAMMATICAL The strings not in LG are called UNGRAMMATICAL
NLE
Grammar development
One of the most basic skills in NLE is the ability to write a CFG for some fragment of a language (e.g., the dates) Well briefly cover some of the issues to be addressed when writing small CFG grammars
10
NLE
An example lexicon
11
NLE
An example grammar
12
NLE
13
NLE
14
NLE
15
NLE
Card: Cardinal numbers (one stop) Ord: Ordinal numbers (the first flight) Quantifiers: most flights to Denver leave in the morning AP (Adjectives): three very expensive seats
16
NLE
Nominal Noun Nominal Nominal PP (PP) (PP) Nominal Nominal GerundVP Nominal Nominal RelClause
17
NLE
18
NLE
Recursion
Other examples:
Recursion a powerful device, but could have bad consequences (see lectures on parsing)
19
NLE
20
NLE
Coordination
NP NP and NP
VP VP and VP
S S and / but / S
21
NLE
Agreement
This dog Those dogs *This dogs *Those dogs This dog is smart *This dog are smart *Those dogs is smart
NLE
22
For many applications, finite state languages (the languages defined by FA) are appropriate Limitation of FAs: cannot count
Which film did Kim say the director who we just met _ recommended _?
NLE
24
A BB
CAC BB Every language that can be specified by a finite algorithm
25
NLE
Readings
26
NLE