furi.py
def create_yomi(s, r):
    '''Assumes one kanji-hiragana pair.'''
    kidx = kanji_pos(s)  # kanji index
    nkidx = non_kanji_pos(s)  # non-kanji index
    kyomi = get_kanji_part_yomi(s, r)

    rstring = ''
    if kyomi is None:
        rstring += s
    else:
        if kidx[0] < nkidx[0]:  # kanji + hiragana
            rstring += s[kidx[0]:kidx[1]]
            rstring += '('
            rstring += kyomi
            rstring += ')'
            rstring += s[nkidx[0]:nkidx[1]]
        else:  # hiragana + kanji + hiragana
            rstring += s[nkidx[0]:nkidx[1]]
            rstring += s[kidx[0]:kidx[1]]
            rstring += '('
            rstring += kyomi
            rstring += ')'
            rstring += s[kidx[1]:]

    return rstring
Assumes one kanji-hiragana pair.
Assumes one kanji-hiragana pair.
Assumes one kanji - hiragana pair .
def create_yomi(s, r):
    kidx = kanji_pos(s)  
    nkidx = non_kanji_pos(s)  
    kyomi = get_kanji_part_yomi(s, r)
    rstring = ''
    if kyomi is None:
        rstring += s
    else:
        if kidx[0] < nkidx[0]:  
            rstring += s[kidx[0]:kidx[1]]
            rstring += '('
            rstring += kyomi
            rstring += ')'
            rstring += s[nkidx[0]:nkidx[1]]
        else:  
            rstring += s[nkidx[0]:nkidx[1]]
            rstring += s[kidx[0]:kidx[1]]
            rstring += '('
            rstring += kyomi
            rstring += ')'
            rstring += s[kidx[1]:]
    return rstring
def create_yomi ( s , r ) : kidx = kanji_pos ( s ) nkidx = non_kanji_pos ( s ) kyomi = get_kanji_part_yomi ( s , r ) rstring = '' if kyomi is None : rstring += s else : if kidx [ 0 ] < nkidx [ 0 ] : rstring += s [ kidx [ 0 ] : kidx [ 1 ] ] rstring += '(' rstring += kyomi rstring += ')' rstring += s [ nkidx [ 0 ] : nkidx [ 1 ] ] else : rstring += s [ nkidx [ 0 ] : nkidx [ 1 ] ] rstring += s [ kidx [ 0 ] : kidx [ 1 ] ] rstring += '(' rstring += kyomi rstring += ')' rstring += s [ kidx [ 1 ] : ] return rstring
Assumes one kanji-hiragana pair.
Assumes one kanji - hiragana pair .
'''Assumes one kanji-hiragana pair.''' # kanji index # non-kanji index # kanji + hiragana # hiragana + kanji + hiragana
s
r