PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/Dictionary/Definition.pm

https://github.com/robertbrook/zeroclickinfo-spice
Perl | 34 lines | 27 code | 7 blank | 0 comment | 0 complexity | 4ecf92ffb5d0053e0c2df32f0c449e47 MD5 | raw file
 1package DDG::Spice::Dictionary::Definition;
 2
 3use DDG::Spice;
 4
 5description "Get the definition of a word";
 6name "Dictionary";
 7primary_example_queries "define inundate";
 8secondary_example_queries "definition of dictionary";
 9topics "everyday";
10category "reference";
11code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Dictionary/Definition.pm";
12attribution web => ['http://duckduckgo.com', 'DuckDuckGo'],
13            twitter => ['http://twitter.com/duckduckgo', '@duckduckgo'];
14
15spice to => 'http://api.wordnik.com/v4/word.json/$1/definitions?includeRelated=true&includeTags=true&limit=3&api_key={{ENV{DDG_SPICE_WORDNIK_APIKEY}}}&callback={{callback}}';
16
17triggers startend => (
18    "define",
19    "define:",
20    "definition",
21    "definition:",
22    "definition of",
23    "definition of:",
24    "meaning",
25    "meaning of",
26    "meaning of:",
27);
28
29
30handle remainder => sub {
31    return lc $_;
32};
33
341;