Пример #1
0
def __parse_name_3(name):
    """Parses files of type 3

    Files of type 3 have the following structure as their name:

        <name>-3-<num#1>-<num#2>-<num#3>-<num#4>-<num#5>

    The <name> parameter is the name of the speaker.
    The <num#1> parameter is the number spoken in the file.
    The <num#2> parameter is the first digit of second number.
    The <num#3> parameter is the second digit of second number
    The <num#4> parameter is the third digit of second number
    The <num#5> parameter is the fifth digit of second number

    The output format is:

        batsea aktsaa be modul <num#1> le aruts <num#2> <num#2> <num#4> <num#5>

    :param name: file name
    :return: string representing the data in this file
    """
    parts = remove_extension(name).split("-")[2:]
    modul = numeric.to_string_repr(parts[0])
    numbers = " ".join([numeric.to_string_repr(part) for part in parts[1:]])

    return "batsea aktsaa be modul {} le aruts {}".format(modul, numbers)
Пример #2
0
def __parse_name_1(name):
    """Parses files of type 1

    Files of type 1 have the following structure as their name:

        <name>-1-<num>

    The <name> parameter is the name of the speaker.
    The <num> parameter is the number spoken in the file.

    The output format is:

        aaver modul <num> le shidur

    :param name: file name
    :return: string representing the data in this file
    """
    parts = remove_extension(name).split("-")[2:]

    return "aaver modul {} le shidur".format(numeric.to_string_repr(parts[0]))
Пример #3
0
def __parse_name_4(name):
    """Parses files of type 4

    Files of type 4 have the following structure as their name:

        <name>-4-<num>

    The <name> parameter is the name of the speaker.
    The <num> parameter is the number spoken in the file.

    The output format is:

        avor le gibui <num>

    :param name: file name
    :return: string representing the data in this file
    """
    parts = remove_extension(name).split("-")[2:]

    return "avor le gibui {}".format(numeric.to_string_repr(parts[0]))
Пример #4
0
def __parse_name_5(name):
    """Parses files of type 5

    Files of type 5 have the following structure as their name:

        <name>-4-<num#1>-<num#2>-...-<num#n>

    The <name> parameter is the name of the speaker.
    The <num#1> parameter is the first number spoken in the file.
    The <num#2> parameter is the second number spoken in the file.
    ...
    The <num#n> parameter is the n'th number spoken in the file.

    The output format is:

        <num#1> <num#2> ... <num#n>

    :param name: file name
    :return: string representing the data in this file
    """
    parts = remove_extension(name).split("-")[2:]

    return " ".join([numeric.to_string_repr(part) for part in parts])