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

Functions

def nice_number_es (number, speech, denominators)
 
def nice_time_es (dt, speech=True, use_24hour=False, use_ampm=False)
 
def pronounce_number_es (num, places=2)
 

Variables

dictionary FRACTION_STRING_ES
 
dictionary NUM_STRING_ES
 

Function Documentation

def mycroft.util.lang.format_es.nice_number_es (   number,
  speech,
  denominators 
)
Spanish helper for nice_number

This function formats a float to human understandable functions. Like
4.5 becomes "4 y medio" 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 77 of file format_es.py.

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

For example, generate 'cinco treinta' 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 207 of file format_es.py.

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

For example, '5.2' would return 'cinco coma dos'

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 146 of file format_es.py.

Variable Documentation

dictionary mycroft.util.lang.format_es.FRACTION_STRING_ES
Initial value:
1 = {
2  2: 'medio',
3  3: 'tercio',
4  4: 'cuarto',
5  5: 'quinto',
6  6: 'sexto',
7  7: 'séptimo',
8  8: 'octavo',
9  9: 'noveno',
10  10: 'décimo',
11  11: 'onceavo',
12  12: 'doceavo',
13  13: 'treceavo',
14  14: 'catorceavo',
15  15: 'quinceavo',
16  16: 'dieciseisavo',
17  17: 'diecisieteavo',
18  18: 'dieciochoavo',
19  19: 'diecinueveavo',
20  20: 'veinteavo'
21 }

Definition at line 54 of file format_es.py.

dictionary mycroft.util.lang.format_es.NUM_STRING_ES
Initial value:
1 = {
2  0: 'cero',
3  1: 'uno',
4  2: 'dos',
5  3: 'tres',
6  4: 'cuatro',
7  5: 'cinco',
8  6: 'seis',
9  7: 'siete',
10  8: 'ocho',
11  9: 'nueve',
12  10: 'diez',
13  11: 'once',
14  12: 'doce',
15  13: 'trece',
16  14: 'catorce',
17  15: 'quince',
18  16: 'dieciséis',
19  17: 'diecisete',
20  18: 'dieciocho',
21  19: 'diecinueve',
22  20: 'veinte',
23  30: 'treinta',
24  40: 'cuarenta',
25  50: 'cincuenta',
26  60: 'sesenta',
27  70: 'setenta',
28  80: 'ochenta',
29  90: 'noventa'
30 }

Definition at line 23 of file format_es.py.



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