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

Functions

def nice_number_da (number, speech, denominators)
 
def nice_ordinal_da (text)
 
def nice_response_da (text)
 
def nice_time_da (dt, speech=True, use_24hour=False, use_ampm=False)
 
def pronounce_number_da (num, places=2)
 
def pronounce_ordinal_da (num)
 

Variables

string EXTRA_SPACE = ""
 
dictionary FRACTION_STRING_DA
 
list months
 
list NUM_POWERS_OF_TEN
 
dictionary NUM_STRING_DA
 

Function Documentation

def mycroft.util.lang.format_da.nice_number_da (   number,
  speech,
  denominators 
)
Danish helper for nice_number
This function formats a float to human understandable functions. Like
4.5 becomes "4 einhalb" 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 101 of file format_da.py.

def mycroft.util.lang.format_da.nice_ordinal_da (   text)

Definition at line 377 of file format_da.py.

def mycroft.util.lang.format_da.nice_response_da (   text)

Definition at line 360 of file format_da.py.

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

For example, generate 'five thirty' 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 275 of file format_da.py.

def mycroft.util.lang.format_da.pronounce_number_da (   num,
  places = 2 
)
Convert a number to its spoken equivalent
For example, '5.2' would return 'five point two'
Args:
    num(float or int): the number to pronounce (set limit below)
    places(int): maximum decimal places to speak
Returns:
    (str): The pronounced number

Definition at line 140 of file format_da.py.

def mycroft.util.lang.format_da.pronounce_ordinal_da (   num)

Definition at line 248 of file format_da.py.

Variable Documentation

string mycroft.util.lang.format_da.EXTRA_SPACE = ""

Definition at line 98 of file format_da.py.

dictionary mycroft.util.lang.format_da.FRACTION_STRING_DA
Initial value:
1 = {
2  2: 'halv',
3  3: 'trediedel',
4  4: 'fjerdedel',
5  5: 'femtedel',
6  6: 'sjettedel',
7  7: 'syvendedel',
8  8: 'ottendedel',
9  9: 'niendedel',
10  10: 'tiendedel',
11  11: 'elftedel',
12  12: 'tolvtedel',
13  13: 'trettendedel',
14  14: 'fjortendedel',
15  15: 'femtendedel',
16  16: 'sejstendedel',
17  17: 'syttendedel',
18  18: 'attendedel',
19  19: 'nittendedel',
20  20: 'tyvendedel'
21 }

Definition at line 68 of file format_da.py.

list mycroft.util.lang.format_da.months
Initial value:
1 = ['januar', 'februar', 'märz', 'april', 'mai', 'juni',
2  'juli', 'august', 'september', 'oktober', 'november',
3  'dezember']

Definition at line 21 of file format_da.py.

list mycroft.util.lang.format_da.NUM_POWERS_OF_TEN
Initial value:
1 = [
2  'hundred',
3  'tusind',
4  'million',
5  'milliard',
6  'billion',
7  'billiard',
8  'trillion',
9  'trilliard'
10 ]

Definition at line 57 of file format_da.py.

dictionary mycroft.util.lang.format_da.NUM_STRING_DA

Definition at line 25 of file format_da.py.



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