Commit Graph

285 Commits (acbb0f0dc25c523f3ea287c8051398012a5876b3)

Author SHA1 Message Date
Chris Rogers 95aca10294 Fix _extract_decimal
Actually use the short_scale and ordinals values.
2019-02-01 18:57:28 -05:00
Chris Rogers 2ce632389f Fix and simplfy extract_numbers_en
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.
2019-02-01 18:51:03 -05:00
Chris Rogers 6645ab6bfe Add short_scale and ordinal args to helpers.
This is in support of issues-1959.
2019-02-01 18:28:40 -05:00
Chris Rogers 5c74789c2d Lower text before parsing.
This is in support of issues-1959.
2019-02-01 18:21:13 -05:00
Chris Rogers 23edb9eb00 Fix decimal/fraction parsing with leading numbers.
"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.
2019-02-01 17:39:01 -05:00
Steve Penrod df4f6ca6dd Fix typo and add --list option
The -l / --list option will now display the name and index of all available input devices.
2019-01-31 08:19:21 +01:00
Chris Rogers a3e94bcbc6 Add numbers, e.g. '20', '30' to sums
This is in support of issues-1959.
2019-01-30 22:53:22 -05:00
Chris Rogers 4732feab41 Fix indicies and substitution logic.
Placeholders are inserted into the text to maintain accurate
indicie relative to the original string.

This is in support of issues-1959.
2019-01-30 22:06:02 -05:00
Chris Rogers 49274493d9 Update convert_words_to_numbers logic.
The logic has been updated for start/end indexs.

This is in support of issues-1959.
2019-01-30 21:18:48 -05:00
Chris Rogers 03a445991c Fix multiplies and extract_numbers_with_text
A small bug caused things like "two hundred twenty" to return only the
"hundred tenty" for the text. This has been fixed.

extract_numbers_with_text was updated to deal with the new return types
of the functions it depends on. Specifically, it accounts for the start
and end index values.

This is in support of issues-1959.
2019-01-30 18:24:18 -05:00
Chris Rogers 71836b61ec Fix decimal and fraction parsing.
This updates the _extract_fraction and _extract_decimal functions to
handle the new token format.
2019-01-30 18:03:25 -05:00
Chris Rogers 48214ca66a Introduce tokens for number parsing.
Replace use of tuples with a dedicated class. This improves clarity by
giving named accessors.

This is in support of issues-1959.
2019-01-30 16:48:59 -05:00
Chris Rogers 9db9b6107b Change approach to number/text replacment.
Previously it was assumed that the orgiginal text would be enough to
determine where in a string a number should go, however, in some
scenarios, that does not work, and results in the wrong values being
parsed.

A different, and smarter approach is being taken now, in which the
original string is initially split into a list of tuples of
(index, word) where index is the index of the word within the string.
All subsequent processing is done on these tuples, meaning we always
know exactly where the words were in the orginal string. This should
make text replacement perfect, as we can always sub out the exact,
correct words, based on their indicies.

extract_number_with_text_en now returns the number parsed, the text that
represents the number, the start index, and the end index.

Things are not yet working perfectly. Here is roughly the current state
of the world:

from mycroft.util.lang.parse_en import *
extract_number_with_text_en("this is some two hundred thousand twenty
two hours")
Out[3]: (200022, 'hundred thousand twenty two', 4, 7)
extract_number_with_text_en("this is some twenty two hours")
Out[4]: (22, 'twenty two', 3, 4)
extract_number_with_text_en("this is some twenty hours")
Out[5]: (20, 'twenty', 3, 3)
extract_number_with_text_en("this is some two and a half hours")
Out[6]: (2, 'two', 3, 3)
extract_number_with_text_en("this is some two point five hours")
Out[7]: (2, 'two', 3, 3)

The list of tuples is a bit of a hassle to deal with. In a future
commite the will be replaced with dictionaries, or even better, Token
objects, that contain the word and it's index. This would make the
code easier to reason about (removing lots things like words[0][1]
which has no meaning without deep understanding of the code).

This is in support of issues-1959.
2019-01-29 22:33:23 -05:00
Chris Rogers 8a5bf49651 Handle lists of summation numbers.
Phrases like "twenty thirty forty" would return
(40, "twenty thrity forty"). This changes that so
(40 "forty") is returned.
2019-01-29 21:25:06 -05:00
Chris Rogers 690df0b1d3 Update entract_numbers_en to use the new functions.
This is in support of issues-1959.
2019-01-29 20:57:16 -05:00
Chris Rogers f4723b1026 Cleanup parse_en.
Rename some functions, and fix docs/pep8 issues.
2019-01-29 20:50:13 -05:00
Chris Rogers 9aa02587b3 Fix an issue with extractnumber_en_with_text
Articles (a, an, the) that appeared immediately before the number were
included in the returned text. This fixes those issues.

The solution isn't super clean - it craetes a new function to wrap the
old one (unavoidable, since the articles can be needed for fractions),
and splits the returned string, the strips leading artivles.

Since strings are immutable, this is probably not super efficient. Might
be better to eventually use lists as much as possible, and only create a
string at the end (though the lists will come with their own problems,
so that could turn out to be a wash). In any case, this works for now.
2019-01-29 20:25:38 -05:00
Chris Rogers 0b8e88a325 Fix docs for _initialize_number_data.
This is in support of issues-1959.
2019-01-29 20:03:41 -05:00
Chris Rogers 9ff7fd5452 Fix issues with extractnumber_en_with_text
Issues fixed:
Lists, e.g. "some words one two three" would return (3, "one two three")
Negaitve words were not included in output, e.g. "negative five" would
return (-5, "five").

This is in support of issues-1959.
2019-01-29 19:53:30 -05:00
Chris Rogers b5ffbcc549 Fix edgecase in extractnumber_en_with_text
Any articles (a, an, the) appearing before the number would be included
in the text, e.g. "set a timer for eight minutes" returned:
(8, 'a eight')

This fix clears the number words list if no number words have been
found. Note that articles can't simple be filtered, as they are
often a part of the numebr (e.g. three and a half).

This is in support of issues-1959.
2019-01-28 17:28:27 -05:00
Chris Rogers 12e5fd603a Implement methods useful for extract_duration
Methods implemented include:

extract_number_with_text
extract_numbers_with_text
convert_words_to_numbers
extract_duration

This is in support of issues-1959. This continues the work of
returning the relevant text that corresponds to a number
parsed from a string.
2019-01-28 17:04:12 -05:00
Chris Rogers 5252e710b5 Prevent the conversion of ints to floats>
This is in support of issues-1959. This continues the work of
returning the relevant text that corresponds to a number
parsed from a string.
2019-01-26 18:06:11 -05:00
Chris Rogers 05046c7390 Add ordinal and fraction support.
This is in support of issues-1959. This continues the work of returning
the relevant text that corresponds to a number parsed from a string.
2019-01-26 17:39:56 -05:00
Chris Rogers 49c344c1d7 Return correct text for decimals and fractions
This is in support of issues-1959. This continues the work of returning
the relevant text that corresponds to a number parsed from a string.
2019-01-26 14:36:01 -05:00
Chris Rogers 5a3d809e68 Begin returning text with parsed numbers
This is in support of issues-1959. This begins the work of returning the
relevant text that corresponds to a number parsed from a string. Here's
a sample showing the basic functionality/state of the world (showing
some of the remaining cases to handle)

>>> from mycroft.util.lang.parse_en import *
>>> extractnumber_en_with_text("three hours twenty minutes")
(3, 'three')
>>> extractnumber_en_with_text("twenty minutes")
(20, 'twenty')
>>> extractnumber_en_with_text("twenty five minutes")
(25, 'twenty five')
>>> extractnumber_en_with_text("two hundred twenty five minutes")
(225, 'two hundred twenty five')
>>> extractnumber_en_with_text("three and a half minutes")
(3.5, 'three and a half minutes')
>>> extractnumber_en_with_text("three point five minutes")
(3.5, 'three point five minutes')

====  Tech Notes ====
Checks if the word being parsed is relevant to number parsing. If it is
not, and we have already found number words, we return what we have. If
it is, we add it to a list of words representing the current number
being parsed.

====  Documentation Notes ====
The old implementation of extractnumber_en seems to generally return the
last number in the text. This change will cause the first number to be
returned.
2019-01-26 14:26:00 -05:00
Chris Rogers 6d9447128b Cleanup unnecessary comments/improve docs.
This is part of a refactor of extractnumber_en, with the ultimate
goal of making it easier to maintain and extend (should also
improve perf).  This is in support of issues-1959.
2019-01-25 21:06:29 -05:00
Chris Rogers 8d588743d0 Extract fraction and decimal methods.
This is part of a refactor of extractnumber_en, with the ultimate
goal of making it easier to maintain and extend (should also
improve perf).  This is in support of issues-1959.

All tests (minus extract_duration, which has not yet been implemented)
are passing at this stage.
2019-01-25 21:02:34 -05:00
Chris Rogers 1a176da6b6 Deal with scale numbers and plurarls appropriately.
This is part of a refactor of extractnumber_en, with the ultimate
goal of making it easier to maintain and extend (should also
improve perf).  This is in support of issues-1959.

All tests (minus extract_duration, which has not yet been implemented)
are passing at this stage.
2019-01-25 20:44:59 -05:00
Åke Forslund 8693b71c0e Add some additional info to audiotest
Audiotest now prints the device and samplerate used as well as the commandline used to playback the audio for easier debugging if things doesn't work as intended.
2019-01-25 14:12:10 +01:00
Chris Rogers a6aaaa365a Extract ordinals from extractnumber_en
This is part of a refactor of extractnumber_en, with the ultimate goal
of making it easier to maintain and extend (should also improve perf).
This is in support of issues-1959.
2019-01-23 22:04:02 -05:00
Chris Rogers 8f03f18219 Refactor extractnumber_en - extract constants
Begins a refactor of extractnumber_en, with the ultimate goal of making
it easier to maintain and extend (should also improve perf). This is
in support of issues-1959.
2019-01-23 21:36:56 -05:00
Chris Rogers 3a9f11c67e Add extract_duration skeleton 2019-01-23 18:25:22 -05:00
Chris Rogers 644d75cfc9 Issues-1962 - Revert changes to normalize_en 2019-01-21 18:37:04 -05:00
G3RB3N 876b5393f7 Dev add nl nl (#1906)
* Added nl-nl voc, dialogs and formatter
2019-01-16 13:48:41 +01:00
Åke 4e10339f55
Merge pull request #1912 from aleale99/dev
Updated:
- nice_date()
- pronounce_number()
2019-01-12 13:07:19 +01:00
Åke Forslund 38701a9790 Remove inheritance from object
Inheriting from object isn't necessary in python3.
2019-01-11 09:24:21 +01:00
Åke Forslund ff04af99c9 Move the device finding code into an util function 2019-01-08 08:05:07 +01:00
Ale 8f0e6787f3
Update parse_it.py
correct import
2019-01-05 09:58:21 +01:00
Ale 4270fd4528
Update parse_it.py
imported too early, the functions that use them are not yet ready
2019-01-04 18:39:54 +01:00
Åke c92f92de4f Bugfix/mimic2 negative numbers (#1927)
* Fix mimic2 negative numbers

Make the regex extracting numbers also match negative numbers when preparsing phrases sent to the mimic2 service

* Update pronounce_number to use "minus" for negatives

After discussion in the chat it was suggested to use "minus" for negatives as default.

When scientific notation is used the term "negative " is still used.
2019-01-02 16:36:04 -06:00
Ale a6eff4c750
cleanup 2018-12-31 16:56:54 +01:00
Ale 3d3bccb3bb
Update parse_it.py isFractional_it with
with short_scale =False
2018-12-31 16:45:06 +01:00
Ale f8515fdf79
Update format_it
italian use short_scale=False
2018-12-31 16:34:17 +01:00
Åke 33c735a935 Handle floats when checking year pronounciation (#1916)
* Handle floats when checking year pronounciation

* Corrected typo in docstring
2018-12-27 11:39:44 -06:00
Ale 4b9c410dd4
Update format.py
update pronounce_number_it() to long/short scale and scientific format
2018-12-22 11:13:45 +01:00
Ale 5933d3b6d2
Update format_it.py
update pronounce_number_it() to long/short scale and scientific format
correct some unusuals numbers in  LONG_SCALE_IT
2018-12-22 11:10:34 +01:00
Ale 59a8770eaf
pep8 update format_it.py
just a space
2018-12-19 14:54:04 +01:00
Ale eff7c7e10c
minor update format_it.py
insert  LONG_SCALE_IT  and SHORT_SCALE_IT
2018-12-19 14:37:25 +01:00
Åke Forslund 178319aa68 Handle invalid json when loading log level
Just ignore invalid log files
2018-12-05 22:32:23 +01:00
danielwine 7ec96b0d07 Add format_hu and update format.py along with tests 2018-12-04 15:09:20 +01:00
Kris Gesling 32a3860bce Issue-1877 - fix ordinal followed by one
"Third one" will now return the expected 3 instead of 1.
2018-11-26 09:25:44 +01:00
JarbasAI 60d2905678 feature/extract multiple numbers from text (#1867)
Add extract_numbers() function

The function extracts all numbers from the input string and returns them as a list.
2018-11-19 12:39:59 +01:00
jarbasal fa2b3007a9 improve datetime parsing with long times and a couple
add support for decades, centuries, millemniums
add support for "within the hour", "in a second/minute",
add support for "a couple time_unit" and "a couple of time_unit"
2018-11-17 09:03:41 +01:00
Åke Forslund a67a60a8eb Remove bare except 2018-11-16 12:14:09 +01:00
Åke Forslund 986e70ec9b Add docstrings for play_* methods 2018-11-16 12:03:42 +01:00
jarbasal d9a905c8b1 extract date time improvements 2018-11-07 04:14:21 +00:00
Åke d1298744f1
Merge pull request #1831 from silvia-odwyer/language-error-checking
Language error checking
2018-10-09 17:30:41 +02:00
Åke Forslund 3682391960 Fix final pep8 issues 2018-10-09 16:36:15 +02:00
Silvia O'Dwyer 45eadaab49 Warnings for unsupported languages are now logged. 2018-10-09 16:15:57 +02:00
Åke 4f84ff6a62
Merge pull request #1841 from nielstron/feature/issue-1718
Pronounce large numbers, Bugfix/ issue #1718
2018-10-09 15:57:03 +02:00
Niels Mündler 1b16b4dbaf Include problematic input from #1718 as test
Fix trillion being saved with wrong number (10e10 instead of 10e12)

==== Fixed Issues ====
1718

====  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.
2018-10-09 13:18:13 +02:00
Åke Forslund 260f54a386 Move config location definitions to separate file 2018-10-09 11:38:10 +02:00
jarbasal f262bd6f77 Read log level from both user and system config
Resolves issue #1728
2018-10-09 11:37:56 +02:00
Niels Mündler 7c9ae548da Fix pronouncing of fairly large numbers and simplify terms
==== Fixed Issues ====

====  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.
2018-10-09 01:12:03 +02:00
Niels Mündler a01f11f30a Fix large numbers in short and long scale, include tests 2018-10-09 00:08:14 +02:00
Niels Mündler 0f8c6d118d Simplify script, remove redundancies 2018-10-08 23:43:51 +02:00
Åke 9f4a3c264d Make the combo lock handle multiple users (#1828)
* Make the combo lock handle multiple users

On the Mark-1 the locking would fail since the first time the lock is
accessed the process is run under root (script checking the enclosure
version). This caused the locking to fail since the normal mycroft
processes got an access error (lock-file owned by root)

This change creates lock-files and sets the permissions to 0o777
if the file doesn't exist so it's accessible for all users

Also added an Apache license header
2018-10-01 14:42:21 -05:00
Steve Penrod edb126ca44 Fixed typo and updated comments on schedule_event 2018-10-01 12:29:28 +02:00
Steve Penrod 1694fb716b Fix date format for today/tomorrow/yesterday
The test for today/tomorrow/yesterday was only looking at the day,
not the month and year.  So on July 14, 2018 it would claim that
the date June 14 2018 and July 14 2020 are all "today".

Now the full date is used in the comparison
2018-10-01 12:28:50 +02:00
Åke 506d7ed843 Add locking when accessing the IdentityManager (#1801)
Adds the mycroft.util.combo_lock ComboLock class for interprocess/Thread
lock.

Loading updated to be more reliable:
- Flush and sync file
- wait 1.2 seconds before load

Split the logic from the locking so the lock can be avoided when calling
update from save or load from get.
2018-09-28 01:26:33 -05:00
Steve Penrod 04745c9c40
Fix now_utc() to return aware datetime
The mycroft.util.time.now_utc() was returning a naive datetime object, potentially causing
issues in skills running on instances that aren't using UTC system-wide.  This didn't impact
Picroft or Mark 1, but Github installs would experience issues with skills such as the Alarm.
2018-09-26 12:04:32 -05:00
Steve Penrod 3c94435f0e Extract_datetime cleanup
Cleaned up a few things noticed during review of Spanish extract_datetime_es() implementation.
2018-09-24 15:59:28 -05:00
Angel Docampo f2c033f1f7 added functions for the spanish parser (#1571)
Added functions for the spanish parser

* Added spanish function calls in parser.py for extractnumber_es
and extract_datetime_es
* Added spanish functions in util/paser_es.py for extractnumber_es
extract_datetime_es and added some missing numbers

Merged in changes from #1804
2018-09-24 05:06:29 -05:00
Åke 25ccc3bed7 Feature/extract datetime update (#1804)
* Fix ambiguous time handling
  In certain cases the ambiguous time handling skipped a day forward. This updates the logic to handle a bit better.
* Adds a test for the ambiguous time
* Remove references to timeStr
   timeStr was never set and the logic that used it would never activate.
* Remove rename of currentDate
* Add extract_datetime parameter default_time
   If a time is not found in the input string the time will be set from the
   datetime/time object passed in as the default_time argument. If None the
   time will be Midnight as previously.
2018-09-24 03:08:39 -05:00
Åke 9bad550c26 Make audiotest wait until playback is complete (#1785)
To reduce unneccessary Output the log level is reduced and the ALSA lib
output is muted unless the --verbose is used.
2018-09-09 01:56:57 -05:00
Åke Forslund 1e27cff708 Fix exception in exception handler
The exception handler in pronounce_number_en would in turn raise an
exception. This fixes that case.
2018-08-30 00:06:19 +02: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 Forslund b7e1cb835c Fix broken test
- update test_parse*
- correct the reference in mycroft.util
2018-08-21 11:57:12 +02:00
Steve Penrod 51b60398a3 Remove deprecated extractnumber
Removing the deprecated mycroft.util.parse.extractnumber(), use extract_number() instead.
2018-08-21 04:06:34 -05:00
Michael Nguyen 7b69fb8d46 better pronounciation for 4 digit numbers 2018-08-15 00:31:34 -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
Michael Nguyen 7b54149bcd
Merge pull request #1653 from JarbasAl/feature/pronounce_scientific
Feature/pronounce scientific
2018-07-31 13:04:14 -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
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 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
Å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
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
JarbasAI 6cf2ed814c feature/allow to pronounce ordinals and very small fractions (#1663)
* allow to pronounce ordinals

* cleanup

* long scale / short scale very small fractions
2018-07-10 02:54:04 -05:00
Åke 1093383443 Fix extraction of 0 in extract_number() (#1673)
0 was not detected as a valid number when checking if the function should proceed to check for fractions.
2018-07-10 02:26:25 -05:00
Åke 622748d7d3 Bugfix/parse corrections (#1670)
* Restore extractdatetime to return False

- Restore extractdatetime to return False if no time was found
- Add tests to make sure this is true
- Add a extract_datetime function to keep coherency with the rest of the functions. (the old extractdatetime still exists for compatibility)
- Update documentation to match

* Minor corrections to docstrings.
2018-07-02 02:44:28 -05:00
JarbasAI fa4173a2d3 fix extract date (#1651)
* Fix errors when spaces are missing "3pm" "5seconds"
* Fix relative times "in 15 minutes" is now from current time not from midnight

Resolves #1650
2018-06-26 11:45:39 +02:00
Carsten Agerskov 5994644085 Feature/nice date (#1635)
* Added nice_date, nice_date_time, nice_year
2018-06-25 17:43:24 +02:00
jarbasal 57a86a7fe6 pep8 2018-06-22 01:03:32 +01:00
jarbasal 1710803bb0 pronounce scientific notation 2018-06-22 01:03:32 +01:00
jarbasal 2f05b0b820 fix extra zero 2018-06-22 01:01:59 +01:00
jarbasal 8637236490 codacy 2018-06-21 19:15:11 +01:00