def apply_T6(word): '''If a VVV-sequence contains a long vowel, there is a syllable boundary between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an], [mää.yt.te].''' WORD = word offset = 0 for vvv in vvv_sequences(WORD): seq = vvv.group(2) j = 2 if is_long(seq[:2]) else 1 if is_long(seq[1:]) else 0 if j: i = vvv.start(2) + j + offset WORD = WORD[:i] + '.' + WORD[i:] offset += 1 RULE = ' T6' if word != WORD else '' return WORD, RULE
def apply_T2(word): '''There is a syllable boundary within a VV sequence of two nonidentical vowels that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa].''' WORD = word offset = 0 for vv in vv_sequences(WORD): seq = vv.group(2) if not is_diphthong(seq) and not is_long(seq): i = vv.start(2) + 1 + offset WORD = WORD[:i] + '.' + WORD[i:] offset += 1 RULE = ' T2' if word != WORD else '' return WORD, RULE
def apply_T4(word): '''An agglutination diphthong that ends in /u, y/ contains a syllable boundary when the sequence would appear in an unstressed syllable, e.g., [lau.ka.us], [va.ka.ut.taa].''' WORD = word.split('.') for i, v in enumerate(WORD): # i % 2 != 0 prevents this rule from applying to first, third, etc. # syllables, which receive stress (WSP) if i % 2 != 0: vv = u_y_final_diphthongs(v) if vv and not is_long(vv.group(1)): I = vv.start(1) + 1 WORD[i] = v[:I] + '.' + v[I:] WORD = '.'.join(WORD) RULE = ' T4' if word != WORD else '' return WORD, RULE
def apply_T4(word): '''An agglutination diphthong that ends in /u, y/ usually contains a syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us], [va.ka.ut.taa].''' WORD = word.split('.') for i, v in enumerate(WORD): # i % 2 != 0 prevents this rule from applying to first, third, etc. # syllables, which receive stress (WSP) if is_consonant(v[-1]) and i % 2 != 0: if i + 1 == len(WORD) or is_consonant(WORD[i + 1][0]): vv = u_y_final_diphthongs(v) if vv and not is_long(vv.group(1)): I = vv.start(1) + 1 WORD[i] = v[:I] + '.' + v[I:] WORD = '.'.join(WORD) RULE = ' T4' if word != WORD else '' return WORD, RULE