Functions | |
def | extract_datetime_fr (string, currentDate, default_time) |
def | extract_numbers_fr (text, short_scale=True, ordinals=False) |
def | extractnumber_fr (text) |
def | getOrdinal_fr (word) |
def | isFractional_fr (input_str) |
def | normalize_fr (text, remove_articles) |
def | number_ordinal_fr (words, i) |
def | number_parse_fr (words, i) |
Variables | |
list | articles_fr = ["le", "la", "du", "de", "les", "des"] |
dictionary | numbers_fr |
tuple | ordinals_fr = ("er", "re", "ère", "nd", "nde" "ième", "ème", "e") |
def mycroft.util.lang.parse_fr.extract_datetime_fr | ( | string, | |
currentDate, | |||
default_time | |||
) |
Definition at line 476 of file parse_fr.py.
def mycroft.util.lang.parse_fr.extract_numbers_fr | ( | text, | |
short_scale = True , |
|||
ordinals = False |
|||
) |
Takes in a string and extracts a list of numbers. Args: text (str): the string to extract a number from short_scale (bool): Use "short scale" or "long scale" for large numbers -- over a million. The default is short scale, which is now common in most English speaking countries. See https://en.wikipedia.org/wiki/Names_of_large_numbers ordinals (bool): consider ordinal numbers, e.g. third=3 instead of 1/3 Returns: list: list of extracted numbers as floats
Definition at line 1070 of file parse_fr.py.
def mycroft.util.lang.parse_fr.extractnumber_fr | ( | text | ) |
Takes in a string and extracts a number. Args: text (str): the string to extract a number from Returns: (str): The number extracted or the original text.
Definition at line 375 of file parse_fr.py.
def mycroft.util.lang.parse_fr.getOrdinal_fr | ( | word | ) |
Get the ordinal number Takes in a word (string without whitespace) and extracts the ordinal number. Args: word (string): the word to extract the number from Returns: number (int) Returns None if no ordinal number was found.
Definition at line 280 of file parse_fr.py.
def mycroft.util.lang.parse_fr.isFractional_fr | ( | input_str | ) |
This function takes the given text and checks if it is a fraction. Args: input_str (str): the string to check if fractional Returns: (bool) or (float): False if not a fraction, otherwise the fraction
Definition at line 1001 of file parse_fr.py.
def mycroft.util.lang.parse_fr.normalize_fr | ( | text, | |
remove_articles | |||
) |
French string normalization
Definition at line 1033 of file parse_fr.py.
def mycroft.util.lang.parse_fr.number_ordinal_fr | ( | words, | |
i | |||
) |
Find an ordinal number in a list of words Takes in a list of words (strings without whitespace) and extracts an ordinal number that starts at the given index. Args: words (array): the list to extract a number from i (int): the index in words where to look for the ordinal number Returns: tuple with ordinal number (str), index of next word after the number (int). Returns None if no ordinal number was found.
Definition at line 301 of file parse_fr.py.
def mycroft.util.lang.parse_fr.number_parse_fr | ( | words, | |
i | |||
) |
Parses a list of words to find a number Takes in a list of words (strings without whitespace) and extracts a number that starts at the given index. Args: words (array): the list to extract a number from i (int): the index in words where to look for the number Returns: tuple with number, index of next word after the number. Returns None if no number was found.
Definition at line 82 of file parse_fr.py.
list mycroft.util.lang.parse_fr.articles_fr = ["le", "la", "du", "de", "les", "des"] |
Definition at line 34 of file parse_fr.py.
dictionary mycroft.util.lang.parse_fr.numbers_fr |
Definition at line 36 of file parse_fr.py.
tuple mycroft.util.lang.parse_fr.ordinals_fr = ("er", "re", "ère", "nd", "nde" "ième", "ème", "e") |
Definition at line 79 of file parse_fr.py.