Commit Graph

1709 Commits (408f0ef4bc5463d0b052797daa559ca3497814ef)

Author SHA1 Message Date
Michael Nguyen 408f0ef4bc function to normalized all numbers to text equivalent (#1737)
Numbers are now normalized to the text equivalent. This is to solve problems where mimic2 returns a speed up text generation when saying number values.
2018-08-14 22:01:08 -05:00
Julien Kassar 24a80d60c3 Fix camel case splitting
Signed-off-by: Julien Kassar <github@kassisol.com>
2018-08-12 14:00:28 -04:00
Dominik aaae168672 some vocab/dialog was added (#1717) 2018-08-10 15:02:56 -05:00
Nolan Darilek adfd9154db Better logging around why writing .PHO file fails. 2018-08-06 20:28:52 +00:00
devs-mycroft 99b00bb776 Version bump from 18.2.11 to 18.2.12 2018-08-04 08:07:42 +00:00
Steve Penrod 609a09bbf3
Allow Padatious to override Adapt (#1713)
Allow a Padatious intent to override Adapt when it is VERY
certain that the utterance is directed at it.  (95% confidence
or greater.)  Right now that only occurs if the intent match
for the given phrase is perfect.

This solves this kind of issue:
* Adapt:  Matching on "Set" and "Alarm"
* Padatious: Handling "is an alarm set"

* Fix logic error for when no Padatious intent
2018-08-03 14:43:17 -05:00
Matthew D. Scholefield d49d991a84 Remove git locks when starting mycroft (#1715)
This is a preventative measure to fix errors with git lock files not being removed when devices are unplugged or processes are killed
2018-08-03 14:41:51 -05:00
Steve Penrod 1c82945576 Move logs to /var/log/mycroft/ directory
Simplifies permissions and future log-rotations to have all logs
under a single folder instead of having to give permissions to each.
2018-08-02 23:57:13 -05:00
Steve Penrod f329051743 Move logs to /var/log in all cases
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install.  Now they are always under the same directory
at /var/log/mycroft-*.log

This also updates the CLI to pull from that location always.

Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
  a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
  directories successfully
2018-08-02 21:21:30 -05:00
Michael Nguyen fe00294b4c Feature/mimic2 visemse (#1708)
* added ability to create visemes
* clean visemes code, added url to mycroft.conf
2018-08-02 15:08:10 -05:00
Michael Nguyen 7b54149bcd
Merge pull request #1653 from JarbasAl/feature/pronounce_scientific
Feature/pronounce scientific
2018-07-31 13:04:14 -05:00
Steve Penrod 040b64d09d
Fix CLI screen corruption (#1704)
The CLI would often have temporary screen corruption.  This reworks
several things to correct that issue, although it looks like the
ultimate cause was drawing to the screen while in the middle of
waiting on a VT100 ESC keycode sequence.

* Rearchitected all screen drawing to run in a single thread.  Now
  call set_screen_dirty() instead of draw_screen()
* Added a lock on accessing the various Log buffers, preventing
  changes to the buffer in the middle of a redraw
* Modified key reading logic when ESC character is received.  Now
  uses a 1 second timeout if no subsequent keycodes are sent
* Catch several special exceptions.  Curses throws exceptions in some cases during get_wch(), such as
when you Ctrl+Z suspend the CLI the resume the process.  Also moved Ctrl+C processing into this exception handler.
2018-07-30 17:17:48 -05:00
Steve Penrod ec73b7d48e
Fix named event scheduling/deleting (#1705)
While working on the Alarm skill I discovered several issues with the
event scheduler.  This PR cleans up those findings and resolves several
other potential issues:

1) To avoid thread synchronization issues, the EventScheduler had several
queues which independently held objects to be added/deleted/updated.  However, the order of the events was undefined and got mixed since they were all batched together.  So, for instance, if skill code performed:
   self.add_event("foo", self.handle_foo)
   if SomeReason:
       self.cancel_event("foo")
The actual order of queue handling would perform Remove first, then Add which resulted in "foo" not being found for delete, but then added and left as an active event.

Now the EventScheduler protects the list using a Lock and the queues have been removed.  Modifications to the list happen immediately after obtaining the lock and are not batched up.

2) One-time events were triggered while the event was still in the EventScheduler list.  Now the entry is removed before invoking the handler.

3) Within the MycroftSkill.add_event(name, handler) is a local 'wrapper' method that actually makes the callback.  The MycroftSkill.remove_event(name) method attempted to find entries in the events list and the associated handler entries in the self.emitter to remove.  However, the emitter actually held the wrapper(handler), not the handler itself.  So the emitter handlers were left behind.

This was a quiet bug until the next time you scheduled an event of the same name.  When that second event finally triggered, it would fire off both the new and the old handler -- which snowballed in the 'skill-alarm:Beep' case, doubling and redoubling with every beep.

Now this cancels all the emitter listeners by name.  There is a very slim chance that someone has registered a listener with the same name, but since it is namespaced to "skill-name:Event" I think this is pretty safe.


Not technically related, but a failure that has been lurking for
some time and is a French unit test that doesn't work depending
on the time of day when the test is run.
2018-07-30 15:08:13 -05:00
Josh Cox 2abb8fa74b Add Ogg123 support (#1678)
This is reimplementation of #1649 which became divergent.

## Description
Adds a Ogg123Service and a play_ogg exactly like Mpg123Service and play_mp3

## How to test
I have a skill for a podcast which does not have an mp3 feed:
https://github.com/joshuacox/skill-GNUworldOrder

## Contributor license agreement signed?
signed by @joshuacox
2018-07-26 22:25:39 -05:00
Matthew D. Scholefield 3fbe12cc07
Make single thread log nicer 2018-07-26 18:57:36 -05:00
Steve Penrod 0eb29718f3 Remove commented-out code 2018-07-26 18:27:49 -05:00
Steve Penrod edc6ab1ed6 Immediately speak warning while Padatious trains
At startup, Padatious was blocking in the fallback while the
training occurred.  As a result, any attempts to use Mycroft
during that period would queue up rather than giving the
user feedback.  Now it immediately returns False, allowing
user notification to occur elsewhere.
2018-07-26 18:21:48 -05:00
devs-mycroft 9ad7bf79a3 Version bump from 18.2.10 to 18.2.11 2018-07-19 14:02:03 +00:00
Åke Forslund b60320bcae Fix updating padatious intents after intent reload
Training is called from wait_and_train with None as message, this commit adds propper handling for this case.
2018-07-19 14:06:58 +02:00
Steve Penrod 0e61700e13 Allow reference dates with tzinfo (#1695)
* Allow reference dates with tzinfo

The extract_datetime_en() function could cause an exception if the currentData parameter contained tzinfo.
2018-07-19 10:48:39 +02:00
f-e-l-i-x 9e2dc9628e German formatting for Wolfram alpha skill responses in format_de.py (#1669)
Response formatting for German language ordinals depending on cases/prepositions for dates
"am 1. März" -> "am ersten März" (on the first of March)
"der 1. März" -> "der erste März" (the first of March)
"1. März" -> "erster März" (first of March)

Response formatting for mathematical results
"10 ^ 2" -> "10 hoch 2" (ten to the power of two)

Can be tested via the corresponding test_format_de or by using wolfram alpha skill:
"Was ist die Fläche von Canada"
"Wann ist George Washington geboren"
2018-07-19 02:44:33 -05:00
Åke c140d5b889
Merge pull request #1690 from MycroftAI/feature/ask-yes-no
Add new MycroftSkill.ask_yesno() method
2018-07-19 09:34:32 +02:00
Åke 5cfea7f2d9 Update default config (#1648)
- Remove unused entries for skills
- Correct the entry for the NewsSkill
2018-07-19 02:08:23 -05:00
Åke ad5ebcf63d Bugfix/unmunge (#1688)
* Fix cases where the unmunge misses keywords

The unmunge would invariably miss keys due to the fact that the dict is modified while being iterated. This breaks out the keys into a list before iterating through them to ensure that all original keys are checked.

* Clean up the unmunge function slightly
2018-07-19 02:03:43 -05:00
penrods b005ba6f59 Allow dialog param of get_response() to be a spoken string
This makes the dialog parameter dual-purpose.  It can be used as a
literal spoken string, or a dialog resource.  In the future the
announcement parameter can be retired.
2018-07-19 02:00:17 -05:00
Åke 031daac17b
Merge pull request #1693 from forslund/feature/better-time-parse-and-fix-date-formatting
better time parse and fix date formatting #1681 + #1689
2018-07-18 21:31:51 +02:00
Matthew D. Scholefield e73c6c8e09
Merge pull request #1694 from MycroftAI/mimic2 2018-07-18 13:11:59 -05:00
Michael Nguyen 1ab9ae3889 Add Mimic 2 TTS
* added asynchronous request to mimic2 backend to break up audio into chunks

 * add chracter threshold

 * refactored split_by_punctuation

 * add punctuation function to sentence chunks

 * fix spelling

 * some more spelling

 * added mimic2 in mycroftconf

 * removed unused imports
2018-07-18 13:10:07 -05:00
Michael Nguyen fb2a6209ee
Merge pull request #1506 from forslund/feature/vlc-update
Feature/vlc update
2018-07-18 11:28:33 -05:00
Matthew D. Scholefield 0540229cc4
Merge branch 'dev' into feature/cleanup-setup 2018-07-18 10:44:41 -05:00
Åke Forslund a14a8b6d7e Remove setup.py's reliance on the mycroft modules
- Adds missing fields, such as description, author and e-mail
- Removes the old setup_base.py from the mycroft.util module
2018-07-18 17:24:26 +02:00
Åke Forslund b4b78fa43a correct testcases 2018-07-18 13:46:27 +02:00
penrods 4f1b6abd4f Improve date-time formatting in English
The pronunciation of English date-time was awkward without the word "the"
for dates like "Monday, the 16th at eight a.m."

Also corrected the tests to use the newer lower case "a.m." instead of "AM"
2018-07-18 13:46:27 +02:00
penrods 9bce9557cc Improve pronunciation for nice_time_en()
Switched from "AM" to "a.m.", and "PM" to "p.m".  These are pronounced better
in Mimic, and are also the more normally accepted ways of writing the
abbreviations for ante meridiem and post meridiem (at least according to the
AP and Chicago Style guides).
2018-07-18 13:46:27 +02:00
Steve Penrod 718703c94b Silence Codacy complaints
More import cleanup
2018-07-18 13:46:27 +02:00
Steve Penrod 1029881a78 Minor code cleanup
* Add support for "o'clock" variations
* Clean up imports
* Simplified some overly-complex code
* Normalize line endings
2018-07-18 13:46:27 +02:00
Steve Penrod 3624680698 Enhance extract_datetime(), add time utilities
Many cases that were missed in the unittests for extract_datetime()
from the original source.  Restored those tests and made code
adjustments to support them all.

Also adding the mycroft.util.time module.  This supports:
* mycroft.util.time.default_timezone()
  Returns the user-configured timezone based on location
* mycroft.util.time.now_utc()
  Returns the time in UTC
* mycroft.util.time.now_local()
  Returns the time in the user's timezone
* mycroft.util.time.to_utc()
  Converts to UTC
* mycroft.util.time.to_local()
  Converts to user's timezone

NOTE: Several skills should be updated to use these now.

==== Fixed Issues ====
Several issues for skills regarding parsing of "today"

====  Documentation Notes ====
Note the new module:  mycroft.util.time

==== Localization Notes ====
Localized versions of extract_datetime() likely need to be
updated, as most were based on the original English implementation
2018-07-18 13:46:27 +02:00
penrods 6aa83418ec Correct voc files (copy/paste error) 2018-07-17 01:47:17 -05:00
penrods 18ab343b80 Add new MycroftSkill.ask_yesno() method
New function allows simple yes/no queries to be asked, capturing common
affirmations (e.g. "yes", "yeah", "yep", "sure", ...) and rejections
("no", "nope", ...) that are consistent across all skills.

The method will return a normalized 'yes', 'no' or whatever else is spoken
for further parsing.  None is also possible.

This also adds the MycroftSkill.is_match() method to assist in matching
translated synonyms within an utterance.
2018-07-17 01:35:55 -05:00
Åke 9c8c6b8852
Merge pull request #1686 from JarbasAl/feature/padatious_enable_disable
Make it possible to enable/disable padatious intents
2018-07-14 11:52:12 +02:00
JarbasAI 0e121f8bcd allow disabling intent registered with decorator in initialize (#1685) 2018-07-14 11:36:16 +02:00
Åke Forslund fad890ff39 Clean up setup scripts
- Remove setup scripts for mycroft-skills-sdk since it's not used anymore
- Rename mycroft-base-setup.in/MANIFEST.in to setup.py and MANIFEST.in
- Remove skill-container, since it hasn't been used or kept up to date since 17.08 and the cli commands to remove and activate skills is easier to work with

==== Environment Notes ====
Small update of the packaging script is needed due to this change
2018-07-14 08:36:50 +02:00
jarbasal 56efe5e489 padatious enable/disable 2018-07-14 04:31:39 +01:00
jarbasal c4cdb85599 padatious enable/disable 2018-07-14 04:00:21 +01:00
Steve Penrod 223c88b4dd CLI Updates: Restore VT100 support, help, etc. (#1667)
* Restored VT100 function key support
* ESC now clears the entry line
* Spoken commands now become part of the history
* Enhanced help screen with auto word-wrap
* Bugfix: "Show meter" setting didn't persist, now it does
2018-07-12 09:38:29 +02:00
Åke 14349cfb25 Remove stray lock.release() (#1680)
This fixes a stray lock.release() causing a silent

RuntimeError: release unlocked lock

after TTS execution but just before reporting the timing for the TTS system.
2018-07-10 12:28:45 -05:00
Åke Forslund 0ae9ccda9a Make vlc ducking configurable 2018-07-10 11:21:33 +02:00
Åke Forslund 8f979df5b1 Reduce log level to debug 2018-07-10 11:21:33 +02:00
Åke Forslund 78dbdf1fb0 Restore volume when stopping playback 2018-07-10 11:20:41 +02:00
Åke Forslund bb2c727485 Add comments and basic docstrings 2018-07-10 11:19:54 +02:00