Exemplo n.º 1
0
def names2para(names, fn_parameter, ln_parameter, nofn_parameter=None):
    """Take list of names. Return the string to be appended to citation."""
    c = 0
    s = ''
    for first, last in names:
        c += 1
        if c == 1:
            if first or not nofn_parameter:
                s += (
                    ' | ' + ln_parameter + '=' + last +
                    ' | ' + fn_parameter + '=' + first
                )
            else:
                s += ' | ' + nofn_parameter + '=' + fullname(first, last)
        else:
            if first or not nofn_parameter:
                s += (
                    ' | ' + ln_parameter + str(c).translate(DIGITS_TO_FA)
                    + '=' + last +
                    ' | ' + fn_parameter + str(c).translate(DIGITS_TO_FA)
                    + '=' + first
                )
            else:
                s += (
                    ' | ' + nofn_parameter + str(c).translate(DIGITS_TO_FA)
                    + '=' + fullname(first, last)
                )
    return s
Exemplo n.º 2
0
def names1para(translators, para):
    """Take list of names. Return the string to be appended to citation."""
    s = ' | ' + para + '='
    c = 0
    for first, last in translators:
        c += 1
        if c == 1:
            s += fullname(first, last)
        elif c == len(translators):
            s += ' و ' + fullname(first, last)
        else:
            s += '، ' + fullname(first, last)
    return s
Exemplo n.º 3
0
def names1para(translators, para):
    """Take list of names. Return the string to be appended to citation."""
    s = ' | ' + para + '='
    c = 0
    for first, last in translators:
        c += 1
        if c == 1:
            s += fullname(first, last)
        elif c == len(translators):
            s += ' و ' + fullname(first, last)
        else:
            s += '، ' + fullname(first, last)
    return s
Exemplo n.º 4
0
def names2para(names, fn_parameter, ln_parameter, nofn_parameter=None):
    """Take list of names. Return the string to be appended to citation."""
    c = 0
    s = ''
    for first, last in names:
        c += 1
        if c == 1:
            if first or not nofn_parameter:
                s += (' | ' + ln_parameter + '=' + last + ' | ' +
                      fn_parameter + '=' + first)
            else:
                s += ' | ' + nofn_parameter + '=' + fullname(first, last)
        else:
            if first or not nofn_parameter:
                s += (' | ' + ln_parameter + str(c).translate(DIGITS_TO_FA) +
                      '=' + last + ' | ' + fn_parameter +
                      str(c).translate(DIGITS_TO_FA) + '=' + first)
            else:
                s += (' | ' + nofn_parameter + str(c).translate(DIGITS_TO_FA) +
                      '=' + fullname(first, last))
    return s
Exemplo n.º 5
0
def names1para(translators, para):
    """Take list of names. Return the string to be appended to citation."""
    s = f' | {para}='
    c = 0
    for first, last in translators:
        c += 1
        if c == 1:
            s += fullname(first, last)
        elif c == len(translators):
            s += f' و {fullname(first, last)}'
        else:
            s += f'، {fullname(first, last)}'
    return s
Exemplo n.º 6
0
def names2para(names, fn_parameter, ln_parameter, nofn_parameter=None):
    """Take list of names. Return the string to be appended to citation."""
    c = 0
    s = ''
    for first, last in names:
        c += 1
        if c == 1:
            if first or not nofn_parameter:
                s += (f' | {ln_parameter}=' + last + f' | {fn_parameter}=' +
                      first)
            else:
                s += f' | {nofn_parameter}=' + fullname(first, last)
        else:
            if first or not nofn_parameter:
                s += (
                    f' | {ln_parameter}{str(c).translate(DIGITS_TO_FA)}'
                    f'={last} | {fn_parameter}{str(c).translate(DIGITS_TO_FA)}'
                    f'={first}')
            else:
                s += (f' | {nofn_parameter}{str(c).translate(DIGITS_TO_FA)}'
                      f'={fullname(first, last)}')
    return s