pycrossword  0.2
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | List of all members
pycross.utils.onlineservices.MWDict Class Reference
Inheritance diagram for pycross.utils.onlineservices.MWDict:
pycross.utils.onlineservices.OnlineDictionary

Public Member Functions

def __init__ (self, settings, timeout=5000)
 
def prepare_request_url (self, word)
 
def get_short_defs (self, word, exact_match=True, partsofspeech=None, bad_pos='UNKNOWN')
 
- Public Member Functions inherited from pycross.utils.onlineservices.OnlineDictionary
def __init__ (self, settings, url_template='', timeout=5000)
 
def get_definitions (self, word, method='json')
 

Additional Inherited Members

- Public Attributes inherited from pycross.utils.onlineservices.OnlineDictionary
 url
 
 timeout
 
 settings
 

Constructor & Destructor Documentation

◆ __init__()

def pycross.utils.onlineservices.MWDict.__init__ (   self,
  settings,
  timeout = 5000 
)

Member Function Documentation

◆ get_short_defs()

def pycross.utils.onlineservices.MWDict.get_short_defs (   self,
  word,
  exact_match = True,
  partsofspeech = None,
  bad_pos = 'UNKNOWN' 
)
Returns the abridged definition for the given entry.
Params:
- word [str]: the word query
- exact_match [bool]: if True, only defitions for the exact word given by 'word' will be returned
- partsofspeech [list or tuple]: parts of speech to get definitions for
(None = all available)
- bad_pos [str]: substitution for part of speech if unavailable        
Returns:
- list of short definitions in the format:
[('word', 'part of speech', [list of defs], 'url'), ...]

Reimplemented from pycross.utils.onlineservices.OnlineDictionary.

◆ prepare_request_url()

def pycross.utils.onlineservices.MWDict.prepare_request_url (   self,
  word 
)

The documentation for this class was generated from the following file: