Package pywikipedia :: Module wiktionary :: Class Meaning
[show private | hide private]
[frames | no frames]

Class Meaning


This class contains one meaning for a word or an expression.
Method Summary
  __init__(self, term, definition, etymology, synonyms, translations)
Constructor...
  addTranslation(self, translation)
Add a translation Term object to the dictionary for this meaning The lang property of the Term object will be used as the key of the dictionary
  getDefinition(self)
Returns the definition
  getEtymology(self)
Returns the etymology
  getSynonyms(self)
Returns the list of synonym Term objects
  getTranslations(self)
Returns the translations dictionary containing translation Term objects for this meaning
  hasSynonyms(self)
Returns True if there are synonyms Returns False if there are no synonyms
  hasTranslations(self)
Returns True if there are translations Returns False if there are no translations
  setDefinition(self, definition)
Provide a definition
  setEtymology(self, etymology)
Provide the etymology
  setSynonyms(self, synonyms)
Provide the synonyms
  setTranslations(self, translations)
Provide the translations
  showcontents(self, indentation)
Prints the contents of this meaning.
  wikiwrapSynonyms(self, wikilang)
Returns a string with all the synonyms in a format ready for Wiktionary
  wikiwrapTranslations(self, wikilang, entrylang)
Returns a string with all the translations in a format ready for Wiktionary The behavior changes with the circumstances.

Method Details

__init__(self, term, definition='', etymology='', synonyms=[], translations={})
(Constructor)

Constructor
Generally called with one parameter:
- The Term object we are describing

- definition (string) for this term is optional
- etymology (string) is optional
- synonyms (list of Term objects) is optional
- translations (dictionary of Term objects, ISO639 is the key) is optional

addTranslation(self, translation)

Add a translation Term object to the dictionary for this meaning The lang property of the Term object will be used as the key of the dictionary

getDefinition(self)

Returns the definition

getEtymology(self)

Returns the etymology

getSynonyms(self)

Returns the list of synonym Term objects

getTranslations(self)

Returns the translations dictionary containing translation Term objects for this meaning

hasSynonyms(self)

Returns True if there are synonyms Returns False if there are no synonyms

hasTranslations(self)

Returns True if there are translations Returns False if there are no translations

setDefinition(self, definition)

Provide a definition

setEtymology(self, etymology)

Provide the etymology

setSynonyms(self, synonyms)

Provide the synonyms

setTranslations(self, translations)

Provide the translations

showcontents(self, indentation)

Prints the contents of this meaning. Every subobject is indented a little further on the screen. The primary purpose is to help keep your sanity while debugging.

wikiwrapSynonyms(self, wikilang)

Returns a string with all the synonyms in a format ready for Wiktionary

wikiwrapTranslations(self, wikilang, entrylang)

Returns a string with all the translations in a format ready for Wiktionary
The behavior changes with the circumstances.
For an entry in the same language as the Wiktionary the full list of translations is output, excluding the local language itself
- This list of translations has to end up in a table with two columns
- The first column of this table contains language with names from A to M, the second contains N to Z
- If a column in this list remains empty a html comment is put in that column
For an entry in a foreign language only the translation towards the local language is output.

Generated by Epydoc 2.1 on Sun Jul 03 17:07:34 2005 http://epydoc.sf.net