Add support for:
* mycroft.util.format.nice_time()
* mycroft.util.format.prounce_number()
* implemented unittests for above
Also renamed the helper method convert_number() to
_convert_to_mixed_fraction()
- add_event() now accepts the parameter once, registring the event as a one shot event.
- remove_event for non-existing events is handled
- added a test for this
Move the language specific functions and constants into separate files.
This will avoid many unnecessary conflicts due to involuntary encoding
changes.
When a token has been generated for the provided developer credentials
id the method will return it as json, if it doesn't exist HTTPError will
be raised (404 not found)
Previously the coverage counted the entire mycroft core including things
such as the docs and the tests themself. The inclusion of the actual
tests in the coverage metric scewed the metric quite a bit and the
inclusion of irrelevant files made the information presented by
coveralls cluttered.
As noted on the Chromium Dev How-to [1] and on the
SpeechRecognition library docs [2], the Google TTS API
is really not the right API to call. While it's simple,
and allows you to authenticate via a simple token, it is
also limited to a max of *50* requests per day.
That's not a lot. I don't think many people will find that
useful, outside of quick testing (if they can even get an
API key - I couldn't figure out how to generate one that
worked correctly).
This commit introduces a new STT backend, google_cloud, so that
the Google STT backend can be deprecated eventually. To do so, we
needed to:
- Install the Google API Client Library
- Create a new STT class which knows how to turn a provided Google
JSON credentials file into a string (the SpeechRecognition library
expects you to pass in the JSON string, not a file path, nor an object).
Any person wishing to use this will need to:
- Enable the Cloud Speech API on the Google Cloud Platform console
- Create a new Service Account Key, and download the credentials to
a secure location
- Configure that location in mycroft.conf, like so:
"stt": {
"google_cloud": {
"credential" {
"json": { contents of downloaded credentials }
}
}
}
It's worth noting that the Cloud Speech API has a free quota of
60 minutes per month, which would probably stretch further than 50
individual requests. So for hobbyists, it should be nothing but
a net benefit.
[1] http://www.chromium.org/developers/how-tos/api-keys
[2] https://github.com/Uberi/speech_recognition/blob/master/reference/library-reference.rst#recognizer_instancerecognize_googleaudio_data-key--none-language--en-us-show_all--false
PR 1049 introduced several cosmetic PEP8 errors that were easily fixed.
Additionally there are unittests that include non-ASCII characters which are
failing. As Pt-PT support is a work-in-progress, I just commented them out
with TODOs next to them.
==== Tech Notes ====
- removed old main.py
- replace reference to ConfigurationManager in api tests
- reset configuration after use in configuration test
- Pep-8 issue
added capability to auto upload changes from settingsmeta.json to home.mycroft.ai
==== Documentation Notes ====
If a developer make changes to the settingsmeta.json, then this will be auto uploaded to home.mycroft.ai
==== Protocol Notes ====
hash and uuid are now stored as variables in files located in ~/.mycroft/skills/{skill-name}
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.
Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors. This cleanly
protects the project, the contributor and all who use the technology
to build upon.
Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/
This commit also removes all __author__="" from the code. These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear. Do you remove a name from the list if the
last line of code the wrote gets replaced? Etc. Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!
Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."
==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md
==== Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().
==== Tech Notes ====
Some functions have been orphaned in core.py and are only used in the
tests. To clean up these have been moved to where they're used.
==== Fixed Issues ====
NONE - replace with associated issue numbers, e.g. #123, #304
==== Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.
==== Documentation Notes ====
NONE - description of a new feature or notes on behavior changes
==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.
==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.
==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
==== Fixed Issues ====
NONE - replace with associated issue numbers, e.g. #123, #304
==== Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.
==== Documentation Notes ====
NONE - description of a new feature or notes on behavior changes
==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.
==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.
==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
This is just a basic test of sending between websocket clients. It makes sure the message gets to the other side. It doesn't check for correct ness. More testing sure could be done.
Signed-off-by: Art McGee <amcgee7@jaguarlandrover.com>
Adds the ExtractDateTime parse function from Christopher. When imported from mycroft/util/parse.py, it'll take a sentence like "What's the weather like 5 weeks from next Wednesday?" and will extract a python datetime object for that date.
* Added requirements.txt change for importing dateutil
This addresses this in several ways:
* Created mechanism to load 'commented' JSON (using '//' or '#' comments on a single line)
* Embedded comments into the mycroft.conf, indicating use, legal values, and where they get overridden
* Create ConfigurationManager.instance() static method to replace ConfigurationManager.get(). This produces more readable code like:
ConfigurationManager.instance().get("value") instead of ConfigurationManager.get().get("value")
* Made _ConfigurationListener 'private'
* docstring'ed things
* intent_failure message now carries along the utterance's lang code
* normalizing query for Wolfram Alpha
* added normalization of "whats" to "what is". This is technically incorrect ("whats" means more than one instance of "what", as in "the whats and whys of open source"), but that is a rare phrase. Unfortunately, several STT engines incorrectly output things like "whats 8 + 4", which is grammatically incorrect. So we'll handle the common and potentially screw up the uncommon.
* more parsing test cases, including a few corrections
The utterance is now placed on the bus along with its language code. If not specified, it uses "en-us".
Added a new mycroft.util.parse module. It contains the normalize() function. Normalization currently does two things:
* Expands contractions ("they're" -> "they are", etc)
* Optionally removes articles ("a", "an", "the"). Removing is the default.
* Textual numbers become digits, up to 20. E.g. "What is the weather in four days" becomes "What is weather in 4 days".
NOTE: This is potentially a breaking change! Remove "the", "a" and "an" from your .voc files!
Skill changes:
* I cleaned up the .voc files for the default Skills.
* Split the date_time keyword into an extra entity. Now a "QueryKeyword.voc" exists, with "what|tell" instead of combing that into "what is time" in the TimeKeyword.voc.
* Volume skill now accepts 1-11, e.g. "turn volume to 11"
Add cleanup procedure to skills:
MycroftSkill cleanup does nothing, ScheduledSkill will cancel running timers to make sure it's not blocking termination.
Tests updated to use this allowing unit test to exit after completion.
* Added new listener config options
* Fixed audio unit tests
This adds a cleareraudio file for the wakeup test and changesto the new LocalRecognizer constructor
* Added .dict files to .gitignore
This is because they are now auto-generated on startup rather than stored permanently
* Fixed audio accuracy test for new LocalRecognizer constructor
* Added support for spaces in wake word config
In the phonemes a new word is indicated by a period character. The separating of the words actually changes the way pocketsphinx interprets the sound of it and in this case improves it
* Fixed unit test
* Added new compiled regex for what's
This is for verbs that don't have a space between the question word and verb
* Added support for 'whats' in wolfram
* Added tests for the EnglishQuestionParser
* Issues 192 - WA skill will now search again with top alternative
* Issues 192 - Add tests for new method
* Issues 192 - Fix pep8
* Issues 192 - Update test syntax
* Issues 192 - Change WA skill to use dialog
* Issues 192 - Address feedback
* Issues 158 - Update ScheduledSkill time formatting
* Issues 158 - Add unit tests for new method changes
* Issues 158 - Change to not use date-based implementation to fix tests
* Issues 158 - Address feedback