Commit Graph

351 Commits (73e49949b086378df815d4b6a54614cd347961ba)

Author SHA1 Message Date
Åke Forslund caf834c728 Add plugin utils 2020-09-23 07:46:09 +02:00
Åke Forslund fc3d8ce801 Add MontonicEvent class
This handles jumps forward in time correctly
2020-09-10 13:26:25 +02:00
Kris Gesling 05e96935d4
Merge pull request #2673 from MycroftAI/remove/speaking-utils
remove deprecated speaking utils
2020-08-21 00:32:35 +00:00
Kris Gesling b444d00ccf remove previously deprecated speaking utils 2020-08-18 23:31:07 +09:30
Kris Gesling 666178c483 remove unnecessary remove_last_slash method 2020-08-18 23:06:42 +09:30
Kris Gesling ed46311cd8 remove unnecessary get_http method 2020-08-18 23:04:53 +09:30
Åke Forslund 2dde23467c Let lingua franca check extract_duration lang
Mycroft doesn't need to check for supported languages for
extract_duration, lingua_franca handles that internally.
2020-08-07 07:47:11 +02:00
Åke Forslund 1258480f30 Improve audio utils log 2020-04-27 08:38:44 +02:00
Åke Forslund 707be52f21 Update time util docstrings 2020-04-17 23:42:04 +02:00
Åke Forslund 313aaa660d Improve documentation of download util 2020-04-17 23:42:04 +02:00
Åke Forslund c5dccc16e2 Improve getting tmp download path 2020-04-17 23:42:04 +02:00
Åke Forslund 3a908a1e35 Minor cleanup of download docstrings and imports 2020-04-17 23:42:04 +02:00
Åke Forslund 06157e3331 Reuse ensure_directory_exists() in create_file()
ensure_directory_exists() now takes the directory permissions as an
optional argument.
2020-04-17 23:42:04 +02:00
Åke Forslund 26ef052891 Minor cleanups
- Remove superfluous parentheses
- Remove unneccessary pass
2020-04-17 23:42:04 +02:00
Åke Forslund aa42552d97 Refactor test change loglevel and add tests for process_utils 2020-04-17 23:42:04 +02:00
Åke Forslund b0be6a7ff9 Correct some docstrings 2020-04-17 23:42:04 +02:00
Åke Forslund 82e350064c Simplify and clean up curate_cache
- create helper functions for getting file stats and removing files in
order of age
- create wrapper function for turning MB into bytes
2020-04-17 23:42:04 +02:00
Åke Forslund e3f4d22b7e Simplify record function 2020-04-17 23:42:04 +02:00
Åke Forslund cf40c2e36c Refactor play_* functions to use a common base
Adds comments for PULSE ENVIRONMENT
2020-04-17 23:42:11 +02:00
Åke Forslund 60c0af69d6 Replace read_stripped_lines with generator 2020-04-17 23:42:04 +02:00
Åke Forslund a0709c885c Mark redunant string_utils as to be removed 2020-04-17 23:42:04 +02:00
Åke Forslund 71683d18d4 Refactor util library.
Move utils away from the __init__.py file
2020-04-17 23:42:04 +02:00
Åke Forslund 7e88ae7e88 Correct the datdir/res path
Comment says the folder to be checked should be datadir/res, this makes
the code mean the same thing.
2020-04-17 23:42:04 +02:00
Åke Forslund b991453bcf Update docstrings of mycroft/util/__init__.py 2020-04-17 23:42:04 +02:00
Åke Forslund c8be703e49 Additional zero was prepended.
The formatting of small numbers was fixed in lingua franca
2020-03-26 18:43:19 +01:00
Åke Forslund 968370cbf1 Remove exec permission from format files
mycroft/util/format.py and test/unittests/util/test_format.py
2020-02-13 07:59:16 +01:00
Åke Forslund 9245f551f4 Remove backwards compat. imports from lang tools
This removes the whole mycroft.util.lang submodule replacing it with a
minimum needed set of functions

extract_datetime: when a date was missing en-us would return the current date
to not mess up existing skills. This is no longer the case, if an
utterance doesn't contain a date the function will return None as
indicated by the docstring
2020-02-12 09:27:50 +01:00
Åke Forslund 9c8c8e0144 Send time reference for "now" to Lingua-franca
This will provide timezone info as well as now reference to the
extracted sentences.
2020-01-29 15:33:28 +01:00
Åke Forslund 37caf7837d Remove logic from format.py and parse.py
The functions are still there providing the docstrings but calling the
lingua_franca functions.

Note, there is a INTENTIONAL addition of an inconsistence. Making the
extract_datetime return todays date instead of None as is documented.
This needs to be removed as soon as the mycroft default skills have been
added.
2020-01-18 08:58:23 +01:00
Åke Forslund 1b5b4f3d84 Add wrapper for extract_datetime 2020-01-18 08:58:23 +01:00
Åke Forslund 2cc90f3f9f Remove functions from format.py and parse.py 2020-01-18 08:58:23 +01:00
Åke Forslund 32666e9d68 Remove content from lang specific files
The files are kept for backwards compatibility but these just contains imports
of lingua-franca versions of variables
2020-01-18 08:58:23 +01:00
Åke Forslund 1b88db4fa1 Replace format and parse calls with lingua-franca 2020-01-18 08:58:23 +01:00
ChanceNCounter 4e8db9c860 clean up nice_duration handler
* Replace integer values with enum values for clarity
* Simplify exception thrown on incompatible input
* Pythonify (and de-Chanceify) zero-output logic
2019-12-17 05:10:34 -08:00
ChanceNCounter 5eb6b51eb2 Fix extractnumber_en failure on "%" (#2110)
Closes MycroftAI/mycroft-core#2110
2019-12-05 14:19:37 -08:00
Åke e7d9e8be1b
Merge pull request #2402 from maxbachmann/cleanup
Improve speed of pronounce_number_en
2019-11-29 17:07:59 +01:00
maxbachmann 4174689906 improve runtime 2019-11-29 16:56:36 +01:00
Åke e6385720b3
Merge pull request #2396 from maxbachmann/python2cleanup
cleanup python2 unicode
2019-11-27 08:46:20 +01:00
Åke e78a9730e1
Merge pull request #2386 from maxbachmann/dev
Add more time idioms (half past, etc.)
2019-11-27 08:41:02 +01:00
maxbachmann 87220ee85c add some more time idioms 2019-11-27 01:53:23 +01:00
maxbachmann 7a48297132 cleanup python2 unicode 2019-11-26 23:09:32 +01:00
Christian Clauss a1ff3fb355 Upgrade from pycodestyle to flake8 2019-11-19 23:07:52 +01:00
Mike Woudenberg cc5631c45f Adds rudimentary Dutch parsing support 2019-11-14 08:47:36 +01:00
Steve Penrod 0b8f7f54a4 Remove unnecessary code
The check for "this" performed in the case of "this quarter of an hour"
was copy/pasted in a large checkin.  The change it made to
daySpecified made no difference since the or in the later code
looked for an unspecified absolute hour.  I can come up with no
senseable phrase that matches the conditions and couldn't even
create a nonsensical phrase that made a difference.

Since all of the existing unit tests pass without this code,
I'm going to just remove it.
2019-11-04 09:39:09 +01:00
Åke 324fe988aa
Merge pull request #2356 from ChanceNCounter/spanish-language-parsers
fix bug in isFractional_es and improve coverage
2019-10-14 16:04:57 +02:00
Åke 8126bcafce
Merge pull request #2346 from ChanceNCounter/tests/util-parse-en
fix bug, redundancy in parse_en; improve coverage
2019-10-07 13:22:23 +02:00
ChanceNCounter 1c41e523ce fix bug in isFractional_es and improve coverage
- Fix: isFractional_es() parsed fractions incorrectly
- Update: earlier commit msg suggested another fix:
  - Month parsing not fixed
  - Several failing tests (skipped) document problem
  - TODO and an issue also created
- Substantially improve parse_es.py test coverage
- TODO or comment several found bugs
  - Many lines remain uncovered, incl possible bugs
2019-10-05 14:46:09 -07:00
Åke 8ffad68251
Merge pull request #2347 from ChanceNCounter/extractnumber-es-fix-and-add-extractnumbers
Fix extractnumber_es, add extract_numbers_es
2019-10-04 08:46:03 +02:00
Åke 90ceaa3c88
Merge pull request #2342 from ChanceNCounter/fix/convert-mixed-fraction-param-default
add default value to nice_number param
2019-10-04 08:43:15 +02:00
ChanceNCounter 1107f5d6cc Fix extractnumber_es, add extract_numbers_es
- Fix bug causing extractnumber_es to return a sum instead of a list
- Add Spanish parser to extract_numbers and extract_number

==== Fixed Issues ====
Closes #2310

====  Tech Notes ====
Further obscures #2056: short_scale and ordinals parameters added to the
Spanish parsers, but they don't do anything. Present for compat only.
There is a TODO for this.

==== Localization Notes ====
It's all Spanish stuff!

This will require a native Spanish speaker to analyze the relationship
between extractnumber and isFractional, and determine why certain
fractions do not parse correctly. There is a TODO for this.
2019-10-03 17:11:39 -07:00