1 / 39

Klanken 2

Klanken 2. Dit college. Fonologie met eindige automaten en transducers. Colleges en hoofdstukken. 28 april: Klanken 1 (fonetiek, fonologie) Chapters 2 en 7 3 mei: Klanken 2 ( eindige automaten en transducers ) Chapters 2, 3 en 11 10 mei: Woorden (morfologie) Chapter 3.

nitara
Download Presentation

Klanken 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Klanken 2

  2. Dit college • Fonologie met eindige automaten en transducers

  3. Colleges en hoofdstukken • 28 april: Klanken 1 (fonetiek, fonologie) Chapters 2 en 7 • 3 mei: Klanken 2 (eindige automaten en transducers) Chapters 2, 3 en 11 • 10 mei: Woorden (morfologie) Chapter 3

  4. Automaten: Talen • We kunnen de mogelijke syllaben en woorden in een taal opvatten als een verzameling rijtjes over een alfabet van fonemen (d.w.z. als een formele taal) • Een simpel voorbeeld: Alfabet = { p, k, a, i }, Taal = { pa, ka, pi, ki, papa, papi, pipa, pipi, …, paki, …, kipa, …, kikipa, …, pakipapa, … }

  5. Formele Talen

  6. Eindige Automaten • Een taal kan worden gekaraktiseerd door een eindige automaat(finite automaton/state machine) • Een automaat herkent een taal door stap voor stap de tekens van een inputrijtje op een tape te lezen en een aantal toestanden te doorlopen. • Geslaagde herkenning: einde tape en tevens in een accepterende eindtoestand.

  7. Example of a finite automaton There are statesoff and on, the automaton starts in off and tries to reach the “accept state”on What sequences of f’s lead to the accept state? Answer: {f, fff, fffff, …} = {fn: nis odd} This is a finite automaton over alphabet {f} f on off f

  8. Deterministic finite automatadeterministische eindige automaten A deterministic finite state automaton (DFA) is a 5-tuple (Q, S, d, q0, F) where Q is a finite set of states S is an alphabet d: Q×S → Q is a transition function q0ÎQ is the initial state F ÍQ is a set of accepting states (or final states). In diagrams, the accepting states will be denoted by double loops

  9. Example 0 1 0,1 1 0 q0 q1 q2 table of transition function d: alphabet S= {0, 1} statesQ = {q0, q1, q2} initial stateq0 accepting statesF = {q0, q1} inputs 0 1 q0 q0 q1 q1 q2 q1 states q2 q2 q2

  10. Language of a DFA Language of M is {f, fff, fffff, …} = {fn: nis odd} The language of a DFA (Q, S, d, q0, F) is the set of all strings over S that, starting from q0 and following the transitions as the string is read leftto right, will reach some accepting state. f on M: off f

  11. Meer Voorbeelden S= {0, 1} S= {a, b} q0 b a 0 1 q1 q3 b a 1 q0 q1 b a a b 0 q2 q4 b a 0 1 0, 1 0 1 q2 q0 q1 Wat zijn de talen van deze automaten?

  12. Reguliere expressies • We hebben hier te maken met een reguliere taal – een taal beschreven door een FSA. • Een reguliere taal kan ook beschreven worden door een reguliere expressie:([pk][ai])+

  13. Operaties over talen • Let L, L1, L2 be subsets ofΣ* • Concatenation: L1L2 = {xy | x is in L1 and y is in L2} • Concatenating a language with itself: L0 = {ε} Li = LLi-1, for all i >= 1 • Kleene Closure: L* = Li = L0 U L1 U L2 U… • Positive Closure: L+ = Li = L1 U L2 U…

  14. Kleene-sluiting Say, L1 ={a, abc, ba}, on Σ ={a,b,c} Then, L2 = {aa, aabc, aba, abca, abcabc, abcba, baa, baabc, baba} L3= {a, abc, ba}. L2 L* = {ε} U L1U L2U L3U . .

  15. Definitie van een Reguliere Expressie • Let Σ be an alphabet. The regular expressions over Σ are: • Ø Represents the empty set { } • ε Represents the set {ε} • a Represents the set {a}, for any symbol a in Σ Let r and s be regular expressions that represent the sets R and S, respectively. • r|s Represents the set R U S (precedence 3) • rs Represents the set RS (precedence 2) • r* Represents the set R* (highest precedence) • (r) Represents the set R (not an op, provides precedence) • If r is a regular expression, then L(r) is used to denote the corresponding language.

  16. Examples: Let Σ = {0, 1} (0|1)* All strings of 0’s and 1’s 0(0|1)* All strings of 0’s and 1’s, beginning with a 0 (0|1)*1 All strings of 0’s and 1’s, ending with a 1 (0|1)*0(0|1)* All strings of 0’s and 1’s containing at least one 0 (0|1)*0(0|1)*0(0|1)* All strings of 0’s and 1’s containing at least two 0’s (0|1)*01*01* All strings of 0’s and 1’s containing at least two 0’s (1|01*0)* All strings of 0’s and 1’s containing an even number of 0’s 1*(01*01*)* All strings of 0’s and 1’s containing an even number of 0’s (1*01*0)*1* All strings of 0’s and 1’s containing an even number of 0’s

  17. ‘Flapping’ in Amerikaans Engels foneem /t/ flapping regel na een beklemtoonde klinker ( ) en voor een onbeklemtoonde klinker (V), is [dx] de allofoon voor de foneem /t/ 

  18. Transducers (informeel)

  19. Transducers (formeel) deterministische eindige automaten (DFA)  (1) niet-deterministische eindige automaten (NFA)  (2) eindige toestands transducer (finite state transducers FST)

  20. Van DFA naar NFA Construct a DFA over alphabet {0, 1} that accepts those strings that end in 101 Sketch of answer: 0 0 q000 1 0 q00 1 q001 q0 1 … 0 q01 … qe 1 q101 q10 0 … 1 q1 … 1 q11 1 q111 1

  21. Would be easier if… Suppose we could guess when the string we are reading has only 3 symbols left Then we could simply look for the sequence 101and accept if we see it 1 0 1 3 symbols left qdie This is not a DFA!

  22. Nondeterminism Nondeterminism is the ability to make guesses, which we can later verify Informal nondeterministic algorithm for strings that end in 101: • Guess if you are approaching end of input • If guess is yes, look for 101 and accept if you see it • If guess is no, read one more symbol and go to step 1

  23. Nondeterministic finite automaton This is a kind of automaton that allows you to make guesses Each state can have zero, one, or more transitions out labeled by the same symbol 0, 1 1 0 1 q0 q1 q2 q3

  24. (1) Van DFA naar NFA A deterministic finite state automaton (DFA) is a 5-tuple (Q, S, d, q0, F) where Q is a finite set of states S is an alphabet d: Q×S → Q is a transition function q0ÎQ is the initial state F ÍQ is a set of accepting states (or final states).

  25. (1) Van DFA naar NFA A nondeterministic finite state automaton (NFA) is a 5-tuple (Q, S, d, q0, F) where Q is a finite set of states S is an alphabet d: Q×S×Qis a transition relation q0ÎQ is the initial state F ÍQ is a set of accepting states (or final states).

  26. 0, 1 1 0 1 q0 q1 q2 q3

  27. 0, 1 1 0 1 q0 q1 q2 q3 (q0 , 0, q0) (q0 , 1, q0) (q0 , 1, q1) (q1 , 0, q2) (q2 , 1, q3)

  28. (2) Van NFA naar FST 0, 1 1 0 1 q0 q1 q2 q3

  29. (2) Van NFA naar FST 0:a, 1:b 1:y 0:x 1:y q0 q1 q2 q3

  30. (2) Van NFA naar FST 0:a, 1:b 1:y 0:x 1:y q0 q1 q2 q3 011110101 => abbbbayxy 000101000 niet geaccepteerd

  31. (2) Van NFA naar FST A finite state transducer (FST) is a 6-tuple (Q, S, Δ, d, q0, F) where Q is a finite set of states S is an inputalphabet Δ is an output alphabet d: Q×S×Δ ×Qis a non-deterministic transition relation q0ÎQ is the initial state F ÍQ is a set of accepting states (or final states).

  32. Voorbeeld – Meervoud in het Engels [ix z] na de “sibilant” fonen [s], [sh], [z], [zh], [ch] of [jh] - peaches [z] na “voiced” klanken - pigs [s] na “voiceless” klanken - cats faxes in lexicon: f aa k ^ z

  33. Automaten: Voorbeeld p|k|a|i 2 Eindig aantal toestanden a|i p|k Begintoestand en eindtoestand p|k 1 0 a|i Toestandsovergangen bij het lezen van bepaalde symbolen

  34. Automaten: Voorbeeld p|k|a|i 3 a|i p|k 1 2 0 p|k a|i 0 Met een ‘jump’

  35. basi (bus) bwana (mijnheer) duka (winkel) jenga (bouwen) kwanza (eerst) mama (moeder) mbuzi (geit) mvua (regen) ndizi (banaan) ngoma (trommel) ngwena (krokodil) njia (weg) ona (zien) pangwa (gepland) pwani (strand) saa (horloge) simba (leeuw) wingu (wolk) unga (meel) asante (bedankt) desemba (december) kamera (fototoestel) matata (problemen) safari (reis) kampuni (onderneming) mandazi (doughnut) kidogo (klein) ofisi (kantoor) mbalimbali (allerlei) kawaida (gewoonte) kitunguu (ui) maharagwe (bonen) endelea (doorgaan) tofauti (verschil) Ufaransa (Frankrijk) madaraka (verantwoordelijkheid) barabara (weg) kilimanjaro milionea (millionaire) arobaini (veertig)

  36. Swahili lettergrepen • Taalkundige analyse syllabestructuur: NCwV opeenvolging van 1 of meer syllaben • Reguliere expressie in Wingrep ^([mn]?[zsjhrlfvptkbdg]?w?[aeiou])+$ • http://www.wingrep.com/

More Related