* Using detected number style to make sure queries use a . for a decimal and a , to seperate thousands
* Now using method in number styler to prepare numbers for computation.
* Allow celcisu typo, updated tests accordingly
* Store regex captures in variables
* Allow single unit inputs through guard
* Pass through single unit input to frontend
* Explcitly match guard regex, better check for valid result
* Cleanup whitespace and indentation
* Lowercase symbols that are case-insensitive
* Fix and simplify guard regex
* Better handling of named captures, ensure left unit is not only match
* Case sensitive match first, fall back to lowercase match on symbol
* fix indentation
* remove redundant m on regex match
* Removed default if duplicate.
* Add triggers to list.
* Remove smart match.
* Stash.
* Broaden triggering.
* Update test formatting.
* Revert "Update test formatting."
This reverts commit 390186743c07bffa5d57025e04926d2473a3ff2e.
Reverting because this creates big conflicts in the PR. We can address
the formatting later
* simply language trigger loading
* Add acronyms for teaspoon
* remove trailing spaces
* Add test for abbreviated teaspoon and tablespoon
* remove trailing spaces
* added custom units for angle conversions
* added triggers for angle custom units
* added front-end tests for custom angle units
* Refactoring. Categorized queries by the quantity they represent
* minor update
* added trigger for the word - microarcseconds
* replaced exponent-based values with decimal-based ones
* Updated tests to use defined units
* added the missing commas
* removed duplicate e+12 from test spec
* Fix math.js simplify issue.
* Remove debug statements.
* Adds fact to the mix.
* Stash
* Fix greedy quantifier in trig and log/ln
* Don't trigger on anything with stuff after =
* allow triggering on <func> <number>
* Both sides of =
* Fix expressions.
* Tighten up triggering based on valid expressions.
* Remove dumper obj
* Tighten up word triggering.
* Allow only one currency through.
* Kill off symbols in js if allowed through.
* Allow negative numbers.
* Add support for negated numbers.
* Fix initialize issue.
* Refactor code slightly
* Tightened regexs
* Require space between log and input
* Timer: Changed query_raw to query_lc
* also fixes#4188 (regression from ambiguous triggers)
* Updated regex and also solve issue #4188
* Added one more test case
* adding triggers
* indenting key value pairs
* using smart match
* removing liq vol for now
* shortening regex
* adding test
* removing earlier test but stil it fails
* update test
* formatting test
* Add power custom unit and some tests
* Update triggering
* Fix spec
* Add missing comma
* Amend symbols
* Fix specs
* Fix kilowatt symbol
* Use unit value from yml file
* Amend units
* adds kilonewton unit to force type
* adds remaining units
* formats the file and comma correction
* fixing the test
* fixing the test 2
* fixing the test part 3
* fixing the test part 4 perhaps the final one
* fixing the test part 4 surely the final one
* fixing the test part 4 definetly the final one
* PrimeFactors: Improve triggering
- Added check to regex guard if query matches form "is <number> prime"
- Strips all preceeding non-digit characters from remainder
Fixes#2799
* Added support for new triggers:
- 'is <number> a prime'
- 'is <number> a prime number'
- 'is <number> prime number'
* ColorPicker: Remove suffixed triggers
* ColorPicker: Handle extra words in remainder
* ColorPicker: Adds tests to check extra words in query
* ColorPicker: Add 'conversion' to remove from query
* ColorPicker: Add test for 'conversion' keyword in remainder
* ColorPicker: Simplify regex, lowercase query
* ColorPicker: Remove print statements
* ColorPicker: Improve triggering
* ColorPicker: Add tests for new triggers
* ColorPicker: Move triggers to separate file
* ColorPicker: Add more combinations of triggers as test
* Geometry Broken Hover and missing calc
* Linked hover effect for dot and SVG
* updated css
* started test file
* consolidated objectInfo YML and finished testing
* removed dumeprs
* fixed triggering and added more triggering test cases
* Implement changed design, fix#3500
* Remove comment
* Update test file to use ISO8601 dates and avoid testing of Role
* Include subtitle in the template
* Take current time using momentjs, calculate difference in JS
* Remove subtitle from the template, make corrections to endCountdown
* Pass date string to JS and find difference in moment objects, change toggling at countdown end
* Remove use of difference passed from the backend
* Update test file
* Begin deprecating perl backend.
* Deprecate backend [skip ci]
* Routine checkin of code.
* Added docs + preprocessing.
* Deprecate perl eval backend.
* Checking in some code.'
* Handle bad search expressions by defaulting to 0
* Add ability to recover with grace from bad expressions from search bar.
* Removed unnessesary perl code.
* Add support for factorials with !
* cleanup trailing spaces
* Removed trig constants.
* Support tau in expression.
* Removed ln preprocess.
* Support leading =. Removed moot code.
* Add support for euro and pound.
* Removed nat lang query parsing from js.
* strip duplicate operators
* Fixed legacy spacing issue in tests.
* Remove empty exponent.
* Bail on hex looking entries.
* better handling of repeated operators
* Remove max import
* revert back to old check for 3+ operators
* relax phone number regex for now
* remove silly test
* added html entities goodie
* fixed trigger
* added tests
* fixed review issues
fixed CSS classes, fixed file names, switched from JSON to YML
* fixed tests and file loading
* renamed to camel case
* deleted AsciiTable.pm
* changed to camel case
* Remove extra newlines
* Fix indentation for Beta server
* Use chompContent
* Simplify CSS
* Remove scrolling div
* Fix test
* Switch overflow control to .c-base__content div
* Add: Initialized ASCII Table Goodie
* Update: Fixed content options
* Update: Title added to td tags
* Update: CSS for tables
* Fix: Makes titles more verbose in template
* Update: Tests for Ascii Table added
* AsciiTable: Fix variable name to be more generic
* AsciiTable: Improved testing of IA
* AsciiTable: Chomp the table
* AsciiTable: Add meta source
* AsciiTable: Rename table_rows -> table
* AsciiTable: Use already existing CSS
* AsciiTable: Data now contains Headers
* AsciiTable: Makes template more generic
* AsciiTable: Updated tests for checking table headers
* AsciiTable: Fix required table styling
* AsciiTable: Fix tests
* Use CSS to set chomp height
* Remove table scroll div
* Switch to List template
* Update AsciiTable.t
* DateRole: Adding failing test for `$nth of $month $year`
* DateRole: Now parses "7th of march 2017"
* DateRole: Adding failing test for '5 of jan 1993' (no suffix and short month)
* DateRole: Handles 5 of march
* DateRole: Now also handle "march the 30th, 2017"
* Conversions: Unphysical units like millibits (mb) and millibytes(mB) should be assumed as mega instead
* Conversions: Now has multiple symbols (case sensitive matches) meaning that Kb and kb both mean kilobits and KB and kB both mean kilobytes :D
* Added variable for non-stribbable triggers.
* Added unstripped triggers to the trigger list
* Added tests to Timer in correspondence of the new triggers
* Removed unnecessary test, added trigger words of hrs and secs and their counterparts.
* Typo fix
* FIX FOR ISSUE #4028
-> Set triggers to only apply to start of search string so the IA isn't triggered for
programming-related searches
-> Removed triggers 'characters count', 'length of string' and 'chars'
as they are unintuitive and can clash with programming requests
-> Added 'of' as a leading word to be removed so queries such as 'length in chars of foo'
count only the characters in 'foo'
-> Updated test script to reflect these changes
* Fix#4028 - reduce overtriggering of 'Chars' goodie
-> Set triggers to only apply to start of search string so the IA isn't triggered for
programming-related searches
-> Removed triggers 'characters count', 'length of string' and 'chars'
as they are unintuitive and can clash with programming requests
-> Added 'of' as a leading word to be removed so queries such as 'length in chars of foo'
count only the characters in 'foo'
-> Updated test script to reflect these changes
* NumbersRole: Despite the role being case insensitive, the number_style_regex isn't! Adding failing test
* NumbersRole: Fixing indentation
* Conversions: Adding tests around implicit case insensitivity in current implementation
* Conversions: Moved all case insensitive behaviour into the handle query so it's explicit rather than relying on query_lc to do the work for us
* Conversions: Adding symbol definitions for case sensitive handling
* Conversions: Fixing markup
* Conversions: UTF8 with BOM on ratios and adding symbol as a trigger
* Conversions: Symbol is now used (case sensitive) to match for factors
* Conversions: The test 'BTU to KwH' should fail (this isn't a unit), however it was causing a division by zero as get_matches wasn't finding a match and this condition wasn't handled correctly
* Conversions: Typo! KwH shouldn't trigger
* Conversions: Tests involving symbols now need to be correct according to SI
* Conversions: Tests around "oz" that should be interpreted as fl oz if the answer should unambiguously be a volume
* Conversions: Will handle ambiguity around oz for more units
* Conversions: Uncommenting tests around digital storage units and fixing them so they're actually correct
* Add Timer files
* Rename Spice -> Goodie
* Move structured answer into Perl
* Update display
Now working.
I removed the 'isMobile' flag, as 'DDG.device.isMobile' was causing it
to crash, and the mobile display wasn't pretty anyway ("Add Timer" was
wrapping). Instead it will use '+' for both.
* Move time parsing into Perl
This way we can check that parsed values are correct in the tests
easily; it also gives us something sensible to return (the start time in
seconds).
* Fix issue with queries like '5s'
* Fix alarm not being located correctly
It was pointing at 'share/spice'.
* Re-enable mobile text
Fixed the issue with mobile display.
* Integrate changes from Spice #3134
Adds the changes from duckduckgo/zeroclickinfo-spice#3134.
* Integrate changes from Spice #2656
Adds the changes from duckduckgo/zeroclickinfo-spice#2656
* Update ID to 'timer_goodie'
* Ensure time from query is used as default
* NumbersRole: No tests covering exponentials
* NumbersRole: Improving test coverage
* NumbersRole: Despite the role being case insensitive, the number_style_regex isn't! Adding failing test
* NumbersRole: number_style_regex now case insensitive
* NumbersRole: Fixing indentation
* Conversions: User feedback has indicated a preference for 3 sig figs for small(ish) results: #3984
* Conversions: Introducing the ability to have significant figures rather than decimal places for numbers <1
* Conversions: The reality is users want to see decimal places for 'normal numbers' (1,765.432 for example) but sig figs for something around 1 so that fractions can be expressed (0.0625 for example)
* Conversions: Bringing tests inline with 3 SF for results < 1; this is more aesthetically pleasing in my opinion
* ParcelForce: Should not trigger for non-UK parcels
* ParcelForce: Starting with KB clashes with Microsoft KB Articles; AFAIK this isn't a valid parcelforce tracking number anyway
* ParcelForce: Working around #3986
* Conversions: The precision (i.e. number of digits after a .) and the significant digits displayed in scientific notation were the same value; there are a few issues with people requesting more accuracy in scientific notation, and none for accuracy
* Conversions: Increasing accuracy of values in tests in-line with new significant figures output
* Conversions: Adding lightyear and lightyears as accepted variants of "light year"
* POTUS: Adding failing test for overtrigger
* POTUS: the previous || $prez_count meant that it defaulted to the current president if it didn't recognise the number; hence why it was showing so many false positives
* POTUS: Now with stricter handling on the $num we can trust the validation later on to keep us safe from overtriggering
* POTUS: basic queries that really should work!
* POTUS: Switching to using a guard regex to match things rather than using replacements
* POTUS: Guard regex now protects the query space. and "was" is used to imply the previous president (currently obama)
* POTUS: switched to query_lc and implementing both a guard regex and a replacement for the triggers so that the code below behaves as if it is remainder =>, except that this doesn't erroneously replace "president-elect of the us" with ""
* POTUS: We don't need $rem
* prevent anything but allowed ops in the query
no negative nums
* Uncomment neg catch and move after garbage is removed
* Add more tests
* The hex check can be simplified since the trigger isn't allowing most of it
Allow expressions like 1e9 to pass
* Allow = in query
decimal/negatives with e
* Remove debug
* add test for 1e9 query
* Restrict some other stuff
* Don't require digit
* Restrict multiple ops to two or less
* reject empty parens/multiple ops
* No @, or $ not followed by a number or .
* combine char class
* add more negative tests
* Add ops back, case-insensitive subs, require two ops again
* Case-insensitive on multiple ops too
* Allow leading negatives
* Move the leading neg sub
* Better regex for hex input
* update tests
* Update trigger
Use Safe for evaluation with the minimum functions
Removed unnecessary capturing, redundant function calls
* Add some tests
* Remove eval since we don't allow die
Add comment about debugging failed reval
* Add rv2gv from :base_orig to allow compat with Safe 2.35
Remove prtf since that was in :base_orig which was removed
* Remove unneeded opsets
* Silence all of reval's warnings
* Add STRICT
* Conversions: Failing test for n'm" format
* Conversions: Adding a totally specific workaround for 3 feet 5 inches or 6'1" queries
* Conversions: Accuracy correct relative to output
* Conversions: Improving test coverage around whitespace
* Conversions: Removing duplication
* Conversions: Handling foot and inch
* Conversions: Adding tests for feet and inches into another unit and failing test for the UK common "n foot m", commonly used for height
* Conversions: Implemeting the UK common 6 foot 1 query support