Exemple #1
0
def cslav_subst(x):
    return EXCLAM + cslav_nobr_words(ucs_convert(x.group(1))) + EXCLAM
Exemple #2
0
    lexemes = lexemes.filter(pk__in=test_entries)
lexemes = [e for e in lexemes if e.first_volume]

for lexeme in lexemes:

    wordform = lexeme.base_vars[0].idem
    reference = None
    entries.append((wordform, reference, lexeme))
    key = sort_key1(wordform)

    # Варианты
    for var in lexeme.orth_vars_refs[1:]:
        wordform = resolve_titles(var.idem)
        key2 = sort_key1(wordform)
        if key2 != key:
            reference = ucs_convert(wordform)
            entries.append((wordform, reference, lexeme))

    # Названия народов
    COMMA = ur',\s+'
    if lexeme.nom_sg:
        wordform = lexeme.nom_sg
        reference = lexeme.nom_sg_ucs_wax[1]
        for wordform, reference in zip(
                re.split(COMMA, wordform), re.split(COMMA, reference)):
            entries.append((wordform, reference, lexeme))

    # Краткие формы
    #if lexeme.short_form:
    #    wordform = lexeme.short_form
    #    reference = lexeme.short_form_ucs
Exemple #3
0
def ind_cslav_injection(value, cstyle=CSLCSTYLE):
    """ Заменяет текст вида ``## <text::antconc> ##`` на ``<text::ucs8>``.
    """
    ind_cslav = subst_func(lambda x: indesign_cslav_words(
        ucs_convert(x), cstyle))
    return re.sub(ur'(\s*)##(.*?)##(\s*)', ind_cslav, value)