Ambiguous times previously used a generally unexpected rule about
when to jump 12 hours when parsing times. Now it follows the rule:
If a time is spoken without am/pm indicator, assume the next time
that hasn't passed was intended.
For example:
"at 7 o'clock"
Would mean 7:00am if spoken at 6:59am, but would mean 7:00pm
if spoken at 7:01am.
* New formatters: nice_duration() and join_list()
Adding two new formatting functions:
* nice_duration(duration, lang="en-us", speech=True)
Accept seconds or duration and produce a nice sounding duration.
Example: nice_duration(61) == "one minute one second"
nice_duration(61, speech=False) == "1:01"
* join_list(items, connector, sep=None, lang="en-us")
Example: join_list(["a", "b", "c"], "and") == "a, b and c"
This includes a translation helper that uses text files in the
mycroft/res/text/LANG/ directory, such as "second.word".
This extracts the logging logic that was being used in a few places to
indicate certain parcing functions are not supported in particular
languages, and adds the logging to extract_duration.
- Move "save_utterenaces" comments to correct block
- Correct information, records utterance not wakeword
- replace "record_utterances" with the new "save_utterances"
Change to match the documented and more intuitive name "save_utterances",
but add backwards compatibility code to support the original
"record_utterances".
The sudo command check was performed only when packages were installed and not before the interactve portion leaving $SUDO unset when trying to create the /opt/mycroft folder.
Making things weak private, to limit surface area of support. As things
become increasingly stable/tested/useful, it may make sense to open them
up, but for now, keeping them private will limit risk.
This is in support of issue-1959.
After many changes, things had gotten a little disorganized, and the
docs were a little out of date. This brings them up to date.
This is in support of issues-1959.
This improves the utility of the _ReplaceableNumber class, and updates
most of the number parsing functions to take tokens rather than text.
This simplifies the interactions between many of the functions, as there
is no need to convert back and forth between text and tokens.
This also adds some tests. Note that there are a few regressions that
will be fixed in a subsequent commit.
This was calling convert_words_to_numbers and parsing out the resuling
numbers, which was a simple way of getting the numebrs in order, but it
choked on anything that didn't match the regex being used to parse
numbers, in particular numbers of the form '6e18'. The better solution
is to directly use extract_numbers_with_text (which now sorts by
start_index) and get the values from there directly.
This is in support of issues-1959.
"Five hours seven and a half minutes" was parsing as 5.5. This is
resolved. Multiple fractions/decimals still cause problems, e.g.
convert_words_to_numbers("seven and a half and nine and a half")
Out[5]: '7 and a 0.5 and 9 and a 0.5'
This is in support of issues-1959.
* Add tests for DialogLoader
* Handle Path/PosixPath
LOG messages when files/directories were missing would fail when a PosixPath/Path object was sent to as argument. This uses format to get the correct string representation.
* Add test for dialog.get()
Slight refactoring to accommodate for this in a nice way. Created
function connect_to_mycroft() handling fetching the config and
connecting to the mycroft messagebus since these are related and the
order is important to maintain for it to work.
* Refactor mimic2 to use the shared tts architecture
* Make sure the queue is cleared
- Add a convenience method grouping clear_queue and clear_visemes
- The start time is now set before the lock to allow multiple speech requests queued before the stop signal to also be cancelled
- Make sure the any pending TTS generation is cleared from the queue by calling tts.clear() when breaking from the chunking loop.
To simplify the process of adding an idle page to a skill the decorator "resting_screen_handler" was added. In a skill class the decorator can be applied to a method to register it to handle idle.
@resting_page_handler("My Idle Page")
def handler(self, message):
...
The decorator will Register the method with the Mark-2 skill and perform all communications needed to make it work smoothly.
* Add new api command to send visemes as single list. This allows more efficient use of the messagebus and gives implementors flexibility in how they handle the visualization.
* Switch mark1 to use viseme_list
The wrong method was registered, instead of the wrapped function call
the original method was registered. This led to not being able to
unregister fallbacks.