Commit Graph

3851 Commits (34286dbecdb339569d8e80c568dba31bfe9e3bc7)

Author SHA1 Message Date
Ben Moon 1171aa6488 Improve formatting 2016-02-14 15:01:54 +00:00
Ben Moon d80a31b1b0 Move additional triggers to triggers file
And reduce some code as per these changes.
2016-02-14 15:01:54 +00:00
Ben Moon fa72a01fcd Move standard triggers into JSON file 2016-02-14 15:01:54 +00:00
Ben Moon 65ed06f4ed Improve death message on duplicate aliases 2016-02-14 15:01:54 +00:00
Ben Moon d67c679fee Clean up options setter 2016-02-14 15:01:53 +00:00
Ben Moon c6a2f3b069 Remove List::Util dependency 2016-02-14 15:01:53 +00:00
Ben Moon ccc1ef35cc Remove redundant 'cheat_names_equal' sub 2016-02-14 15:01:53 +00:00
Ben Moon 67d059e25d Clean up 'add_triggers' sub 2016-02-14 15:01:53 +00:00
Ben Moon e2534309e7 Remove List::MoreUtils dependency 2016-02-14 15:01:53 +00:00
Ben Moon c43a750f61 Fix issue with undefined triggers 2016-02-14 15:01:53 +00:00
Ben Moon ea5836c04e Move triggers into separate json file 2016-02-14 15:01:53 +00:00
Ben Moon a79d4674af Add additional triggers for 'code'
'syntax', 'methods', and 'functions'.
2016-02-14 15:01:53 +00:00
Ben Moon 6544491be5 Improve name collision detection 2016-02-14 15:01:53 +00:00
Ben Moon 31fe740300 Remove alias warning from main Goodie
Don't need to duplicate the warning with the tests.
2016-02-14 15:01:53 +00:00
Ben Moon f04b3d3dc5 Assume name required for triggers by default 2016-02-14 15:01:53 +00:00
Ben Moon 354fd1561a Allow non-array triggers
More in-line with the actual trigger system
2016-02-14 15:01:53 +00:00
Ben Moon 6eb7cd33b8 Demote alias of file name to warning
I think there will be times when having this duplication will be
necessary, such as when the file name keeps changing!
2016-02-14 15:01:53 +00:00
Ben Moon 4fae8f769b Add 'math' category
For equations.
2016-02-14 15:01:53 +00:00
Ben Moon 24284a6a8d Improve formatting 2016-02-14 15:01:53 +00:00
Rob Emery 164b68861e ABC: adding html_enc to output for the encoding bug 2016-02-13 20:23:31 +00:00
Rob Emery d3363049f1 ABC: Switching to text template 2016-02-13 20:23:31 +00:00
Rob Emery 82c5172034 ABC: Switching to text template 2016-02-13 20:22:24 +00:00
Rob Emery 69c8c725c6 ABC: adding html_enc to output for the encoding bug 2016-02-13 20:20:08 +00:00
Rob Emery a1be284d44 ABC: Switching to text template 2016-02-13 20:20:07 +00:00
Rob Emery adb153ef0f ABC: Switching to text template 2016-02-13 20:20:07 +00:00
Zach Thompson de13ae2746 Remove Ascii which has been replaced by Bin2Unicode 2016-02-12 11:54:20 -07:00
Zaahir Moolla 67972ea88a Merge pull request #2272 from Mailkov/warningunixtime
UnixTime - Fixes  Use of uninitialized value $+{"trigger"}
2016-02-12 12:59:11 -05:00
Mailkov d426d03b64 fix use of initialized value 2016-02-12 16:27:46 +00:00
Ben Moon 1361fef76b Encode title
Using html_enc for title too.
2016-02-12 15:00:11 +00:00
Ben Moon b905d90634 Remove imperative trigger
Should not trigger on 'piglatin X'.
2016-02-12 14:51:27 +00:00
Ben Moon 34e241c9e6 Improve clarity of 'use_paragraphs' attribute
Make it clearer that it is a boolean value by using just 1 and 0.
2016-02-12 14:19:13 +00:00
ilv 32b5c23929 Merge branch 'master' of https://github.com/duckduckgo/zeroclickinfo-goodies into fix_latex_sum 2016-02-12 13:14:47 +00:00
Zaahir Moolla 103d9dc389 Merge pull request #1985 from Mailkov/teredoissue1163
Issue #1163 - Convert Teredo to use templates
2016-02-12 00:26:17 -05:00
Zaahir Moolla ffcc97f303 Merge pull request #2045 from duckduckgo/zt/bin2unicode
Binary to unicode converter
2016-02-12 00:20:04 -05:00
ilv 9dc03e6c46 Added missing underscore in Latex sum example 2016-02-12 05:14:03 +00:00
Zaahir Moolla 2482acc0e8 Switch tabs to spaces 2016-02-11 23:57:45 -05:00
Zaahir Moolla 2230788ab9 Merge pull request #1963 from cngarrison/minecraft-triggering
Minecraft: Fixes #1949
2016-02-11 23:56:15 -05:00
Zaahir Moolla c9319840d6 Merge pull request #1990 from Mailkov/reverseresistorcoloursissue1163
Issue #1163 - Convert ReverseResistorColours to use templates
2016-02-11 23:28:18 -05:00
Zaahir Moolla 00dbfe9963 Merge pull request #2267 from duckduckgo/pr/1017
Continue #1017
2016-02-11 19:00:49 -05:00
Zaahir Moolla 882957cea2 Remove comments 2016-02-11 18:46:03 -05:00
Zaahir Moolla 2e544c476f Simplify weights hash 2016-02-11 18:45:43 -05:00
Zaahir Moolla 907ad3a5e0 Add max weight limit 2016-02-11 18:37:24 -05:00
Zaahir Moolla 0b76d356cd Remove Perl metadata, handled by IA Page 2016-02-11 18:27:36 -05:00
Zaahir Moolla 14d238f042 Merge pull request #2262 from GuiltyDolphin/remove-metadata
Remove Metadata
2016-02-11 16:41:56 -05:00
Zaahir Moolla 2e8dd988b0 Merge pull request #1991 from Mailkov/figletissue1163
Issue #1163 - Convert FIGlet to use templates
2016-02-11 15:22:16 -05:00
Mailkov 1d9a8df404 delete unused code 2016-02-11 18:47:05 +00:00
Mailkov f30a827950 make unique sub to solve x/y argument 2016-02-11 18:22:56 +00:00
Mailkov 724fad5bc8 add support for start + interval arguments on weekday 2016-02-11 18:01:30 +00:00
Mailkov cd5dd0470a add support for start + interval arguments on month 2016-02-11 17:57:04 +00:00
Mailkov 6a3f4b9f33 add support for start + interval arguments on date 2016-02-11 17:51:28 +00:00
Mailkov bc970a643e add support for start + interval arguments on minutes 2016-02-11 17:42:03 +00:00
Mailkov 0eff1575b9 addgsupport for start + interval arguments on hours 2016-02-11 17:25:25 +00:00
Ben Moon 46b19a54a7 Remove metadata 2016-02-11 13:36:11 +00:00
tyasaka a2744b6c79 Minor tweaks.
Adjusted wording, added test cases.

 Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-02-07 23:14:32 +00:00
tyasaka 9c30eecc6a Minor tweak to trigger handler.
Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
2016-02-07 20:41:22 +00:00
Ben Moon 5ef7d7b74b Move synonyms into JSON file 2016-02-06 13:54:41 +00:00
Ben Moon 7540baaa05 Remove redundant variable 2016-02-06 13:49:04 +00:00
Ben Moon 864fe0dbe9 Convert synonyms to a hash 2016-02-06 13:48:37 +00:00
Ben Moon 6931287188 Remove HTML::Entities dependency 2016-02-06 13:24:34 +00:00
Ben Moon 2c4254faab Update to use text template 2016-02-06 13:22:56 +00:00
Ben Moon 8838957d4f Remove cheat sheet triggers
Don't want it to trigger on those...
2016-02-06 13:05:41 +00:00
Ben Moon 18c6b9c596 Move html into content file 2016-02-06 13:02:25 +00:00
Ben Moon c1546375f7 Update data method for answer 2016-02-06 11:56:16 +00:00
Ben Moon 214d9433a1 Correct content field 2016-02-06 11:53:47 +00:00
Ben Moon 0a057be7bc Update main package to use structured answer 2016-02-06 10:10:57 +00:00
Ben Moon 9d28dd5918 Update package names 2016-02-06 09:50:53 +00:00
Ben Moon 72935a0c55 Rename MarkdownCheatSheet to MarkdownReference 2016-02-06 09:44:43 +00:00
Ben Moon e52656a941 Disallow aliases that match the cheat sheet name 2016-02-04 19:29:16 +00:00
Ben Moon 4255962169 Fix #1844
No more duplicate aliases!
2016-02-04 19:29:16 +00:00
Ben Moon d9462ea770 Add support for options
And the 'require_name' option which just states that after matching,
processing should be done as if it weren't a custom trigger.

Basically means that the name (or an alias) is required in order to
trigger the cheat sheet.
2016-02-04 19:29:16 +00:00
Ben Moon adb28fd8b9 Allow specifying custom triggers
Cheat Sheets are now more awesome.
2016-02-04 19:29:16 +00:00
Ben Moon fc729cd225 Allow specifying multiple categories
In the 'additional_categories' field.
2016-02-04 19:29:16 +00:00
Ben Moon af9e7826d8 Add categorical triggers
More relevancy, MOREEE!
2016-02-04 19:29:16 +00:00
Ben Moon b87984b720 Set signal to high
Some other IAs trigger on the obscure regex queries!
2016-02-04 12:06:25 +00:00
Ben Moon 008bab26db Improve formatting
Clean up some whitespace, make things easier to read, remove some
redundant functions etc...
2016-02-03 19:31:34 +00:00
Ben Moon ebf686c6a1 Allow lowercase trailing TZs
E.g., cet rather than CET
2016-02-03 19:31:34 +00:00
Ben Moon 81ef278d27 Fix casing support
- Improve support for mixed-case queries.

 - Improve case-formatting of results.
2016-02-03 19:31:34 +00:00
Ben Moon 124eaa8e5a Prevent triggering on non-informative queries
If query has no action and is not relative, do not trigger.
2016-02-03 19:31:34 +00:00
Ben Moon 60a371dea8 Correct caching 2016-02-03 19:30:22 +00:00
Ben Moon b42bc4c7dd Add support for specifying time
Allows direct specification of time for input date.
2016-02-03 19:30:22 +00:00
Ben Moon 1915f773e9 Provide access to time regexes
time_24h_regex for 24 hour clocks

time_12h_regex for 12 hour clocks
2016-02-03 19:30:22 +00:00
Ben Moon 2093f3e073 Allow use of `time` form
Such as: `time now`, `time in 3 days` etc...

Will display time as well as date.
2016-02-03 19:30:22 +00:00
Ben Moon 3927595492 Fix some whitespace 2016-02-03 19:30:22 +00:00
Ben Moon 47daa8b593 Update to fall-back on time-zone offset 2016-02-03 19:30:22 +00:00
Ben Moon fd97b48e33 Add support for 24hr clock in display 2016-02-03 19:30:22 +00:00
Ben Moon 3c7c92c85b Fix issue with time-zone not being added correctly 2016-02-03 19:30:22 +00:00
Ben Moon db88b11d1d Add support for %d %b %Y %T %Z format
Essentially HTTP format without the day and allowing any timezone.
2016-02-03 19:30:22 +00:00
Ben Moon a24b0aaf42 Update to use NumberStyler 2016-02-03 19:30:22 +00:00
Ben Moon 35f2a2f908 Fix plurals 2016-02-03 19:30:22 +00:00
Ben Moon 1dae5db923 Implement hour/minute/second support
Closes #2056
2016-02-03 19:30:21 +00:00
Ben Moon 8015a0fc85 Move duration computation out of handler 2016-02-03 19:30:21 +00:00
Ben Moon 676bdd9b4a Update regexes for new units 2016-02-03 19:30:21 +00:00
Ben Moon eb3673f722 Update to use answer-helper 2016-02-03 19:30:21 +00:00
Ben Moon ee91838358 Update triggers for additional units 2016-02-03 19:30:21 +00:00
Ben Moon ef7196868b Convert to use templates 2016-02-03 19:30:21 +00:00
Ben Moon 4977cb0bb6 Fix some bad whitespace 2016-02-03 19:30:21 +00:00
Ben Moon 1203c78e57 Fix triggering with non-numbers
Would allow non-numbers to be present if numbers were already in the
query.
2016-02-03 18:10:38 +00:00
Ben Moon 6e55266f87 Remove 'sf' trigger
Reduce over-triggering - 'sf' seems to be used for other things.
2016-02-03 18:00:59 +00:00
Zaahir Moolla 2161a309fc Merge pull request #2201 from duckduckgo/pr/2003
VIN: Switch to subtitle-content template, mimic new DuckDuckGo.pm design
2016-02-02 00:17:53 -05:00
Zaahir Moolla c050fbfe8f change template name, fix tests 2016-02-02 00:15:13 -05:00
Zaahir Moolla 4e0803b5c7 Pass along decode url to API 2016-02-02 00:09:28 -05:00
Zaahir Moolla db251c5ebb Switch replace moreAt with subtitle-content template 2016-02-02 00:06:45 -05:00
Zaahir Moolla e2e83805aa Merge pull request #1964 from duckduckgo/mintsoft/template-atbash
Convert Atbash to text template
2016-02-01 23:35:40 -05:00
Zaahir Moolla 6b40f1d3ed add html_enc(), update tests 2016-02-01 23:31:29 -05:00
Zaahir Moolla f7494c549a Regex: Escape all html to prevent SERP breakage 2016-01-31 14:08:46 -05:00
Zaahir Moolla 8b6a2f1ffc Merge pull request #1998 from GuiltyDolphin/regexp-improve
Regexp: Improvements!
2016-01-31 13:01:18 -05:00
Zaahir Moolla f24d1d8322 Merge pull request #1974 from GuiltyDolphin/sigfigs-fix
SigFigs: Update to use templates + other improvements
2016-01-31 12:41:34 -05:00
Zaahir Moolla e96d1a92e1 bring back some CSS, minor visual tweaks 2016-01-30 19:05:01 -05:00
Zaahir Moolla 3bc265f26e Merge pull request #1989 from Mailkov/suninfoissue1163
Issue #1163 - Convert SunInfo to use templates
2016-01-30 19:04:27 -05:00
Zaahir Moolla 7e909ae220 Merge pull request #1978 from Mailkov/crypthashcheckissue1163
Issue #1163 - Convert CryptHashCheck to use templates
2016-01-30 18:34:08 -05:00
Zaahir Moolla d04bd61413 Merge pull request #1959 from Mailkov/calendartodayissue1163
Issue #1163 - Convert CalendarToday to use templates
2016-01-30 18:24:07 -05:00
Zaahir Moolla 71ad58040f Merge pull request #1886 from GuiltyDolphin/caesar-cipher
New Caesar Cipher Goodie
2016-01-29 20:10:29 -05:00
tyasaka 0b9f89a765 Changing query triggers/handle.
How does this look?

 Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-01-28 16:21:22 +00:00
tyasaka ead27a5a41 Some corrections.
Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-01-28 15:39:33 +00:00
tyasaka 4c00835e23 Added a template.
A few minor tweaks as well.

 Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-01-28 03:45:46 +00:00
tyasaka 8ba0794ac7 Further attempts at improvement.
How does this look? Does this go in the right direction?

 Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-01-27 05:15:21 +00:00
tyasaka c5f6e90a03 Just trying to expand the query space a bit. I didn't realize this goodie existed at first because I couldn't get it to trigger.
If you type in 'answer to' in DDG, the second suggestion is currently 'answer to life the universe and everything'.
And if you type this query into Google, it will output 42 as the answer. So I think it makes sense that the query should also trigger this goodie.

 On branch UltimateAnswer
 Changes to be committed:
	modified:   lib/DDG/Goodie/UltimateAnswer.pm
	modified:   t/UltimateAnswer.t
2016-01-26 14:50:34 +00:00
Zaahir Moolla 54798e4e40 Merge pull request #1973 from amitdev/master
Periodic Table Updated - Fixes #1914
2016-01-25 21:43:35 -05:00
Jag Talon 8babf4ee28 Merge pull request #2005 from Mailkov/percenterrorissue1163
Issue #1163 - Convert PercentError to use templates
2016-01-25 15:56:38 -05:00
Jag Talon 8fb592b4c2 Merge pull request #2013 from GuiltyDolphin/zodiac-update-deps
Zodiac - Remove DateTime::Event::Zodiac Dependency
2016-01-25 15:40:16 -05:00
Zach Thompson 09e0e942e5 Return if any term is not a multiple of 8 to prevent auto-padding 2016-01-24 06:58:23 -07:00
Ben Moon 7254b9e96f Add html_enc to subtitle 2016-01-24 10:14:12 +00:00
Ben Moon 1c87b33c94 Use html_enc to encode subtitles
It hurts dammit!
2016-01-24 10:06:23 +00:00
Ben Moon 8eae393c78 Limit amount of words generated
To 200 (roughly 25 sentences/lines).
2016-01-24 08:54:35 +00:00
Zaahir Moolla 28a75146cc remove trailing space, add newline before ABSTRACT 2016-01-24 00:36:18 -05:00
Zaahir Moolla e6a4f78c00 minor cleanup (activating github bot...) 2016-01-23 23:19:06 -05:00
Zach Thompson 657b0dead2 Put 'use big*' after is_cached so we don't promote is_cached 2016-01-21 11:12:38 -07:00
Ben Moon 8008d40d74 Update formatted input
From `Significant figures of...` to `Number of Significant Figures
in...`.
2016-01-18 19:06:00 +00:00
Ben Moon 0a5d01e73e Improve triggers
Vastly improves the triggering!

I had a look at searches related to significant figures and none of the
common searches involved `sd` or `sig digs`, so I got rid of those
triggers.

A lot of the searches were along the lines of "What are the significant
figures of X?" - so I've updated the handler to allow for these types of
queries.
2016-01-18 19:05:58 +00:00
Ben Moon 6511199068 Improve general handling of significant figures
Fixes an issue with input of just '0', the Goodie was not triggering.
2016-01-18 19:05:07 +00:00
Ben Moon b886023057 Add support for more number systems
Uses the `NumberStyler` GoodieRole to improve number support.
2016-01-18 19:05:06 +00:00
Ben Moon 85ec54e8be Update answer to use text template 2016-01-18 19:05:06 +00:00
Ben Moon e2878dfb45 Change to no response when no translation was done 2016-01-18 19:04:00 +00:00
Ben Moon ace3370227 Add support for additional query forms
Will now work as one would expect for queries such as "How do you say X
in piglatin?".
2016-01-18 19:03:59 +00:00
Ben Moon 69fb77b905 Improve support general queries
* Makes it less likely that the Goodie will trigger on false-positives
  (e.g., "What is piglatin?").
* Provides better support for matching when "piglatin" is included in
  the query to be translated.
2016-01-18 19:02:12 +00:00
Ben Moon 8f2a36ccf5 Support translation to+from Pig Latin and casing
Swap to using the `Lingua::PigLatin::Bidirectional` package which
provides much better support for case-preservation as well as
translation to and from Pig Latin.
2016-01-18 19:02:10 +00:00
Ben Moon d3108e2de2 Update answer to use templates
Now uses the 'text' answer template.
2016-01-18 19:01:29 +00:00
Ben Moon aa97420208 Fix PigLatin triggering on empty input
Fixes #1969
2016-01-18 19:01:29 +00:00
Ben Moon 87a2d8e639 Clean up some code and functionality
Pull a few things out of the handler which don't need to be computed at runtime.

Clean up the `$default` system.

Move a few rogue comments.
2016-01-18 18:56:36 +00:00
Ben Moon da3ab1a22a Improve formatting of result
Made the title a bit smaller (and used a title rather than subtitle).

Display spacing between paragraphs.

Have "show more..." display for long texts.

Only display search suggestions on default input.
2016-01-18 18:56:36 +00:00
Ben Moon 3ee334ee4f Add infobox for example queries 2016-01-18 18:56:36 +00:00
Ben Moon 764a03da73 Add main functionality
Adds the body to provide the functionality for the Goodie.
2016-01-18 18:56:35 +00:00
Ben Moon f336a21926 Add skeleton
Add basic test helpers, triggers and handler.
2016-01-18 18:56:33 +00:00
Ben Moon cadd1b0154 Fix issue with invalid regexes causing warnings
Suppresses warnings that relate to invalid compilation of the user's
regular expression.
2016-01-18 18:52:29 +00:00
Ben Moon 6e03f6aee7 Fix issue with brackets in named captures
For some reason it was displaying a result (when it shouldn't) if there
were brackets in the names of the capture groups.
2016-01-18 18:52:29 +00:00
Ben Moon 5a2a003503 Improve naming of results
Named Match (X) -> Named Capture <X>

Number Match (X) -> Subpattern Match X
2016-01-18 18:52:29 +00:00
Ben Moon b33428914d Correct ordering of results
Will display Full Match, then Named, then Numbered.
2016-01-18 18:52:29 +00:00
Ben Moon ed622cf84b Add support for ignore-case modifier 2016-01-18 18:52:29 +00:00
Ben Moon 242c5573ff Add support for perl-style regex matches
Allows regex matches in the form `X =~ /Y/`.
2016-01-18 18:52:29 +00:00
Ben Moon 96a69e6965 Fix first match being assigned incorrectly
If expression had no paren-matches then the numbered matches list was
just being passed "1" - not ideal!
2016-01-18 18:52:29 +00:00
Ben Moon 8651a0c33f Add result generation functions
The result produced is a hash which contains the full match, numbered
matches and named matches.
2016-01-18 18:52:29 +00:00
Ben Moon b9a841cc7f Update triggers and handler
Remove unnecessary regex trigger and perform matches within the
handler.
2016-01-18 18:52:29 +00:00
Ben Moon c5b3330ad9 Add skeleton answer template
Will use the `list` group for displaying multiple results.
2016-01-18 18:52:29 +00:00
Ben Moon bc507ef5d6 Implement new Zodiac system
Has no Zodiac dependencies, just uses a bit o' JSON.
2016-01-18 18:46:26 +00:00
Ben Moon 3468b251f8 Add zodiac helpers 2016-01-18 18:43:51 +00:00
Rob Emery 792ea0f0bf Merge pull request #2065 from Hoaas/patch-1
Updated URL
2016-01-15 21:48:20 +00:00
Jag Talon 93d52e295d Merge pull request #2053 from duckduckgo/brian/duckduckgo-goodie
Update structure + format of DDG goodie
2016-01-15 14:46:10 -05:00
Zaahir Moolla 3d745e78af Merge pull request #1478 from lights0123/master
lights0123's Security Addons Goodie
2016-01-15 13:42:07 -05:00
Hoaas a3b468cafc Updated URL
resisto.rs have changed URL from http://resisto.rs/100 to http://resisto.rs/#100.
2016-01-15 16:25:49 +01:00
amitdev 3f967fe4df Periodic Table: Change display to new format 2016-01-15 06:50:05 +00:00
Mailkov f05892fb26 review change regex 2016-01-14 20:06:14 +00:00
Mailkov af1b531872 use html_enc for some fonts 2016-01-14 19:13:26 +00:00
Brian Stoner 1815e7190b handle the image differently because the text template floats it to the right 2016-01-14 11:49:35 -05:00
Brian Stoner 961b7defd1 add image support for dax 2016-01-14 11:39:29 -05:00
Brian Stoner 25e1df7d88 update the responses text + tests 2016-01-14 11:19:19 -05:00
Mailkov cd7a2ec953 fix tests on FrequencySpectrum.t 2016-01-14 14:41:17 +00:00
Brian Stoner 892f9ea0c0 Issue #853 update structure + format of DDG goodie 2016-01-13 22:53:25 -05:00
Zaahir Moolla 7e8ec50377 Merge pull request #1872 from Mailkov/publicdnsissue1163
Issue #1163 - Convert PublicDNS to use template
2016-01-13 20:10:40 -05:00
Zach Thompson 5cd8645f79 Merge branch 'master' into zt/bin2unicode 2016-01-13 15:05:17 -07:00
Zach Thompson fc1abffad8 Default to ascii if binary number is larger than max code point for unicode
Suppress warnings about overflow, non-portability, non_unicode
Add tests
2016-01-13 14:57:07 -07:00
Ben Moon 98a43daef8 Fix rounding issue
Using `sprintf` was causing rounding to ~ 5 dp, definitely not what
we want!

Using Math::BigFloat should be fine, as styling numbers should not occur
en masse - only during conversions to/from user input.
2016-01-13 21:17:59 +00:00
Ben Moon f0b0375add Fix #2041
Corrects the use of scientific notation when displaying results.
2016-01-13 16:07:45 +00:00
Zach Thompson 808d8d0dac Require 8 or more zeroes, ones, and spaces so we don't collide with hex numbers 2016-01-12 16:39:48 -07:00
Zach Thompson 41fee0251e Update trigger to capture, anchor
Use handle matches
2016-01-12 16:34:59 -07:00
Zach Thompson dac58d4622 Remove boilerplate.
Suppress warnings
2016-01-12 14:15:06 -07:00
Zaahir Moolla 0619b61ad2 Merge pull request #1996 from duckduckgo/mintsoft/conversions-converted
Conversions: "Convert The Future Into The Present"
2016-01-12 12:12:20 -05:00
Rob Emery c05d83ee19 Conversions: Adding support for degrees rankine 2016-01-11 22:44:43 +00:00
Rob Emery 567b651a3b Conversions: Now supports 'degree fahrenheit' and celsius 2016-01-11 22:38:41 +00:00
Mailkov ef671f02f1 fix merge conflict 2016-01-11 17:22:11 +00:00
Mailkov 0045bd84be fix merge conflict 2016-01-11 17:18:03 +00:00
Zach Thompson ad31a1c857 Binary to unicode conversion 2016-01-11 10:14:42 -07:00
Mailkov 0dd5ccf808 fix merge conflict 2016-01-11 17:11:25 +00:00
Mailkov 2e1e492e9e fix merge conflict 2016-01-11 17:08:44 +00:00
Mailkov dc25052d4f fix merge conflict 2016-01-11 17:06:16 +00:00
Mailkov c45fd3d158 fix merge conflict 2016-01-11 17:04:10 +00:00
Mailkov dac3579b14 fix merge conflict 2016-01-11 17:02:27 +00:00
Mailkov b6f91090f4 fix merge conflict 2016-01-11 16:59:35 +00:00
Mailkov c6239557ef fix merge conflict 2016-01-11 16:57:14 +00:00
Mailkov 5e03da6855 fix merge conflict 2016-01-11 16:54:29 +00:00
Mailkov d6920ee13e fix merge conflict 2016-01-11 16:51:25 +00:00
Mailkov 3a9e38ce35 fix merge conflict 2016-01-11 16:48:56 +00:00
Mailkov a0ffcf6f03 fix merge conflict 2016-01-11 16:46:20 +00:00
Mailkov 04a43af2e2 fix merge conflict 2016-01-11 16:41:53 +00:00
amitdev 57efc1e837 Merge branch 'master' of https://github.com/duckduckgo/zeroclickinfo-goodies
Conflicts:
	lib/DDG/Goodie/PeriodicTable.pm
2016-01-09 12:23:38 +00:00
Rob Emery 02a9ce86ee Conversions: Expanding the unit bodging for Ounces (#1767); I incorrectly diagnosed the issue, as it's actually broken due to amiguity around "ounces" 2016-01-08 13:05:26 +00:00
Zaahir Moolla 44de44ea6e resolve merge conflicts 2016-01-07 12:04:20 -05:00
Mailkov a909015066 delete an unused line code 2016-01-06 20:39:29 +00:00
Mailkov 9941d5924b improve regex 2016-01-06 20:37:13 +00:00
Mailkov bc8260df1b fix indentation on regex 2016-01-06 20:22:38 +00:00
Mailkov 5b6dd8847b correct regex 2016-01-06 20:19:42 +00:00
Mailkov 65b5078fad update regex 2016-01-06 20:06:47 +00:00
Ben Moon 4a74413681 Improve formatting of results
Change to use the 'info' template with some custom css and handlebars
to get it to display properly.

Should now wrap correctly with sentences and words, and display 'lines'
on separate lines.
2016-01-06 11:06:16 +00:00
Mailkov 1945216a79 add title 2016-01-06 10:11:02 +00:00
Zaahir Moolla df3b3f39b4 Merge pull request #1979 from Mailkov/cusipissue1163
Issue #1163 - Convert Cusip to use templates
2016-01-05 23:47:19 -05:00
Charlie Garrison 7ab965df6f Sort recipes from longest to shortest phrase
Signed-off-by: Charlie Garrison <cngarrison@gmail.com>
2016-01-05 18:18:35 +11:00
Mailkov 0b2a6e3c62 fix indentation 3 2016-01-05 00:09:54 +00:00
Mailkov d3dcad6ccb fix indentation 2 2016-01-05 00:04:52 +00:00
Mailkov 9f80ab8d24 delete colon 2016-01-04 23:11:51 +00:00
Rob Emery 2fd9205f62 Merge pull request #2004 from Mailkov/unixtimeissue1163
Issue #1163 - Convert UnixTime to use templates
2016-01-04 22:04:19 +00:00
Mailkov 6a7ac8a14b delete unused code 2016-01-04 18:01:23 +00:00
Mailkov eb3b245d7b add text template 2016-01-04 17:49:22 +00:00
Mailkov eaad13f4a2 deactivate html code 2016-01-04 17:44:18 +00:00
Mailkov 1039313012 add attribution 2016-01-04 17:43:11 +00:00
Mailkov 2cac514c3b delete empty line 2016-01-04 17:14:51 +00:00
Mailkov 5ad6a84020 delete unused code 2016-01-04 17:11:21 +00:00
Mailkov e52e597290 add list template 2016-01-04 16:54:07 +00:00
Ben Moon 4bc4e17cf2 Update answer to template 2016-01-04 16:00:12 +00:00
Zaahir Moolla f53b0bc636 resolve merge conflict 2016-01-04 10:31:06 -05:00
Mailkov a7b3ce5aad deactive html code 2016-01-04 14:48:18 +00:00
Mailkov c44165a283 add attribution 2016-01-04 14:46:26 +00:00
Mailkov 98d8d6ff88 delete unused code 2016-01-04 14:35:44 +00:00
Mailkov c674b4b431 correct tests on VIN.t 2016-01-04 14:34:35 +00:00
Mailkov 220155a186 add text template 2016-01-04 14:25:50 +00:00
Mailkov 390cbc193e add attribution 2016-01-04 14:16:57 +00:00
Rob Emery b4ef4a0205 Conversions: Adding support for 'How to convert $x to $y' queries 2016-01-03 12:42:38 +00:00
Ben Moon 609070ba80 Update regexes and format of answer
Fixes a few bugs with the regexes (namely the font-size).

Adds support for using "base pixel size" instead of "font size".

Pulls out some of the expressions into smaller pieces.
2016-01-02 12:34:52 +00:00
Ben Moon 4420016052 Move conversions algorithms out to functions 2016-01-02 12:33:07 +00:00
Ben Moon 5d210ec249 Update answer to use template 2016-01-02 12:31:34 +00:00
Rob Emery 1085815b19 Conversions: Fixing hard-tabs 2016-01-02 10:44:30 +00:00
Rob Emery d841ffb676 Conversions: Switching to YAML::XS, LoadFile; also breaking the triggers out from the units. I'd like to introduce prefixes (kilo, mega, ...) as separate things which would need to extend the units 2016-01-01 22:42:08 +00:00
Rob Emery e4555874b4 Conversions: Tidying out warn() that was for some filthy debugging 2016-01-01 22:37:33 +00:00
Rob Emery 2ed2a3f444 Conversions: The answer can now actually be 0 (previously due to a psuedo undefined check it wasn't possible). Readding tautology tests :) 2016-01-01 22:34:47 +00:00
Rob Emery bbfa31ec81 Conversions: Temperature conversion now works correctly. Some of the tests were wrong as they were based on the old results. Tautology questions (0 kelvin in kelvin) will not return a result 2016-01-01 22:16:24 +00:00
Rob Emery 51d26e14a6 Conversions: Fixing execution of '-7 fahrenheit in kelvin' this was because conversions assumed that if the from unit can't be negative then the to unit must also be forbidden, this doesn't apply well to temperature conversion 2016-01-01 22:06:41 +00:00
Rob Emery 56bb2ef181 Conversions: New more accurate temperature calculations, fixing inaccurate test, implementing lc case triggers 2016-01-01 21:56:48 +00:00
Rob Emery 9bfcf27170 Conversions: Should be UTF8 aware 2016-01-01 21:00:18 +00:00
Rob Emery 3f43ab7a0d Conversions: Removing C::P dependency and providing conversions from data provided with goodie 2016-01-01 20:57:08 +00:00
Mailkov 78ae4f8db4 fix review 2015-12-31 10:32:25 +00:00
Zach Thompson a32452fed6 Merge branch 'master' into zt/rm-meta
Conflicts:
	lib/DDG/Goodie/Anagram.pm
	lib/DDG/Goodie/Average.pm
	lib/DDG/Goodie/Chess960.pm
	lib/DDG/Goodie/ColorCodes.pm
	lib/DDG/Goodie/Constants.pm
	lib/DDG/Goodie/Factorial.pm
	lib/DDG/Goodie/LaserShip.pm
	lib/DDG/Goodie/Passphrase.pm
	lib/DDG/Goodie/ResistorColors.pm
	lib/DDG/Goodie/RubiksCubePatterns.pm
	lib/DDG/Goodie/Shortcut.pm
	lib/DDG/Goodie/Sort.pm
	lib/DDG/Goodie/TwelveOclock.pm
	lib/DDG/Goodie/Unicode.pm
	lib/DDG/Goodie/Zodiac.pm
2015-12-30 13:54:57 -07:00
Mailkov 84ce748cfd delete unused code 2015-12-30 17:23:12 +00:00
Mailkov ad4fb9a1ca add text template 2015-12-30 17:07:17 +00:00
Mailkov 3efe70aa69 deactive html code 2015-12-30 16:44:05 +00:00
Mailkov f4586191f1 fix indentation 2015-12-30 16:41:29 +00:00
Mailkov 677c5a5752 add attribution 2015-12-30 16:38:20 +00:00
Mailkov 9f4332ba0c fix indentation 2015-12-30 16:25:28 +00:00
Mailkov 0a5adfa884 delete unused code 2015-12-30 16:17:09 +00:00
Mailkov 34588d2afc add text template 2015-12-30 16:06:16 +00:00
Mailkov edf3bbc7ba deactive html code 2015-12-30 15:50:32 +00:00
Mailkov c06e4f452e add attribution 2015-12-30 15:49:12 +00:00
Mailkov 84afccb6c6 delete unused code 2015-12-30 15:28:39 +00:00