Computational Linguistics II: Parsing Summing up CF Languages: - - PowerPoint PPT Presentation

computational linguistics ii parsing
SMART_READER_LITE
LIVE PREVIEW

Computational Linguistics II: Parsing Summing up CF Languages: - - PowerPoint PPT Presentation

Computational Linguistics II: Parsing Summing up CF Languages: Derivations Frank Richter & Jan-Philipp S ohn fr@sfs.uni-tuebingen.de, jp.soehn@uni-tuebingen.de Computational Linguistics II: Parsing p.1 The Big Picture hierarchy


slide-1
SLIDE 1

Computational Linguistics II: Parsing

Summing up CF Languages: Derivations

Frank Richter & Jan-Philipp S¨

  • hn

fr@sfs.uni-tuebingen.de, jp.soehn@uni-tuebingen.de

Computational Linguistics II: Parsing – p.1

slide-2
SLIDE 2

The Big Picture

hierarchy grammar machine

  • ther

type 3

  • reg. grammar

D/NFA

  • reg. expressions
  • det. cf.

LR(k) grammar DPDA type 2 CFG PDA type 1 CSG LBA type 0 unrestricted Turing grammar machine

Computational Linguistics II: Parsing – p.2

slide-3
SLIDE 3

Form of Grammars of Type 0–3

For i ∈ {0, 1, 2, 3}, a grammar N, T, P, S of Type i, with N the set of non-terminal symbols, T the set of terminal symbols (N and T disjoint, Σ = N ∪ T), P the set of productions, and S the start symbol (S ∈ N), obeys the following restrictions: T3: Every production in P is of the form A → aB or A → ǫ, with B, A ∈ N, a ∈ T. T2: Every production in P is of the form A → x, with A ∈ N and x ∈ Σ∗. T1: Every production in P is of the form x1Ax2 → x1yx2, with

x1, x2 ∈ Σ∗, y ∈ Σ+, A ∈ N and the possible exception of C → ǫ in case C does not occur on the righthand side of

a rule in P. T0: No restrictions.

Computational Linguistics II: Parsing – p.3

slide-4
SLIDE 4

Derivation Steps of Grammars

Definition

For every grammar G with G = N, T, P, S and Σ = N ∪ T, for every u, v ∈ Σ∗, if there is a rule l → r ∈ P with u = w1lw2 and v = w1rw2, where w1, w2 ∈ Σ∗ then

u ⇒1

G v.

We say that u directly derives v in grammar G. We write ⇒∗

G for the reflexive transitive closure of ⇒1 G and

  • mit the subscript G if the grammar is clear from the

context.

Computational Linguistics II: Parsing – p.4

slide-5
SLIDE 5

Language Generated by a Grammar

Definition

For every grammar G with G = N, T, P, S the language

L(G) generated by G is L(G) = {x ∈ T ∗|S ⇒∗

G x}.

Computational Linguistics II: Parsing – p.5

slide-6
SLIDE 6

More on Derivations (1)

If at each step in a derivation a production is applied to the leftmost nonterminal, then the derivation is said to be leftmost.

Computational Linguistics II: Parsing – p.6

slide-7
SLIDE 7

More on Derivations (1)

If at each step in a derivation a production is applied to the leftmost nonterminal, then the derivation is said to be leftmost. A derivation in which the rightmost nonterminal is replaced at each step is said to be rightmost.

Computational Linguistics II: Parsing – p.6