Functions | Variables
mycroft.util.lang.format_fr Namespace Reference

Functions

def nice_number_fr (number, speech, denominators)
 
def nice_time_fr (dt, speech=True, use_24hour=False, use_ampm=False)
 
def pronounce_number_fr (num, places=2)
 

Variables

dictionary FRACTION_STRING_FR
 
dictionary NUM_STRING_FR
 

Function Documentation

def mycroft.util.lang.format_fr.nice_number_fr (   number,
  speech,
  denominators 
)
French helper for nice_number

This function formats a float to human understandable functions. Like
4.5 becomes "4 et demi" for speech and "4 1/2" for text

Args:
    number (int or float): the float to format
    speech (bool): format for speech (True) or display (False)
    denominators (iter of ints): denominators to use, default [1 .. 20]
Returns:
    (str): The formatted string.

Definition at line 74 of file format_fr.py.

def mycroft.util.lang.format_fr.nice_time_fr (   dt,
  speech = True,
  use_24hour = False,
  use_ampm = False 
)
Format a time to a comfortable human format

For example, generate 'cinq heures trente' for speech or '5:30' for
text display.

Args:
    dt (datetime): date to format (assumes already in local timezone)
    speech (bool): format for speech (default/True) or display (False)=Fal
    use_24hour (bool): output in 24-hour/military or 12-hour format
    use_ampm (bool): include the am/pm for 12-hour format
Returns:
    (str): The formatted time string

Definition at line 205 of file format_fr.py.

def mycroft.util.lang.format_fr.pronounce_number_fr (   num,
  places = 2 
)
Convert a number to it's spoken equivalent

For example, '5.2' would return 'cinq virgule deux'

Args:
    num(float or int): the number to pronounce (under 100)
    places(int): maximum decimal places to speak
Returns:
    (str): The pronounced number

Definition at line 143 of file format_fr.py.

Variable Documentation

dictionary mycroft.util.lang.format_fr.FRACTION_STRING_FR
Initial value:
1 = {
2  2: 'demi',
3  3: 'tiers',
4  4: 'quart',
5  5: 'cinquième',
6  6: 'sixième',
7  7: 'septième',
8  8: 'huitième',
9  9: 'neuvième',
10  10: 'dixième',
11  11: 'onzième',
12  12: 'douzième',
13  13: 'treizième',
14  14: 'quatorzième',
15  15: 'quinzième',
16  16: 'seizième',
17  17: 'dix-septième',
18  18: 'dix-huitième',
19  19: 'dix-neuvième',
20  20: 'vingtième'
21 }

Definition at line 51 of file format_fr.py.

dictionary mycroft.util.lang.format_fr.NUM_STRING_FR
Initial value:
1 = {
2  0: 'zéro',
3  1: 'un',
4  2: 'deux',
5  3: 'trois',
6  4: 'quatre',
7  5: 'cinq',
8  6: 'six',
9  7: 'sept',
10  8: 'huit',
11  9: 'neuf',
12  10: 'dix',
13  11: 'onze',
14  12: 'douze',
15  13: 'treize',
16  14: 'quatorze',
17  15: 'quinze',
18  16: 'seize',
19  20: 'vingt',
20  30: 'trente',
21  40: 'quarante',
22  50: 'cinquante',
23  60: 'soixante',
24  70: 'soixante-dix',
25  80: 'quatre-vingt',
26  90: 'quatre-vingt-dix'
27 }

Definition at line 23 of file format_fr.py.



mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:41