Parameters


Default Parameters

Most of the modules within WordHoard have several parameters that are configurable.

The default parameters in the Antonyms, Definitions, Hypernyms, Hyponyms and Synonyms modules are.

from wordhoard import Synonyms

synonym = Synonyms(search_string='',
                   output_format='list',
                   max_number_of_requests=30,
                   rate_limit_timeout_period=60,
                   user_agent=None,
                   proxies=None)
  • search_string:
    • type: string
    • String containing the variable to search for
  • output_format:
    • type: string
    • String containing the requested output format
    • Acceptable values: dictionary, list and json
  • max_number_of_requests:
    • type: int
    • Maximum number of requests for a specific timeout_period, which is defined in the variable rate_limit_timeout_period
    • default value: 30
  • rate_limit_timeout_period:
    • type: int
    • The time period in seconds before a session is placed in a temporary hibernation mode
    • default value: 60
    • user_agent:
      • type: string
      • default value: None
  • proxies:
    • type: dictionary
    • Dictionary of proxies to use with Python Requests
    • default value: None

Source Parameters

The modules Antonyms, Definitions and Synonyms also have a sources parameters. This parameter can be modified to restrict the sources being queried.

  • Antonyms
    • sources = ['google', 'thesaurus.com', 'wordhippo']
  • Definitions
    • sources = ['collins', 'merriam-webster', 'synonym.com', 'thesaurus.com']
  • Synonyms
    • sources = ['collins', 'merriam-webster', 'synonym.com', 'thesaurus.com', 'wordnet']

This sources parameter can be modified to restrict the sources being queried. For instance the example below removes Collins Dictionary as a search source when querying for Synonyms for the word mother.

from wordhoard import Synonyms

synonym = Synonyms(search_string='mother',
                   output_format='list',
                   sources = ['merriam-webster', 'synonym.com', 'thesaurus.com', 'wordnet'],
                   max_number_of_requests=30,
                   rate_limit_timeout_period=60,
                   user_agent=None,
                   proxies=None)