PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms 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
  1. package DDG::Spice::Dictionary::Definition;
  2. use DDG::Spice;
  3. description "Get the definition of a word";
  4. name "Dictionary";
  5. primary_example_queries "define inundate";
  6. secondary_example_queries "definition of dictionary";
  7. topics "everyday";
  8. category "reference";
  9. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Dictionary/Definition.pm";
  10. attribution web => ['http://duckduckgo.com', 'DuckDuckGo'],
  11. twitter => ['http://twitter.com/duckduckgo', '@duckduckgo'];
  12. spice 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}}';
  13. triggers startend => (
  14. "define",
  15. "define:",
  16. "definition",
  17. "definition:",
  18. "definition of",
  19. "definition of:",
  20. "meaning",
  21. "meaning of",
  22. "meaning of:",
  23. );
  24. handle remainder => sub {
  25. return lc $_;
  26. };
  27. 1;