Ejemplo n.º 1
0
def add_necessary_breathing(w):
    s = syllabify(w)
    o, n, c = onset_nucleus_coda(s[0])
    if o == "" and not breathing(n):
        a = accent(n)
        if a:
            if len(n) == 2:
                n = n[0] + add_diacritic(add_diacritic(base(n[1]), SMOOTH), a)
            else:
                n = add_diacritic(add_diacritic(base(n), SMOOTH), a)
        else:
            if len(n) == 2:
                n = n[0] + add_diacritic(base(n[1]), SMOOTH)
            else:
                n = add_diacritic(base(n), SMOOTH)
        return o + n + c + "".join(s[1:])
    else:
        return w
Ejemplo n.º 2
0
def syllable_add_accent(s, a):
    o, n, c = onset_nucleus_coda(s)
    return o + add_diacritic(n, a) + c