Conditional Ordering |
  |
Suppose that the only things x can be many things, and in most cases we do nothing, bu with lists, we do something special. Here is a bad program that deals with this situation: if isinstance(x,str) or\ isinstance(x,dict) or\ isinstance(x,float) or\ isinstance(x,int) or \ isinstance(x,tuple): y = None elif isinstance(x,list): y = x[0]Long, hard-to-read, and prone to bugs. I forgot the type "long" (Python's long integer type) so this will erroneously do: y=x[0]for long integers, raising an exception and terminating execution. A better program: if isinstance(x,list): y = x[0] else: y = NoneThe else clause here is called an elsewhere condition. In general programs are most elegant if they treat the most general case further down the list of cases: if isinstance(x,float): y=x/5.0 elif isinstance else: y = x/5The second clause actually covers two cases, "int" (integer) and "long"(long integer). An if-then-else clause works because |
||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Nasal assimilation |
  |
Consider the English prefix in/im as in:
Along the same lines, and resembling the "kamman" poroblem, here is a simple example with fake data.
We call "kan" the stem and "tat/sen/gus/pat" suffixes. Notice that in one case the "stem" changes shape. This is called "nasal assimilation", nasal because it is happening with a nasal sound ("m", "n" and "ng") in English). Assimilation because the nasal is "assimilating" to the following sound. Assimilating means "becoming more alike like". An "m" is more like a "p" than an "n" because "m" and "p" have the same place of articulation (labial=lips). A simple description of what is going on:
But it turns out in our fictional language there are many stems that show this change. They end in "n" most places, but they end in "m" before suffixes that start with "p". A slightly more sophisticated description. We will say "kan" ends not with "n" but with "N", a new sound. The pronunciation of "N" is determine by rule.
We will write this as two rules in special notation. (a) N --> m \ ___p (b) N --> nRule (a) means N turns into ("is realized as") "m" in the context immediately preceding "p". The "____" stands for where the "N" goes, immediately before the "p". Note the (b) rule has no defining context, just like an "else" clause in a program. It means N turns into "n" everywhere (else). So this rule means the same as the following programming language statement: if N immediately precedes p: N --> m else: N --> n Note that in our notation, the ORDER is significant. If the rules were written in the reverse order, it would mean something else: (a) N --> n (b) N --> m \ ___pmeans "N" becomes "n" everywhere. So rule (b) now no longer has any effect |
||||||||||||||||||||||||||||||||||||||||||||||||
Rule Ordering Feeding |
  |
Consider the following rules: (1) Vowel Raising e --> i \ ___C_0 i (2) Palatalization t --> c \ ___i
|
||||||||||||||||||||||||||||||||||||||||||||||||
English Flap Rule |
  |
Let's look at the words writer and rider in Canadian English. Examples:
r ^i dx er Next
r ai dx er The difference between the two words is in the vowel:
r ^i dx er There are two things going on. First a process called flapping:
listen: l ih s dx ax n Next: There is a general process of vowel raising before voiceless consonants in Canadian English:
The crucial thing for present purposes: On one very simple account, flapping and vowel raising need to be ordered. Vowel raising needs to happen BEFORE flapping. When vowel raising applies rider still has a voiced sound in it and the vowel does not raise. Afterward, flapping takes away the voicing, but it's too late for raising to occur. Notice if the rules apply freely or if they apply in the opposite order this rather simple account goes away. This is one of the most famous, if not the most famous, arguments for rule ordering. |
||||||||||||||||||||||||||||||||||||||||||||||||
Allomorphy |
|
|||||||||||||||||||||||||||||||||||||||||||||||||
Allophony |
|
Scanning Direction |
One scanning strategy: Scan right to left looking for rule environments. At each segment, try to apply all the rules IN ORDER. Another: scan left to right. |
---|---|
Abstract example |
Apply to:
Three outcomes:
Bad news: Phonologists have advocated all 3 strategies. Soln: Each rule marked for its application strategy. |
Scanning Direction Example II |
Example: Invent a rule that uses right contexts created by another rule: c - > e ___ cOur palatalization rule creates c's.
c t i Target RC -- > (Palatalization Rule) c c i -- > (C Deletion Rule) c i Notice that if the rules applied left to right C-deletion couldnt apply. |
Turkish Vowel Harmony |
Plural: lAr; sometimes realized as "lar", sometimes as "ler" depending on PREceding vowel. Possessive: Im:; sometimes realized as "am", sometimes as "im" depending on PREceding vowel. Only left-to-right works:
apartman + lAR + IM = apartmanlarim adres + Im + A = adresime |