Commit Graph

17 Commits (73e49949b086378df815d4b6a54614cd347961ba)

Author SHA1 Message Date
Chris Veilleux f16989c2ec Add log messages that provide insight into the disambiguation behavior 2019-09-28 12:20:22 -05:00
Chris Veilleux 5980779e48 Refactored module level docstring and import ordering 2019-09-28 12:17:12 -05:00
jarbasal 5edf464808 bugfix/adapt munging 2019-09-13 02:06:18 +01:00
Åke Forslund 5e558647e7 Refactor translation methods
Move file reading logic into skill_data.py
2019-08-30 13:00:26 +02:00
Åke Forslund 245a4cb698 Refactor adapt intent data loading routines
- The data loading no longer require the bus
- Add an intent service interface class for better testing
- Update test cases
2019-08-30 13:00:26 +02:00
Åke Forslund 2a65623c6d Read vocab the .voc files as lowercase
A common error is to add capitalization in the .voc files when
translating them using the translate tool.
2019-06-25 11:05:44 +02:00
Åke Forslund 40eca55cf2 Expand .voc files in MycroftSkill.voc_match()
- Create a read_vocab_file() function that normal vocab loading and voc_match both uses. This function handles blank lines and comments
- Use a simpler regex instead of word logic to match
- Add a couple of test cases for the method
2019-02-22 18:49:01 +01:00
Matthew D. Scholefield 64571924e7 Add (|) syntax to dialog and voc files 2019-02-15 12:05:39 -06:00
Alistair Francis edafce059d skills: Open all skill data files as utf8 encoded
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> and Åke Forslund <ake.forslund@gmail.com>
2019-02-13 21:05:18 +01:00
Steve Penrod c13b40fc25 Fix path in recent locale support
The recent changes to support the 'locale' directory were incorrectly
joining the os.walk() path and filename, resulting in double-directories,
like "./vocab/en-us/./vocab/en-us/Something.voc"
2018-08-29 03:54:30 -05:00
Steve Penrod a3f1179897 Unify vocab/regex/dialog under new 'locale' directory
* Add MycroftSkill.find_resource() that locates a localization resource file
  from either under the old vocab/regex/dialog folder, or under any folder in
  the new 'locale' folder.  The locale folder unifies the three different
  folders and allows arbitrary subfolders underneath it.
* MycroftSkill.speak_dialog() will now speak the entry name if no dialog file
  is found.  Periods are replaced with spaces, so
  ```self.speak_dialog("this.is.a.test.")``` would return "this is a test" if
  no file named this.is.a.test.dialog is found.
* Remove MycroftSkills.vocab_dir value
* Minor edits to several docstrings
2018-08-27 13:28:46 +02:00
Åke 64476eb143 Replace emitter/ws with bus (#1757)
Makes the code a bit more understandable
2018-08-21 20:50:50 -05:00
Matthew D. Scholefield fc8424c9ee Make skill ids use skill folder
This is necessary because in Python 3, hash(x) changes every single start of the application. Using the skill folder makes it consistent. In addition, the skill folder makes it easier to debug parts of the application in comparison to using something like an md5sum
2018-05-10 18:52:17 -05:00
Sergio Oller 5e8d8eb1a6 Feature: Allow comments in voc and regex files
When loading voc and regex files, lines starting with "#" are now
ignored, so developers and translators can use them to document their
decisions.

==== Fixed Issues ====
2018-04-14 21:53:14 +02:00
Åke b58a533e39 Bugfix/munging related issues (#1434)
* Fix error message for enable_intent

The error was printed for each intent name mismatch instead of after all intents had been checked.

* Make sure intents aren't munged multiple times

Previously intents could be munged multiple times (This happened when enabling a disabled intent), resulting in an invalid name.

* Add test case for disable/enable intent

* Improve unmunging of messages

This make sure that only skill id's in the beginning of messages are removed and should speed up the process slightly

* Fix munging for register_vocab and register_regex

* Add testcases for register vocab and regex
2018-02-23 00:51:55 -06:00
Steve Penrod 23302b60d9 Add copyright notice and minor docstring changes 2018-02-15 09:29:04 +01:00
Åke Forslund 378d353572 Move data loading helpers to separate file.
All methods relating to loading vocabulary, dialog and regular
expressions has grown quite large. To make the core functionallity of
the skills more readable these are moved to the new module skill_data.

Additional method documentation has been addedi as well.
2018-02-15 09:28:27 +01:00