Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

START - > sym START START - > sym START - > sibilant IH _ Z START - > voiced _ nonsibilant Z START -

START -> sym START
START -> sym
START -> sibilant IH_Z
START -> voiced_nonsibilant Z
START -> voiceless_nonsibilant S
S -> sibilant IH_Z
S -> voiced_nonsibilant Z
S -> voiceless_nonsibilant S1
IH_Z ->'+''S'
Z ->'+''S'
S1->'+''S'
sibilant ->'CH'
sibilant ->'JH'
sibilant ->'S'
...
voiced_nonsibilant ->'AA'
voiced_nonsibilant ->'AE'
...
voiced_nonsibilant ->'B'
voiced_nonsibilant ->'D'
...
voiceless_nonsibilant ->'P'
...
sym ->'AA'
...
sym ->'Z'
If we wanted to implement this grammar using our python format, we would have a lot of rules with the form
preterminal -> 'terminal1'
preterminal -> 'terminal2'
It turns out there is a convenient way to write these rules:
preterminal -> 'terminal1'| 'terminal2'
For example, we can define all our sibilants like this:
sibilant ->'CH'|'JH'|'S'|'SH'|'Z'|'ZH'
When parsing a string like
D IH SH + S
the symbols "+ S" will form a phrase under the non-terminal IH_Z, and that's how we would know that the chosen allomorph is IH Z. The tree would look like this:
(S (sym D)(S (sym IH)(S (sibilant SH)(IH_Z + S))))
First, try to understand the example above (you don't need to implement it), then attempt to write the grammar to solve the problem below.
Aspiration Revisited
Consider the aspiration rule from HW 2 part 2: Voiceless stops are aspirated when they occur immediately before a stressed vowel, and there is no [s] immediately preceding the voiceless stop.
Write a context-free grammar that will parse the same input strings from HW 2 part 2, so that each consonant that should be aspirated has the pre-terminal "aspirated" as its parent. Implement the grammar as a CFG in the format used in HW 4. As a starting point, consider the following grammar:
g = cfg("""
S -> sym S
S -> sym
sym ->'AA'|'AE'|'AH'|'AO'|'AW'|'AY'|'B'|'CH'|'D'|'DH'|'EH'|'ER'|'EY'|'F'|'G'|'HH'|'IH'|'IY'|'JH'|'K'|'L'|'M'|'N'|'NG'|'OW'|'OY'|'P'|'R'|'S'|'SH'|'T'|'TH'|'UH'|'UW'|'V'|'W'|'Y'|'Z'|'ZH'|'AA1'|'AE1'|'AH1'|'AO1'|'AW1'|'AY1'|'EH1'|'ER1'|'EY1'|'IH1'|'IY1'|'OW1'|'OY1'|'UH1'|'UW1'
""")
In the last line of the grammar, we used a shorthand notation to create lexical rules for all the symbols we will need. In this grammar, every symbol has the pre-terminal symbol sym. Modify it to model aspiration according to the description above, and enter your resulting grammar in your submission.
If it helps, strings may be ambiguous according to your grammar. However, only aspirated consonants should ever have the "aspirated" non-terminal. If a consonant should be aspirated, the string may have multiple trees, as long as the aspirated consonant has the pre-terminal "aspirated" in at least one.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions