Question: START - > sym START START - > sym START - > sibilant IH _ Z START - > voiced _ nonsibilant Z START -
START sym START
START sym
START sibilant IHZ
START voicednonsibilant Z
START voicelessnonsibilant S
S sibilant IHZ
S voicednonsibilant Z
S voicelessnonsibilant S
IHZ S
Z S
SS
sibilant CH
sibilant JH
sibilant S
voicednonsibilant AA
voicednonsibilant AE
voicednonsibilant B
voicednonsibilant D
voicelessnonsibilant 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 'terminal
preterminal 'terminal
It turns out there is a convenient way to write these rules:
preterminal 'terminal 'terminal
For example, we can define all our sibilants like this:
sibilant CHJHSSHZZH
When parsing a string like
D IH SH S
the symbols S will form a phrase under the nonterminal IHZ and that's how we would know that the chosen allomorph is IH Z The tree would look like this:
S sym DS sym IHS sibilant SHIHZ 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 part : Voiceless stops are aspirated when they occur immediately before a stressed vowel, and there is no s immediately preceding the voiceless stop.
Write a contextfree grammar that will parse the same input strings from HW part so that each consonant that should be aspirated has the preterminal "aspirated" as its parent. Implement the grammar as a CFG in the format used in HW As a starting point, consider the following grammar:
g cfg
S sym S
S sym
sym AAAEAHAOAWAYBCHDDHEHEREYFGHHIHIYJHKLMNNGOWOYPRSSHTTHUHUWVWYZZHAAAEAHAOAWAYEHEREYIHIYOWOYUHUW
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 preterminal 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" nonterminal. If a consonant should be aspirated, the string may have multiple trees, as long as the aspirated consonant has the preterminal "aspirated" in at least one.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
