Package spoonerism :: Module spoonerism :: Class Word
[hide private]
[frames] | no frames]

Class Word

source code

object --+
         |
        Word

The class Word represents Finnish words that can be transformed according to the rules of a Finnish spoonerism.


See Also: Spoonerism

Instance Methods [hide private]
 
__init__(self, word_as_string)
Creates a new word object based on a given string.
source code
 
transform(self, other_word)
Derives a transformation of this word by exchanging its initial letters and by assimilating vowels according to the rules of word transformations.
source code
 
__str__(self)
Returns this word as a lowercase string.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, word_as_string)
(Constructor)

source code 

Creates a new word object based on a given string.

Parameters:
  • word_as_string - the word as a regular string
Overrides: object.__init__

transform(self, other_word)

source code 

Derives a transformation of this word by exchanging its initial letters and by assimilating vowels according to the rules of word transformations.

Parameters:
  • other_word - another word to use as a source of initial letters
Returns:
the result of the transformation

__str__(self)
(Informal representation operator)

source code 

Returns this word as a lowercase string.

Returns:
the word
Overrides: object.__str__