wordnik 4.06.05 → 4.06.06

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.rspec +1 -0
  2. data/Gemfile.lock +22 -16
  3. data/Rakefile +29 -166
  4. data/api_docs/account.json +1 -1
  5. data/api_docs/analytics.json +1 -0
  6. data/api_docs/corpus.json +1 -1
  7. data/api_docs/document.json +1 -1
  8. data/api_docs/partner.json +1 -0
  9. data/api_docs/partners.json +1 -1
  10. data/api_docs/suggest.json +1 -0
  11. data/api_docs/system.json +1 -0
  12. data/api_docs/tag.json +1 -1
  13. data/api_docs/user.json +1 -1
  14. data/api_docs/users.json +1 -1
  15. data/api_docs/word.json +1 -1
  16. data/api_docs/wordList.json +1 -1
  17. data/api_docs/wordLists.json +1 -1
  18. data/api_docs/words.json +1 -1
  19. data/lib/wordnik.rb +58 -17
  20. data/lib/wordnik/configuration.rb +21 -6
  21. data/lib/wordnik/operation.rb +3 -2
  22. data/lib/wordnik/operation_parameter.rb +4 -6
  23. data/lib/wordnik/request.rb +53 -53
  24. data/lib/wordnik/resource.rb +68 -3
  25. data/lib/wordnik/resource_modules/account.rb +0 -26
  26. data/lib/wordnik/resource_modules/analytics.rb +89 -0
  27. data/lib/wordnik/resource_modules/corpus.rb +26 -26
  28. data/lib/wordnik/resource_modules/document.rb +0 -26
  29. data/lib/wordnik/resource_modules/partner.rb +140 -0
  30. data/lib/wordnik/resource_modules/partners.rb +0 -26
  31. data/lib/wordnik/resource_modules/suggest.rb +33 -0
  32. data/lib/wordnik/resource_modules/system.rb +192 -0
  33. data/lib/wordnik/resource_modules/tag.rb +0 -26
  34. data/lib/wordnik/resource_modules/user.rb +0 -26
  35. data/lib/wordnik/resource_modules/users.rb +12 -38
  36. data/lib/wordnik/resource_modules/word.rb +23 -49
  37. data/lib/wordnik/resource_modules/word_list.rb +0 -26
  38. data/lib/wordnik/resource_modules/word_lists.rb +0 -26
  39. data/lib/wordnik/resource_modules/words.rb +0 -26
  40. data/lib/wordnik/response.rb +3 -5
  41. data/lib/wordnik/version.rb +1 -1
  42. data/spec/endpoint_spec.rb +2 -5
  43. data/spec/operation_parameter_spec.rb +32 -11
  44. data/spec/operation_spec.rb +2 -5
  45. data/spec/request_spec.rb +9 -30
  46. data/spec/resource_spec.rb +7 -7
  47. data/spec/response_spec.rb +13 -19
  48. data/spec/spec_helper.rb +14 -2
  49. data/spec/vcr/crazier_json_request.yml +31 -0
  50. data/spec/vcr/default_response.yml +25 -0
  51. data/spec/vcr/get_word_dynamo.yml +33 -0
  52. data/spec/vcr/unauthorized_response.yml +25 -0
  53. data/spec/vcr/wordnik_authenticate.yml +31 -0
  54. data/spec/vcr/wordnik_authenticate_fail.yml +172 -0
  55. data/spec/vcr/xml_response_request.yml +25 -0
  56. data/spec/wordnik_spec.rb +68 -17
  57. data/wordnik.gemspec +2 -0
  58. metadata +48 -5
@@ -0,0 +1,25 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://localhost:8001/admin/api/word.xml
6
+ body:
7
+ headers:
8
+ response: !ruby/struct:VCR::Response
9
+ status: !ruby/struct:VCR::ResponseStatus
10
+ code: 200
11
+ message: OK
12
+ headers:
13
+ date:
14
+ - Mon, 29 Aug 2011 16:28:44 GMT
15
+ wordnik-api-version:
16
+ - 4.07.67
17
+ access-control-allow-origin:
18
+ - "*"
19
+ content-type:
20
+ - application/xml
21
+ transfer-encoding:
22
+ - chunked
23
+ body: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><ApiDocumentation><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getEntries</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return XML tags in response</description><name>tags</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return etymologies</description><name>etymologies</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[entry]</responseClass><summary>Return entries for a word</summary></operations><path>/word.{format}/{word}/entries</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getExamples</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return examples for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>Show duplicate examples from different sources</description><name>includeDuplicates</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return results from a specific ContentProvider</description><name>contentProvider</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Specify the internal storage engine.</description><name>internalDataStore</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Results to skip</description><name>skip</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>exampleSearchResults</responseClass><summary>Returns examples for a word</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>getExamplesPost</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch examples for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>ExampleSearchQuery</dataType><description>Search definition object</description><paramType>body</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Specify the internal storage engine.</description><name>internalDataStore</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>exampleSearchResults</responseClass><summary>Fetches examples for a word</summary></operations><path>/word.{format}/{word}/examples</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addWordForm</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to add forms for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>suggestion</dataType><description>RelationshipMapWord to add</description><paramType>body</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Make this the Canonical form of the word.</description><name>canonical</name><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Adds a Relationship Map to a word</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getWordForms</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch forms for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><responseClass>relationshipMap</responseClass><summary>Returns other forms of a word</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>DELETE</httpMethod><nickname>deleteWordForm</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to delete forms from</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Relationship type to delete</description><name>type</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Target word to remove relationship from.</description><name>word</name><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Deletes a relationship from a word</summary></operations><path>/word.{format}/{word}/wordForms</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>String value of WordObject to return</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>Return suggestions (for correct spelling, case variants, etc.)</description><name>includeSuggestions</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Create word if not existing</description><name>shouldCreate</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>wordObject</responseClass><summary>Given a word as a string, returns the WordObject that represents it</summary></operations><path>/word.{format}/{word}</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No definitions found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getDefinitions</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return definitions for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>noun</allowableValues><allowableValues>adjective</allowableValues><allowableValues>verb</allowableValues><allowableValues>adverb</allowableValues><allowableValues>interjection</allowableValues><allowableValues>pronoun</allowableValues><allowableValues>preposition</allowableValues><allowableValues>abbreviation</allowableValues><allowableValues>affix</allowableValues><allowableValues>article</allowableValues><allowableValues>auxiliary-verb</allowableValues><allowableValues>conjunction</allowableValues><allowableValues>definite-article</allowableValues><allowableValues>family-name</allowableValues><allowableValues>given-name</allowableValues><allowableValues>idiom</allowableValues><allowableValues>imperative</allowableValues><allowableValues>noun-plural</allowableValues><allowableValues>noun-posessive</allowableValues><allowableValues>past-participle</allowableValues><allowableValues>phrasal-prefix</allowableValues><allowableValues>proper-noun</allowableValues><allowableValues>proper-noun-plural</allowableValues><allowableValues>proper-noun-posessive</allowableValues><allowableValues>suffix</allowableValues><allowableValues>verb-intransitive</allowableValues><allowableValues>verb-transitive</allowableValues><dataType>string</dataType><description>CSV list of part-of-speech types</description><name>partOfSpeech</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>true</allowableValues><allowableValues>false</allowableValues><dataType>string</dataType><description>Return related words with definitions</description><name>includeRelated</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Gets from dictionaries in the supplied order of precedence</description><name>sourceDictionaries</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>Return a closed set of XML tags in response</description><name>includeTags</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[definition]</responseClass><summary>Return definitions for a word</summary></operations><path>/word.{format}/{word}/definitions</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No stats available.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getWordStats</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return stats for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return detailed usage info</description><name>detailed</name><paramType>query</paramType><required>false</required></parameters><responseClass>wordStats</responseClass><summary>Returns word statistics</summary></operations><path>/word.{format}/{word}/stats</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getTopExample</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch examples for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return results from a specific ContentProvider</description><name>contentProvider</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Specify the internal storage engine.</description><name>internalDataStore</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>example</responseClass><summary>Returns a top example for a word</summary></operations><path>/word.{format}/{word}/topExample</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getPunctuationFactor</nickname><notes>Deprecated</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Input is case sensitive</description><name>caseSensitive</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><responseClass>punctuationFactor</responseClass><summary>Fetches other forms of a word</summary></operations><path>/word.{format}/{word}/punctuationFactor</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>contextualLookup</nickname><notes>Use the offset parameter when the word occurs more than once in the sentence</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return definitions for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>The sentence in which the word occurs</description><name>sentence</name><paramType>query</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>0 to 4096</allowableValues><dataType>int</dataType><defaultValue>-1</defaultValue><description>The start character offset of the word in the given sentence</description><name>offset</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>true</allowableValues><allowableValues>false</allowableValues><dataType>string</dataType><description>Expand context terms using related words</description><name>expandTerms</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Only include these comma-delimited source dictionaries</description><name>includeSourceDictionaries</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Exclude these comma-delimited source dictionaries</description><name>excludeSourceDictionaries</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>0 to 1000</allowableValues><dataType>string</dataType><defaultValue>0</defaultValue><description>Results to skip</description><name>skip</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>1 to 1000</allowableValues><dataType>string</dataType><defaultValue>10</defaultValue><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>DefinitionSearchResults</responseClass><summary>Returns definitions for a word based on the sentence in which it is found</summary></operations><operations><errorResponses><code>400</code><reason>Invalid term supplied.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>contextualLookupPost</nickname><notes>Use the offset parameter when the word occurs more than once in the sentence</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return definitions for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>The sentence in which the word occurs</description><paramType>body</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>0 to 4096</allowableValues><dataType>int</dataType><defaultValue>-1</defaultValue><description>The start character offset of the word in the given sentence</description><name>offset</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>true</allowableValues><allowableValues>false</allowableValues><dataType>string</dataType><description>Expand context terms using related words</description><name>expandTerms</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Only include these comma-delimited source dictionaries</description><name>includeSourceDictionaries</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Exclude these comma-delimited source dictionaries</description><name>excludeSourceDictionaries</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>0 to 1000</allowableValues><dataType>string</dataType><defaultValue>0</defaultValue><description>Results to skip</description><name>skip</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>1 to 1000</allowableValues><dataType>string</dataType><defaultValue>10</defaultValue><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>DefinitionSearchResults</responseClass><summary>Returns definitions for a word based on the sentence in which it is found</summary></operations><path>/word.{format}/{word}/contextualLookup</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getCommentCount</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get comment count for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns the number of comments on a word</summary></operations><path>/word.{format}/{word}/commentCount</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getCitations</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get citations for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[citation]</responseClass><summary>Returns citations for a word</summary></operations><path>/word.{format}/{word}/citations</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No definitions found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getRelatedWords</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word for which to return related words</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>noun</allowableValues><allowableValues>adjective</allowableValues><allowableValues>verb</allowableValues><allowableValues>adverb</allowableValues><allowableValues>interjection</allowableValues><allowableValues>pronoun</allowableValues><allowableValues>preposition</allowableValues><allowableValues>abbreviation</allowableValues><allowableValues>affix</allowableValues><allowableValues>article</allowableValues><allowableValues>auxiliary-verb</allowableValues><allowableValues>conjunction</allowableValues><allowableValues>definite-article</allowableValues><allowableValues>family-name</allowableValues><allowableValues>given-name</allowableValues><allowableValues>idiom</allowableValues><allowableValues>imperative</allowableValues><allowableValues>noun-plural</allowableValues><allowableValues>noun-posessive</allowableValues><allowableValues>past-participle</allowableValues><allowableValues>phrasal-prefix</allowableValues><allowableValues>proper-noun</allowableValues><allowableValues>proper-noun-plural</allowableValues><allowableValues>proper-noun-posessive</allowableValues><allowableValues>suffix</allowableValues><allowableValues>verb-intransitive</allowableValues><allowableValues>verb-transitive</allowableValues><dataType>string</dataType><description>CSV list of part-of-speech types</description><name>partOfSpeech</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues> century</allowableValues><allowableValues> wiktionary</allowableValues><allowableValues> webster</allowableValues><allowableValues> wordnet</allowableValues><dataType>string</dataType><description>Get data from a single dictionary</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>synonym</allowableValues><allowableValues>antonym</allowableValues><allowableValues>variant</allowableValues><allowableValues>equivalent</allowableValues><allowableValues>cross-reference</allowableValues><allowableValues>related-word</allowableValues><allowableValues>rhyme</allowableValues><allowableValues>form</allowableValues><allowableValues>etymologically-related-term</allowableValues><allowableValues>hypernym</allowableValues><allowableValues>hyponym</allowableValues><allowableValues>inflected-form</allowableValues><allowableValues>primary</allowableValues><allowableValues>same-context</allowableValues><allowableValues>verb-form</allowableValues><allowableValues>verb-stem</allowableValues><allowableValues>unknown</allowableValues><dataType>string</dataType><description>Relationship type</description><name>type</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[related]</responseClass><summary>Return related words (thesaurus data) for a word</summary></operations><path>/word.{format}/{word}/related</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied</reason></errorResponses><errorResponses><code>404</code><reason>Supplied user does not exist</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getListedIn</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch WordLists for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>rating</allowableValues><dataType>string</dataType><description>Specifies a sort parameter</description><name>sortBy</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>User to scope the request to</description><name>username</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[wordList]</responseClass><summary>Returns WordLists containing a word</summary></operations><path>/word.{format}/{word}/listedIn</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getListedInCount</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch count for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns a count of lists a word appears in</summary></operations><path>/word.{format}/{word}/listedInCount</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getFirstListedIn</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch a WordList for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>wordList</responseClass><summary>Returns the first WordList a word appeared in</summary></operations><path>/word.{format}/{word}/firstListedIn</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getFirstListedBy</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch a User for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>user</responseClass><summary>Returns the first User to list a particular word</summary></operations><path>/word.{format}/{word}/firstListedBy</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getTextPronunciations</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get pronunciations for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues>century</allowableValues><allowableValues>cmu</allowableValues><allowableValues>macmillan</allowableValues><allowableValues>wiktionary</allowableValues><allowableValues>webster</allowableValues><allowableValues>wordnet</allowableValues><dataType>string</dataType><description>Get from a single dictionary.</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues>arpabet</allowableValues><allowableValues>gcide-diacritical</allowableValues><allowableValues>IPA</allowableValues><dataType>string</dataType><description>Text pronunciation type</description><name>typeFormat</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[textPron]</responseClass><summary>Returns text pronunciations for a given word</summary></operations><path>/word.{format}/{word}/pronunciations</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getFlickrImages</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get flickr images for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>thumb</allowableValues><allowableValues>small</allowableValues><allowableValues>med</allowableValues><allowableValues>lg</allowableValues><allowableValues>orig</allowableValues><dataType>string</dataType><description>Image size</description><name>size</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[photo]</responseClass><summary>Returns Flickr images for a word</summary></operations><path>/word.{format}/{word}/images/flickr</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No scrabble score found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getScrabbleScore</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get scrabble score for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns the Scrabble score for a word</summary></operations><path>/word.{format}/{word}/scrabbleScore</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getHyphenation</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get syllables for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[syllable]</responseClass><summary>Returns syllable information for a word</summary></operations><path>/word.{format}/{word}/hyphenation</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getUnigramCountInternal</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get unigram count for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns syllable information for a word</summary></operations><path>/word.{format}/{word}/unigramCountInternal</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getBigramsInternal</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get bigrams for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Gamma filter</description><name>gamma</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>WLMI Limit</description><name>minWlmi</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[bigram]</responseClass><summary>Returns Bigrams for the given word</summary></operations><path>/word.{format}/{word}/phrasesInternal</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getLookupCount</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get Bigrams for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns the number of times a word has been viewed</summary></operations><path>/word.{format}/{word}/lookupCount</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getTagsOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch Tags on</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Restrict to a particular user</description><name>username</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[tag]</responseClass><summary>Fetches tags for a word</summary></operations><path>/word.{format}/{word}/tags</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getTagCountOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch Tag count on</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Restrict to a particular user</description><name>username</name><paramType>query</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Fetches tag count for a word</summary></operations><path>/word.{format}/{word}/tagCount</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addTagToWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to add a Tag to</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>CSV list of tags to add.</description><name>tags</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Add tag on behalf of a particular user</description><name>username</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Adds a tag to a word</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>DELETE</httpMethod><nickname>deleteTagFromWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to add a Tag to</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>CSV list of tags to remove.</description><name>tags</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Remove tag on behalf of a particular user</description><name>username</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Removes a tag from a word</summary></operations><path>/word.{format}/{word}/tag</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getWordFrequency</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Input is case sensitive</description><name>caseSensitive</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Starting Year</description><name>startYear</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Ending Year</description><name>endYear</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Get error bar data</description><name>includeErrorBars</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>frequencySummary</responseClass><summary>Returns word usage over time</summary></operations><path>/word.{format}/{word}/frequency</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getFirstUsageOfWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return first usage for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Return detailed usage info</description><name>detailed</name><paramType>query</paramType><required>false</required></parameters><responseClass>detailedWordUsage</responseClass><summary>Returns first usage of a word</summary></operations><path>/word.{format}/{word}/firstUsed</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addWordView</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to record a word view for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>ID of the user viewing the word</description><name>userId</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Tracking ID for the user</description><name>userGuid</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Session ID for the user</description><name>userSessionId</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Internal IP address of the web server</description><name>serverIp</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Page being viewed</description><name>pageName</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Method of the word view</description><name>method</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Browser user agent</description><name>userAgent</name><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Records a word view from the website</summary></operations><path>/word.{format}/{word}/wordView</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied</reason></errorResponses><errorResponses><code>404</code><reason>No user found</reason></errorResponses><httpMethod>GET</httpMethod><nickname>isFavorite</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to check</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Check for a particular user</description><name>userName</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>true</required></parameters><responseClass>BooleanValue</responseClass><summary>Checks to see if a word is a user's favorite</summary></operations><path>/word.{format}/{word}/isFavorite</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied</reason></errorResponses><errorResponses><code>404</code><reason>No user found</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getFavoriteCount</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to check</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Check for a particular user</description><name>userName</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>long</responseClass><summary>Returns the number of times a word has been Favorited</summary></operations><path>/word.{format}/{word}/favoriteCount</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No user found</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addWordToFavorites</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to favorite</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Add as favorite on behalf of a particular user</description><name>userName</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Favorites a Word for a user</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied or no user found.</reason></errorResponses><httpMethod>DELETE</httpMethod><nickname>deleteFromFavorites</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to remove</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Remove on behalf of a particular user</description><name>userName</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Removes a Word from a user's Favorites</summary></operations><path>/word.{format}/{word}/favorite</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getPhrases</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch phrases for</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Minimum WLMI for the phrase</description><name>wlmi</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[bigram]</responseClass><summary>Fetches bi-gram phrases for a word</summary></operations><path>/word.{format}/{word}/phrases</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No definitions found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getEtymologies</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues>webster</allowableValues><allowableValues>wiktionary</allowableValues><dataType>string</dataType><description>Get etymologies from a single dictionary. Options are ahd or century.</description><name>sourceDictionary</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>false</allowableValues><allowableValues>true</allowableValues><dataType>string</dataType><description>If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ahd</allowableValues><allowableValues>webster</allowableValues><allowableValues>wiktionary</allowableValues><dataType>string</dataType><description>Etymology type</description><name>type</name><paramType>query</paramType><required>false</required></parameters><responseClass>String</responseClass><summary>Fetches etymology data</summary></operations><path>/word.{format}/{word}/etymologies</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getOtherFormsInternal</nickname><notes>Deprecated</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Minimum corpus frequency</description><name>minFrequency</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[otherForms]</responseClass><summary>Fetches other forms of a word</summary></operations><path>/word.{format}/{word}/otherFormsInternal</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>404</code><reason>No results.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addWordRelationshipInternal</nickname><notes>Deprecated</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>relatedData</dataType><description>Relationship to add</description><paramType>body</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Adds a word relationship</summary></operations><path>/word.{format}/{word}/wordRelationshipInternal</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getCommentsOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to return Comments for</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><allowableValues>ascending</allowableValues><allowableValues>descending</allowableValues><dataType>string</dataType><defaultValue>descending</defaultValue><description>Direction to sort by</description><name>sortOrder</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Results to skip</description><name>skip</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[comment]</responseClass><summary>Fetches comments on a Word</summary></operations><path>/word.{format}/{word}/comments</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word or Comment supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word or commentor not found.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getCommentOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to fetch Comment for.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>ID of Comment to fetch.</description><name>commentId</name><paramType>path</paramType><required>false</required></parameters><responseClass>comment</responseClass><summary>Fetches a Comment by ID</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word or Comment supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word or commentor not found.</reason></errorResponses><httpMethod>DELETE</httpMethod><nickname>deleteCommentByIdOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to update Comment on.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Updated Comment.</description><name>commentId</name><paramType>path</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Deletes an existing word comment</summary></operations><path>/word.{format}/{word}/comment/{commentId}</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word or Comment supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word or commentor not found.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>commentOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to add Comment to.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>comment</dataType><description>Comment to add.</description><paramType>body</paramType><required>false</required></parameters><responseClass>comment</responseClass><summary>Adds a comment to a word</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word or Comment supplied.</reason></errorResponses><errorResponses><code>404</code><reason>Word or commentor not found.</reason></errorResponses><httpMethod>PUT</httpMethod><nickname>updateCommentOnWord</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to update Comment on.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>comment</dataType><description>Updated Comment.</description><paramType>body</paramType><required>false</required></parameters><responseClass>comment</responseClass><summary>Updates an existing word comment</summary></operations><path>/word.{format}/{word}/comment</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getAudio</nickname><notes>The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get audio for.</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the canonical form of the word.</description><name>useCanonical</name><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Use the V3 api.</description><name>v3Format</name><paramAccess>internal</paramAccess><paramType>query</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Maximum number of results to return</description><name>limit</name><paramType>query</paramType><required>false</required></parameters><responseClass>List[audioFile]</responseClass><summary>Fetches audio metadata for a word.</summary></operations><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>POST</httpMethod><nickname>addAudio</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to add audio to.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>audioObject</dataType><description>AudioPon metadata to add.</description><paramType>body</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Creates AudioPron metadata</summary></operations><path>/word.{format}/{word}/audio</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid pron id supplied.</reason></errorResponses><httpMethod>GET</httpMethod><nickname>getPronunciation</nickname><notes>The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.</notes><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to get audio for.</description><name>word</name><paramType>path</paramType><required>true</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Id to get audio for.</description><name>pronId</name><paramType>path</paramType><required>true</required></parameters><responseClass>audioFile</responseClass><summary>Fetches single audio pronunciation.</summary></operations><path>/word.{format}/{word}/pronunciation/{pronId}</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><httpMethod>PUT</httpMethod><nickname>updateAudioInternal</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>audio object to update</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>audioObject</dataType><description>Updated metadata.</description><paramType>body</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Internal method to update an audio object</summary></operations><path>/word.{format}/{word}/audioInternal</path></apis><apis><description></description><operations><errorResponses><code>400</code><reason>Invalid word supplied.</reason></errorResponses><errorResponses><code>401</code><reason>Unauthorized.</reason></errorResponses><httpMethod>DELETE</httpMethod><nickname>deleteAudio</nickname><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>Word to delete audio from.</description><name>word</name><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>string</dataType><description>AudioPon metadata to add.</description><name>audio_id</name><paramType>path</paramType><required>false</required></parameters><responseClass>ok</responseClass><summary>Deletes an AudioPron</summary></operations><path>/word.{format}/{word}/audio/{audio_id}</path></apis><basePath>url</basePath><resourcePath>/word</resourcePath><models/><swaggerVersion>1.0</swaggerVersion></ApiDocumentation>"
24
+ http_version: "1.1"
25
+ :@ignored: false
data/spec/wordnik_spec.rb CHANGED
@@ -10,72 +10,123 @@ describe Wordnik do
10
10
  after(:each) do
11
11
  end
12
12
 
13
- context "initialization" do
13
+ context 'initialization' do
14
+
15
+ context 'URL stuff' do
16
+
17
+ context 'host' do
18
+ it 'removes http from host' do
19
+ Wordnik.configure {|c| c.host = 'http://example.com' }
20
+ Wordnik.configuration.host.should == 'example.com'
21
+ end
22
+
23
+ it 'removes https from host' do
24
+ Wordnik.configure {|c| c.host = 'https://wookiee.com' }
25
+ Wordnik.configuration.host.should == 'wookiee.com'
26
+ end
14
27
 
15
- context "resources" do
16
- it "instantiates resources from cached JSON" do
28
+ it 'removes trailing path from host' do
29
+ Wordnik.configure {|c| c.host = 'hobo.com/v4' }
30
+ Wordnik.configuration.host.should == 'hobo.com'
31
+ end
32
+ end
33
+
34
+ context 'base_path' do
35
+ it "prepends a slash to base_path" do
36
+ Wordnik.configure {|c| c.base_path = 'v4/dog' }
37
+ Wordnik.configuration.base_path.should == '/v4/dog'
38
+ end
39
+
40
+ it "doesn't prepend a slash if one is already there" do
41
+ Wordnik.configure {|c| c.base_path = '/v4/dog' }
42
+ Wordnik.configuration.base_path.should == '/v4/dog'
43
+ end
44
+
45
+ it "ends up as a blank string if nil" do
46
+ Wordnik.configure {|c| c.base_path = nil }
47
+ Wordnik.configuration.base_path.should == ''
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
54
+ context 'resources' do
55
+ it 'instantiates resources from cached JSON' do
17
56
  Wordnik.resources.class.should == Hash
18
57
  Wordnik.resources[:word].class.should == Wordnik::Resource
19
58
  end
20
59
 
21
- it "has as many resources as there are resource names" do
60
+ it 'has as many resources as there are resource names' do
22
61
  Wordnik.resources.size.should == Wordnik.configuration.resource_names.size
23
62
  end
24
63
 
25
- it "assigns resource keys that match the resource names" do
64
+ it 'assigns resource keys that match the resource names' do
26
65
  Wordnik.resources[:word].name.should == :word
27
66
  end
28
67
 
29
68
  end
30
69
 
31
- context "authentication" do
70
+ context 'authentication' do
32
71
 
33
72
  before(:each) do
34
73
  end
35
74
 
36
- it "auto-authenticates at load time if username and password are present"
75
+ it 'auto-authenticates at load time if username and password are present'
37
76
 
38
- it "succeeds if a username and password are present in the configuration" do
39
- Wordnik.authenticate
77
+ it 'succeeds if a username and password are present in the configuration' do
78
+ VCR.use_cassette('wordnik_authenticate', :record => :new_episodes) do
79
+ Wordnik.authenticate
80
+ end
40
81
  Wordnik.authenticated?.should == true
41
82
  end
42
83
 
43
- it "de_authenticates" do
44
- Wordnik.authenticate
84
+ it 'de_authenticates' do
85
+ VCR.use_cassette('wordnik_authenticate', :record => :new_episodes) do
86
+ Wordnik.authenticate
87
+ end
45
88
  Wordnik.authenticated?.should == true
46
89
  Wordnik.de_authenticate
47
90
  Wordnik.authenticated?.should == false
48
91
  end
49
92
 
50
- it "fails if credentials are invalid" do
93
+ it 'fails if credentials are invalid' do
51
94
  Wordnik.de_authenticate
52
95
  Wordnik.configure do |config|
53
96
  config.api_key = CREDENTIALS[:api_key]
54
97
  config.username = CREDENTIALS[:username]
55
98
  config.password = 'wrong!'
56
- config.base_uri = "beta.wordnik.com/v4"
99
+ config.host = 'beta.wordnik.com'
100
+ config.base_path = '/v4'
101
+ end
102
+
103
+ VCR.use_cassette('wordnik_authenticate_fail', :record => :new_episodes) do
104
+ expect { Wordnik.authenticate }.to raise_error(ClientError)
57
105
  end
58
- expect { Wordnik.authenticate }.to raise_error(ClientError)
106
+
59
107
  Wordnik.authenticated?.should == false
108
+ configure_wordnik
60
109
  end
61
110
 
62
- it "fails if username and/or password are absent" do
111
+ it 'fails if username and/or password are absent' do
63
112
  Wordnik.de_authenticate
64
113
  Wordnik.configure do |config|
65
114
  config.api_key = CREDENTIALS[:api_key]
66
115
  config.username = nil
67
116
  config.password = nil
68
- config.base_uri = "beta.wordnik.com/v4"
117
+ config.host = 'beta.wordnik.com'
118
+ config.base_path = '/v4'
69
119
  end
70
120
  expect { Wordnik.authenticate }.to raise_error(ClientError, /username and password are required/i)
71
121
  Wordnik.authenticated?.should == false
122
+ configure_wordnik
72
123
  end
73
124
 
74
125
  end
75
126
 
76
127
  end
77
128
 
78
- it "maps shorthand Wordnik.resource calls to their resources" do
129
+ it 'maps shorthand Wordnik.resource calls to their resources' do
79
130
  Wordnik.word.class.should == Wordnik::Resource
80
131
  Wordnik.word.name.should == :word
81
132
  end
data/wordnik.gemspec CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency 'rspec', '>=2.5.0'
25
25
  s.add_development_dependency 'vcr', '>=1.5.1'
26
26
  s.add_development_dependency 'webmock', '>=1.6.2'
27
+ s.add_development_dependency 'autotest'
28
+ s.add_development_dependency 'autotest-rails-pure'
27
29
 
28
30
  s.files = [
29
31
  `git ls-files`,
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wordnik
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 4.06.05
5
+ version: 4.06.06
6
6
  platform: ruby
7
7
  authors:
8
8
  - Zeke Sikelianos
@@ -11,8 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-08-15 00:00:00 -07:00
15
- default_executable:
14
+ date: 2011-08-29 00:00:00 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: typhoeus
@@ -113,6 +112,28 @@ dependencies:
113
112
  version: 1.6.2
114
113
  type: :development
115
114
  version_requirements: *id009
115
+ - !ruby/object:Gem::Dependency
116
+ name: autotest
117
+ prerelease: false
118
+ requirement: &id010 !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: "0"
124
+ type: :development
125
+ version_requirements: *id010
126
+ - !ruby/object:Gem::Dependency
127
+ name: autotest-rails-pure
128
+ prerelease: false
129
+ requirement: &id011 !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: "0"
135
+ type: :development
136
+ version_requirements: *id011
116
137
  description: This gem provides a simple interface to the entire Wordnik API. Its methods are defined by the documentation that comes from the API itself, so it's guaranteed to be up to date.
117
138
  email:
118
139
  - zeke@wordnik.com
@@ -125,6 +146,7 @@ extra_rdoc_files: []
125
146
 
126
147
  files:
127
148
  - .gitignore
149
+ - .rspec
128
150
  - .rspec-tm
129
151
  - Gemfile
130
152
  - Gemfile.lock
@@ -132,9 +154,13 @@ files:
132
154
  - Rakefile
133
155
  - api_docs/.gitkeep
134
156
  - api_docs/account.json
157
+ - api_docs/analytics.json
135
158
  - api_docs/corpus.json
136
159
  - api_docs/document.json
160
+ - api_docs/partner.json
137
161
  - api_docs/partners.json
162
+ - api_docs/suggest.json
163
+ - api_docs/system.json
138
164
  - api_docs/tag.json
139
165
  - api_docs/user.json
140
166
  - api_docs/users.json
@@ -152,9 +178,13 @@ files:
152
178
  - lib/wordnik/resource.rb
153
179
  - lib/wordnik/resource_modules/.gitkeep
154
180
  - lib/wordnik/resource_modules/account.rb
181
+ - lib/wordnik/resource_modules/analytics.rb
155
182
  - lib/wordnik/resource_modules/corpus.rb
156
183
  - lib/wordnik/resource_modules/document.rb
184
+ - lib/wordnik/resource_modules/partner.rb
157
185
  - lib/wordnik/resource_modules/partners.rb
186
+ - lib/wordnik/resource_modules/suggest.rb
187
+ - lib/wordnik/resource_modules/system.rb
158
188
  - lib/wordnik/resource_modules/tag.rb
159
189
  - lib/wordnik/resource_modules/user.rb
160
190
  - lib/wordnik/resource_modules/users.rb
@@ -173,9 +203,15 @@ files:
173
203
  - spec/response_spec.rb
174
204
  - spec/spec.opts
175
205
  - spec/spec_helper.rb
206
+ - spec/vcr/crazier_json_request.yml
207
+ - spec/vcr/default_response.yml
208
+ - spec/vcr/get_word_dynamo.yml
209
+ - spec/vcr/unauthorized_response.yml
210
+ - spec/vcr/wordnik_authenticate.yml
211
+ - spec/vcr/wordnik_authenticate_fail.yml
212
+ - spec/vcr/xml_response_request.yml
176
213
  - spec/wordnik_spec.rb
177
214
  - wordnik.gemspec
178
- has_rdoc: true
179
215
  homepage: http://developer.wordnik.com
180
216
  licenses: []
181
217
 
@@ -199,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
235
  requirements: []
200
236
 
201
237
  rubyforge_project: wordnik
202
- rubygems_version: 1.5.1
238
+ rubygems_version: 1.8.10
203
239
  signing_key:
204
240
  specification_version: 3
205
241
  summary: A ruby wrapper for the Wordnik API
@@ -213,4 +249,11 @@ test_files:
213
249
  - spec/response_spec.rb
214
250
  - spec/spec.opts
215
251
  - spec/spec_helper.rb
252
+ - spec/vcr/crazier_json_request.yml
253
+ - spec/vcr/default_response.yml
254
+ - spec/vcr/get_word_dynamo.yml
255
+ - spec/vcr/unauthorized_response.yml
256
+ - spec/vcr/wordnik_authenticate.yml
257
+ - spec/vcr/wordnik_authenticate_fail.yml
258
+ - spec/vcr/xml_response_request.yml
216
259
  - spec/wordnik_spec.rb