computational linguistics ii parsing
play

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


  1. 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

  2. The Big Picture hierarchy grammar machine other 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

  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 x 1 Ax 2 → x 1 yx 2 , with x 1 , x 2 ∈ Σ ∗ , 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

  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 = w 1 lw 2 and v = w 1 rw 2 , where w 1 , w 2 ∈ Σ ∗ then u ⇒ 1 G v . We say that u directly derives v in grammar G . G for the reflexive transitive closure of ⇒ 1 We write ⇒ ∗ G and omit the subscript G if the grammar is clear from the context. Computational Linguistics II: Parsing – p.4

  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 G x } . L ( G ) = { x ∈ T ∗ | S ⇒ ∗ Computational Linguistics II: Parsing – p.5

  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

  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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend