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

Functions

def fix_hour (hour)
 
def nice_number_nl (number, speech, denominators)
 
def nice_ordinal_nl (text)
 
def nice_part_of_day_nl (dt)
 
def nice_response_nl (text)
 
def nice_time_nl (dt, speech=True, use_24hour=False, use_ampm=False)
 
def pronounce_number_nl (num, places=2)
 
def pronounce_ordinal_nl (num)
 

Variables

string EXTRA_SPACE = ""
 
dictionary FRACTION_STRING_NL
 
list months
 
list NUM_POWERS_OF_TEN
 
dictionary NUM_STRING_NL
 

Function Documentation

def mycroft.util.lang.format_nl.fix_hour (   hour)

Definition at line 344 of file format_nl.py.

def mycroft.util.lang.format_nl.nice_number_nl (   number,
  speech,
  denominators 
)
Dutch 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 100 of file format_nl.py.

def mycroft.util.lang.format_nl.nice_ordinal_nl (   text)

Definition at line 380 of file format_nl.py.

def mycroft.util.lang.format_nl.nice_part_of_day_nl (   dt)

Definition at line 351 of file format_nl.py.

def mycroft.util.lang.format_nl.nice_response_nl (   text)

Definition at line 363 of file format_nl.py.

def mycroft.util.lang.format_nl.nice_time_nl (   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 264 of file format_nl.py.

def mycroft.util.lang.format_nl.pronounce_number_nl (   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 138 of file format_nl.py.

def mycroft.util.lang.format_nl.pronounce_ordinal_nl (   num)

Definition at line 246 of file format_nl.py.

Variable Documentation

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

Definition at line 97 of file format_nl.py.

dictionary mycroft.util.lang.format_nl.FRACTION_STRING_NL
Initial value:
1 = {
2  2: 'half',
3  3: 'derde',
4  4: 'vierde',
5  5: 'vijfde',
6  6: 'zesde',
7  7: 'zevende',
8  8: 'achtste',
9  9: 'negende',
10  10: 'tiende',
11  11: 'elfde',
12  12: 'twaalfde',
13  13: 'dertiende',
14  14: 'veertiende',
15  15: 'vijftiende',
16  16: 'zestiende',
17  17: 'zeventiende',
18  18: 'achttiende',
19  19: 'negentiende',
20  20: 'twintigste'
21 }

Definition at line 67 of file format_nl.py.

list mycroft.util.lang.format_nl.months
Initial value:
1 = ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
2  'juli', 'augustus', 'september', 'oktober', 'november',
3  'december']

Definition at line 21 of file format_nl.py.

list mycroft.util.lang.format_nl.NUM_POWERS_OF_TEN
Initial value:
1 = [
2  '', 'duizend', 'miljoen', 'miljard', 'biljoen', 'biljard', 'triljoen',
3  'triljard'
4 ]

Definition at line 62 of file format_nl.py.

dictionary mycroft.util.lang.format_nl.NUM_STRING_NL

Definition at line 25 of file format_nl.py.



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