How to use the jaconv.normalize function in jaconv

To help you get started, we’ve selected a few jaconv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github r9y9 / deepvoice3_pytorch / deepvoice3_pytorch / frontend / jp / __init__.py View on Github external
def text_to_sequence(text, p=0.0):
    for c in [" ", " ", "「", "」", "『", "』", "・", "【", "】",
              "(", ")", "(", ")"]:
        text = text.replace(c, "")
    text = text.replace("!", "!")
    text = text.replace("?", "?")

    text = normalize_delimitor(text)
    text = jaconv.normalize(text)
    if p > 0:
        text = mix_pronunciation(text, p)
    text = jaconv.hira2kata(text)
    text = add_punctuation(text)

    return [ord(c) for c in text] + [_eos]  # EOS
github hash2430 / dv3_world / deepvoice3_pytorch / frontend / jp / __init__.py View on Github external
def text_to_sequence(text, p=0.0):
    for c in [" ", " ", "「", "」", "『", "』", "・", "【", "】",
              "(", ")", "(", ")"]:
        text = text.replace(c, "")
    text = text.replace("!", "!")
    text = text.replace("?", "?")

    text = normalize_delimitor(text)
    text = jaconv.normalize(text)
    if p > 0:
        text = mix_pronunciation(text, p)
    text = jaconv.hira2kata(text)
    text = add_punctuation(text)

    return [ord(c) for c in text] + [_eos]  # EOS
github espnet / espnet / egs / jsut / tts2 / local / clean_text.py View on Github external
def g2p(text, trans_type="char"):
    text = jaconv.normalize(text)
    if trans_type == "char":
        text = pyopenjtalk.g2p(text, kana=True)
    elif trans_type == "phn":
        text = pyopenjtalk.g2p(text, kana=False)
    else:
        assert False
    return text