Commit Graph

4310 Commits (433a989c7461830f20c73db9b0fe36186731b692)

Author SHA1 Message Date
msingh2 713426c94b colors.yml lowecased 2016-07-08 20:47:52 +00:00
msingh2 c3ec2c6b88 Colors.yml fixed 2016-07-08 20:20:07 +00:00
msingh2 6fc8fecfcb Fixes function error 2016-07-08 20:01:31 +00:00
msingh2 7df832f867 Colors YAML added 2016-07-08 19:48:51 +00:00
msingh2 6b9ea6c1e2 Regex for colors added 2016-07-08 18:05:51 +00:00
msingh2 50acbe7294 Code working for particular format 2016-07-08 17:17:19 +00:00
msingh2 3446741c56 Fetches color 2016-07-08 14:54:56 +00:00
rpohankar 5bf75e7c15 Modify perl file to use template, remove html file, update css class name with id. 2016-07-08 14:26:39 +00:00
msingh2 96c7c20ab1 Initial code ported 2016-07-08 13:13:08 +00:00
Ben Moon 772e6c8542 Update tests and fix logic for new front-end 2016-07-08 10:29:38 +01:00
Ben Moon 7ef7792978 Add display similar to ColorCodes
Use (mostly) the same CSS and Handlebars with a few adaptations - needs
a bit of work.
2016-07-07 21:13:54 +01:00
1122131 bc696287c7 trigger fix and various comments 2016-07-07 17:46:28 +00:00
Ben Moon 80f4c32c14 Add support for basic '+' forms
E.g., `blue + black =`.

Currently does NOT support '+' on its own, e.g., `blue + black`.
2016-07-07 14:06:13 +01:00
Ben Moon ec56c99756 Improve support for multi-word colors
Ensure the user can type 'x-y', 'x y' or 'xy' to match a color.
2016-07-07 13:44:44 +01:00
Daniel Davis 7bc3c9bc3f Merge pull request #3303 from eflyjason/pinyin
New Chinese to Pinyin Goodies
2016-07-07 17:59:52 +09:00
sdua 80d837cd65 Frequency: Reverting last two commits 2016-07-06 20:04:48 +00:00
sdua 801a8ecf10 Frequency: Change Regex to not allow non-unicode chars 2016-07-06 13:02:36 +00:00
Ben Moon 46ca72219a Add support for infix mix/tint queries
And vastly improve execution and regexp compilation time.

1. Add some early-bail shortcuts so we don't need to check massive
regexes each time.

2. Reduce some duplication of regexes and matching.

3. Improve regexes.
2016-07-06 13:55:07 +01:00
sdua 73ccd35d35 JsMinify: Change name to Minifier 2016-07-06 12:49:48 +00:00
Ben Moon 04614f1f30 Add support for tinting colors 2016-07-06 12:49:41 +01:00
sdua 87b9b2e610 JsMinify: Add more trigger words 2016-07-06 11:36:19 +00:00
Ben Moon cf6fd709c0 Add support for percentages in mixing
E.g., `mix 50% blue with 50% black`.
2016-07-06 12:10:46 +01:00
Ben Moon 3983157ac3 Ensure (mix) amounts are normalized for template
Instead of passing 'parts' or 'percent' etc., just pass a decimal that
we can do with what we will in the 'front' end.
2016-07-06 11:52:51 +01:00
Ben Moon 315e887785 Ensure $color_re is a compiled regex
Fairly decent speed increase from this.
2016-07-06 11:40:54 +01:00
Ben Moon f3c205cde2 Add support for 'parts' in mixing
E.g., `mix 5 parts blue and 6 parts red`.
2016-07-06 11:36:39 +01:00
Ben Moon 9675e8edb1 Add some basic custom stop words
'make', 'makes', 'paint', and 'paints'; just some common words that pop
up in queries relating to color.
2016-07-05 21:34:23 +01:00
Ben Moon 76495ed45a Add support for 'mixing' form 2016-07-05 21:31:17 +01:00
Ben Moon 06e0da0503 Add support for 'with' in mixing
E.g., `mix white with black`.
2016-07-05 21:23:39 +01:00
Ben Moon ee5e5e7e51 Vastly increase number of supported (named) colors
From about ~100-200 to upwards of 10,000 (at the cost of a little
speed).
2016-07-05 19:04:50 +01:00
Ben Moon 5c00057dd3 Add support for 'mixed' and improve relevancy
This relevancy check (stopwords) seems to do a pretty decent job.
Unfortunately there are a lot of queries involving colors - many valid
and many invalid.
2016-07-05 16:11:11 +01:00
Ben Moon 92a5b307c1 Allow using the plural of color (though singular)
Currently only returning single results, but we probably want to catch
queries like `random colors`.
2016-07-05 15:26:22 +01:00
Zaahir Moolla 6a1e1e537c Merge pull request #3342 from duckduckgo/mintsoft/dewey-alteration
Dewey: Converting to structured answer
2016-07-05 10:22:35 -04:00
Ben Moon 88317a6394 Add support for additional 'opposite' forms
* Complementary
* Can use 'for|of|to'
2016-07-05 15:21:36 +01:00
Ben Moon 51d1294bcc Ensure it is clear that opposites are for RGB
People may mean the 'RBY' model, so ensure they can see this is RGB.

*Todo: Support the 'traditional' model in the future.*
2016-07-05 15:09:50 +01:00
Ben Moon 65b293005a Add support for opposite colors 2016-07-05 14:42:41 +01:00
Ben Moon f4fa95c8ba Add additional sample queries
* Ensure we can trigger 'mix' in the middle of a sentence.
2016-07-05 13:55:17 +01:00
Ben Moon 43abe8678f Add invalid queries from sampling
A.k.a. the 'query suggestion' method.
2016-07-05 13:48:06 +01:00
Ben Moon c12a1ac994 Add support for common names in output
If there is a 'common' name available for the color, display that along
with the hex code.
2016-07-05 12:56:04 +01:00
Ben Moon 8316a69f73 Add support for bounds in random colors
E.g., `random color between blue and green`.
2016-07-05 12:28:40 +01:00
Ben Moon 09d622130e Add support for named colors
E.g., in `mix blue and red`.
2016-07-05 12:03:59 +01:00
Ben Moon 5707700a7c Allow use of 'and' when mixing colors 2016-07-05 11:50:31 +01:00
Ben Moon 67460e170d Allow leading '#' for hex colors 2016-07-05 11:49:19 +01:00
Ben Moon 942c87147b Add support for mixing two colors 2016-07-05 11:45:40 +01:00
Ben Moon 73002db388 Add 'normalize_color' helper
Currently just normalizes to the form #HHHHHH where 'H' is a hex digit.
2016-07-05 11:33:28 +01:00
Ben Moon f12586eb5f Allow using 'rand' instead of 'random' 2016-07-05 11:31:33 +01:00
Ben Moon 02122b6a4f Rename $color_re to $scolor
I'll want $color_re for a regex that matches colors rather than the
word.
2016-07-05 11:28:37 +01:00
Ben Moon a6c557c112 Ensure basic invalid queries do not trigger 2016-07-05 11:25:48 +01:00
Ben Moon 61219201d3 Normalize 'result_color' to 'text_answer'
For the time being (at least), use the resulting color (as text) for the
text response.
2016-07-05 11:10:07 +01:00
Ben Moon c35d489c48 Replace use of 'content' with 'title_content'
We'll only be modifying the subtitle and title, so use the provided
content templates.
2016-07-05 10:58:39 +01:00
Ben Moon b132ab9026 Add a colored box to title
1. Add a '#' to the front of hex colors.
2. Display a colored box along with the hex value of the color.
2016-07-05 09:52:14 +01:00
Ben Moon a95a74a5b0 Add support for 'colour' form 2016-07-05 09:38:04 +01:00
Ben Moon 32942acfd8 Replace HASH iteration with 'first'
Breaking out of HASH iteration does *weird* things...
2016-07-05 09:37:14 +01:00
Ben Moon 718820888f Add support for basic random color queries 2016-07-05 09:33:50 +01:00
Ben Moon 85bac4f846 Rename 'RGBColor' to 'RgbColor'
Due to the way the package name is handled in the metadata, `RGBColor`
causes some attributes to become `rgbcolor` rather than `rgb_color` (for
the latter `RgbColor` is required).
2016-07-05 08:52:33 +01:00
yhe 17e2f6014b optimize code 2016-07-05 06:57:49 +00:00
yhe 93f0a60e53 return if content dont contain Chinese and result don't contain special Pinyin character (e.g. yes3) 2016-07-05 05:20:30 +00:00
yhe 31653a7904 return unless content have Chinese character or have number (e.g. 測試/ce4 shi4) 2016-07-05 05:14:11 +00:00
yhe 63085e3e35 add space directly after chinese character instead of adding to number 2016-07-05 05:07:38 +00:00
yhe 1036aff976 add 'g' to regular experssion 2016-07-05 04:36:08 +00:00
yhe c48203fbf7 trim the input string 2016-07-05 04:32:34 +00:00
yhe a8228e5083 change method of checking if the input string contain space only 2016-07-05 04:29:48 +00:00
yhe 546b972379 use remainder_lc instead of remainder so that upper case input will work to 2016-07-05 04:25:01 +00:00
sdua 29ada01d3f JsMinify: Init IA 2016-07-04 22:51:31 +00:00
Ben Moon ea662bb28b Update answer_type
Use 'rgb_color' rather than 'rgbcolor'.
2016-07-04 19:28:09 +01:00
Ben Moon 8b8bd59ff1 Add files generated by DuckPAN 2016-07-04 18:57:54 +01:00
Zaahir Moolla f044243408 Merge pull request #3315 from duckduckgo/zaahir/flip-text-trigger-1
FlipText: Force start trigger to improve relevancy
2016-07-04 13:25:48 -04:00
yhe 37266449d7 [Optimize] Prevent triggers for queries that already contain pinyin 2016-07-04 12:47:33 +00:00
yhe 879f2c7e01 Prevent triggers for queries that already contain pinyin 2016-07-04 10:43:39 +00:00
Rob f2fba9dbb8 Dewey: Replacing the guard replacement with a match
Dewey: minor cleanup
2016-07-04 05:50:37 +01:00
Rob 5a91961dd8 Dewey: Should not react to the query "dewey decimal system" without numbers etc 2016-07-04 05:50:29 +01:00
Rob b83db4c7c8 Dewey: Tests passing again; slight renaming 2016-07-04 05:50:10 +01:00
Rob 672ebc04e1 Dewey: Instance variables are static; so it was "learning" more answers every time the IA was executed 2016-07-04 05:50:02 +01:00
AlterationBrick 475dac19e6 Commenting the code to try and figure out what it does
more commenting

Finish commenting and figuring out what it does

change some html insertions to hash insertions

remove all html except for links

comment out references to $out and $out_html so it triggers in DuckPAN

Fix an obvious spelling error and take out a ref tag from wikipedia

Hide html tags in output, check for nonexistent numbers, stop lowercasing output because it's no longer embedded in a sentence

Clean up perl code without changing functionality, attempt a test file

Slight unsuccessful mods to t file
2016-07-04 05:49:41 +01:00
Ben Moon 706ac4d564 Merge pull request #3305 from sam09/fix3300
Add Handling Negative Duration in Duration Calculator
2016-06-29 11:10:04 +01:00
sradhakrishnan 911a556327 Add Test 2016-06-29 05:11:41 +00:00
sdua e414b3851e Frequency: Add alongwith and 2016-06-29 04:57:27 +00:00
sdua 16b295c974 Frequency: Fix tests 2016-06-29 04:47:37 +00:00
sdua 8c9ac65ed0 Frequency: Add subtitle and reformatting of title 2016-06-29 04:39:04 +00:00
tagawa 38dcedf0a6 Changed template group back to 'text' 2016-06-28 14:10:37 +00:00
Zaahir Moolla 369bb20dd3 Force star trigger to improve relevancy 2016-06-27 17:54:44 -04:00
tagawa 1ca9e98500 Refer MAC address and Generate MAC to each other 2016-06-27 17:20:37 +00:00
Daniel Davis 7a59de0bd4 Merge pull request #3219 from neosilky/url-encode-changes
URLEncode: enable triggering on 'uri' as well
2016-06-27 17:17:55 +09:00
sradhakrishnan 429dc9d0be Add handling of negative duration in Duration calculator
Fix #3300
2016-06-25 16:04:18 +00:00
yhe 444652a231 Add Chinese to Pinyin 2016-06-25 14:52:39 +00:00
1122131 1303476e7d .pm file opt 2016-06-25 06:31:07 +00:00
Zaahir Moolla 6e92ddad15 Merge pull request #3030 from duckduckgo/gd/birth-stone-cleanup
BirthStone: Clean up
2016-06-23 17:10:51 -04:00
Zaahir Moolla fc5f8b4724 Merge pull request #2875 from duckduckgo/gd/random-date-new-ia
New Random Date Goodie
2016-06-23 16:54:00 -04:00
sdua 2d5a9f395a Update tests according to changes 2016-06-22 15:47:07 +00:00
Zaahir Moolla 2588cc64ce Merge pull request #2855 from marianosimone/Sloff/ChineseZodiac_Icons
Add Chinese zodiac icons (cont)
2016-06-22 10:55:20 -04:00
Zaahir Moolla a726f991f5 Merge pull request #3205 from sam09/dur_cal
Add Duration Calculator
2016-06-22 10:51:38 -04:00
sdua 4536789bf1 Normalize title 2016-06-22 14:43:33 +00:00
Zaahir Moolla 8b5ae0d771 Merge pull request #3215 from shellhead/fibonacci
Fibonacci: Use Perl package
2016-06-21 18:35:45 -04:00
Zaahir Moolla bdcf034144 Merge pull request #3108 from lowellosaurus/military-rank
New MilitaryRank Instant Answer
2016-06-21 11:42:09 -04:00
lwood1 883e16d6e4 Moved logic to insert no insignia image into perl module. Removed javascript file. 2016-06-21 11:20:54 +00:00
lwood1 d288c0f05e Grab goodie version number in perl and pass it to javascript 2016-06-21 08:04:53 +00:00
mhunsinger 52e2993603 Merge branch 'master' of https://github.com/duckduckgo/zeroclickinfo-goodies into fibonacci 2016-06-21 05:52:56 +00:00
mhunsinger 8474384ca8 Changed response to strings, was hanging on large Fibonacci. 2016-06-21 05:52:02 +00:00
sdua aec6a7b4c5 Make title relevant to the query 2016-06-20 20:24:30 +00:00
sdua bac9b0310f Removed unnecessary line of code 2016-06-20 18:14:39 +00:00
1122131 9d59b38816 attemp to fix test file 2016-06-18 15:31:08 +00:00
1122131 1ebff3e65b reverted .pm file 2016-06-18 14:09:42 +00:00
1122131 17170a91e6 updated .t file 2016-06-18 14:06:05 +00:00
1122131 773f1f5e30 added local images and other changes 2016-06-18 13:38:04 +00:00
1122131 b09fb96890 update-4 2016-06-18 05:47:21 +00:00
rgaul aa932b30f0 Templates type should be group 2016-06-18 01:14:45 +00:00
sradhakrishnan cdb0f91902 Add more tests. Add weeks, years, months, milliseconds 2016-06-17 13:20:49 +00:00
Zaahir Moolla d6c0e510fa Merge pull request #3208 from gaulrobe/issue-1044
Tip IA: Trigger calculations off of 'tax' and some cleanup
2016-06-16 13:10:57 -04:00
sdua f6c15045c3 Fix tests 2016-06-14 11:22:18 +00:00
sradhakrishnan c4ecb7f910 Add single regex 2016-06-14 06:48:22 +00:00
mhunsinger b1874b8f23 Returning Yes/No, and minor (sub)title formatting. 2016-06-14 04:57:47 +00:00
mhunsinger 4155fcab61 Refactored tests and minor parts of Perl script.
Removed stripping whitespace around the query, as remainder_lc
already does this.
Refactored build_test to include testing for build_pred_test.
2016-06-14 04:51:34 +00:00
sdua 09e9a93b07 Update module to use record template 2016-06-14 00:01:45 +00:00
sdua 3c34cba13c Minor formatting fix 2016-06-13 22:12:31 +00:00
sdua b601f0a070 Update to use List template 2016-06-13 20:23:04 +00:00
sradhakrishnan d63603bad6 Fix tests and subtract 2016-06-13 13:53:06 +00:00
NeoSilky ad58d054b2 URLEncode: enable triggering on 'uri' as well 2016-06-10 08:50:21 +00:00
mhunsinger 7971d0b6f0 Merge branch 'master' of https://github.com/duckduckgo/zeroclickinfo-goodies into fibonacci 2016-06-10 07:01:32 +00:00
mhunsinger 71b855660c Added IA for "is n a Fibonacci number?". 2016-06-10 07:00:31 +00:00
tagawa 94acf5c43c SHA-3: Added 'sha-3' trigger 2016-06-10 05:05:29 +00:00
mhunsinger 6ec43de449 Merge branch 'master' of https://github.com/duckduckgo/zeroclickinfo-goodies into fibonacci 2016-06-09 20:07:01 +00:00
mhunsinger 1172e7b7b5 Updated Fibonacci to use Perl Math::NumSeq::Fibonacci package.
Changed the handler from "request" to "request_lc".
Fixed a problem where the regexp didn't handle "nd" ordinal suffix.
Created new test to ensure it would handle both of these cases.
2016-06-09 20:01:15 +00:00
Roysten 3bcfbede0f Merge remote-tracking branch 'ddg/master' into 2048rewrite 2016-06-09 18:17:08 +00:00
Zaahir Moolla 8775bed07a Merge pull request #2846 from duckduckgo/mattr/stopwatch-port
Port Stopwatch to Goodies
2016-06-09 11:48:40 -04:00
sradhakrishnan ddf853efe0 Fix Test 2016-06-09 13:43:23 +00:00
sradhakrishnan 35b448af6c Change to use Duration 2016-06-09 13:00:33 +00:00
Rob dbd21dad71 CoffeeToWaterRatio: Renaming aliases to be more explicit 2016-06-09 13:10:05 +01:00
Rob 693c0e415c CoffeeToWaterRatio: Refactoring datastructures and empty answer a bit 2016-06-09 12:55:51 +01:00
Rob 5d086ab37a CoffeeToWaterRatio: Removing : from the default answer as it looks unsightly 2016-06-09 12:44:33 +01:00
Rob c88bedcd8b Merge remote-tracking branch 'lamanh/fix_2767_CoffeeToWaterRatio' into mintsoft/CoffeeToWaterRatio-template 2016-06-09 12:39:26 +01:00
sradhakrishnan 6f7f4e1664 Fixes Broken Test 2016-06-09 11:23:05 +00:00
rgaul 4731a97c0d Trigger calculations off of 'tax' and some cleanup 2016-06-09 01:58:45 +00:00
Zaahir Moolla 404420734c Merge pull request #2775 from duckduckgo/gd/calc-roots-full-template
CalcRoots: Update to use full template
2016-06-08 19:10:20 -04:00
Zaahir Moolla db2a739352 Add upper bound on input, remove unnecessary IF statement 2016-06-08 18:46:55 -04:00
Ben Moon 5125691705 Merge pull request #3207 from duckduckgo/zt/bin2uni-stringify
Bin2Unicode: Fix stringy output
2016-06-08 23:22:53 +01:00
Zach Thompson 91113aa0bd Precedence in concatenation/ternary op 2016-06-08 14:21:15 -06:00
Zaahir Moolla 4485439fc7 Merge pull request #3111 from jonk1993/extend-base-converstion
Base Conversion: Allow converting between arbitrary bases
2016-06-08 16:01:04 -04:00
Zaahir Moolla 099ebaf88d Merge pull request #3076 from duckduckgo/mintsoft/macaddress-template
MacAddress: Convert to template
2016-06-08 15:34:38 -04:00
Zaahir Moolla 9ebb903f3e Merge pull request #3069 from duckduckgo/mintsoft/jira-template
JIRA: Switching to info template
2016-06-08 15:32:10 -04:00
Zaahir Moolla 520893b409 Merge pull request #3051 from duckduckgo/mintsoft/constants-template
Constants: Switching to template
2016-06-08 15:27:45 -04:00
Ben Moon fcd84610c3 Merge pull request #3098 from duckduckgo/mintsoft/rc4-template
RC4: Converting to text template
2016-06-08 18:55:42 +01:00
sradhakrishnan 9e91e93237 Add Duration Calculator 2016-06-08 15:27:19 +00:00
Rob Emery 74f903a63c Merge pull request #3179 from sm4rk0/patch-1
ReverseResistorColours: Add x0.1 and x0.01 multipliers
2016-06-08 08:13:31 +01:00
Zaahir Moolla b91ff2337a Merge pull request #2808 from rasikapohankar/countdown
Countdown Goodie
2016-06-07 12:27:48 -04:00
Zaahir Moolla 4105377cfa Merge pull request #3204 from duckduckgo/mintsoft/url-uri-decode
URLDecode: should trigger with uri as well as url
2016-06-07 11:33:39 -04:00
Zaahir Moolla b69893efd3 Merge pull request #3096 from NaveenKarippai/2840/helpLine
Convert HelpLine Goodie to list template
2016-06-07 11:23:31 -04:00
Zaahir Moolla 61d49035d7 Merge pull request #2898 from gaulrobe/altcalendars-cleanup
Improvements to AltCalendars IA
2016-06-07 11:18:45 -04:00
Rob da560073d4 URLDecode: Now triggers with uri as well as url 2016-06-06 21:45:57 +01:00
Zaahir Moolla 47bd1c834f Merge pull request #1303 from charles-l/master
ChordDiagrams (continues #1023)
2016-06-06 16:22:41 -04:00
NaveenKarippai 8ca89d0961 Update test suite to match modified goodie file
The test suite should be modified to match the modified goodie
file for list template.

* prototype of test cases written

See also: #2840
2016-06-06 16:13:05 +00:00
rpohankar d7ffa25bf8 Update perl file to remove time calculations and rely on the Dates Role, update test file, move creation of duration object inside callback of require. 2016-06-05 14:08:31 +00:00