LibInsult - Python
Public Member Functions | Public Attributes | List of all members
insult.WordList Class Reference

A list of insulting words of some kind. More...

Inheritance diagram for insult.WordList:
[legend]
Collaboration diagram for insult.WordList:
[legend]

Public Member Functions

def __init__ (self, id, words=[])
 
def add_word (self, word)
 Appends a word to the list. More...
 
def get (self, max_count=1, min_count=None)
 Retrieves a random subset of words. More...
 
def check_flags (self, flags)
 Checks if the flags match. More...
 

Public Attributes

 name
 Name of the word list. More...
 
 words
 Set of words in the list. More...
 
 flags
 Flags fot the set of words. More...
 

Detailed Description

A list of insulting words of some kind.

Definition at line 22 of file insult.py.

Constructor & Destructor Documentation

def insult.WordList.__init__ (   self,
  id,
  words = [] 
)
Parameters
idA WordListId (expanded with word_list_id())
wordsAn iterable containing words to add to the list

Definition at line 27 of file insult.py.

Member Function Documentation

def insult.WordList.add_word (   self,
  word 
)

Appends a word to the list.

Definition at line 42 of file insult.py.

def insult.WordList.check_flags (   self,
  flags 
)

Checks if the flags match.

Todo:

Definition at line 61 of file insult.py.

def insult.WordList.get (   self,
  max_count = 1,
  min_count = None 
)

Retrieves a random subset of words.

Parameters
max_countMaximum number of words to return
min_countMinimum number of words to return, if omitted, returns exactly max_count words

Definition at line 48 of file insult.py.

Referenced by insult.Insulter.format().

Member Data Documentation

insult.WordList.flags

Flags fot the set of words.

Todo:
Note
Two word lists can have the same name iff they have different flags

Definition at line 40 of file insult.py.

Referenced by insult.WordListId.check().

insult.WordList.name

Name of the word list.

Definition at line 35 of file insult.py.

Referenced by insult.WordListId.check().

insult.WordList.words

Set of words in the list.

Definition at line 37 of file insult.py.

Referenced by insult.WordList.get().


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