Package tipy :: Module stpl :: Class StopList
[hide private]
[frames] | no frames]

Class StopList

source code

object --+
         |
        StopList

Stoplist classes holding every words of the stoplist(s).

The program's predictors test every suggested words against the stoplist. If a suggested word is a stoplist word then the suggested word is not added to the suggested words list.

Class Hierarchy for StopList
Class Hierarchy for StopList

Instance Methods [hide private]
 
__init__(self, stopListFile)
Extract every words of the file and store them in a list.
source code
 
add_words(self, wordList)
Add words to the stoplist.
source code
 
add_word(self, word)
Add a word to the stoplist.
source code
 
remove_words(self, wordList)
Remove words from the stoplist.
source code
 
remove_word(self, word)
Remove a word from the stoplist.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stopListFile)
(Constructor)

source code 

Extract every words of the file and store them in a list.

The file must contains one word per line. The method dosen't lower any word.

Parameters:
  • stopListFile (str) - Path to the stoplist file.
Overrides: object.__init__

add_words(self, wordList)

source code 

Add words to the stoplist.

Parameters:
  • wordList (list) - The words to add.

add_word(self, word)

source code 

Add a word to the stoplist.

Parameters:
  • word (str) - The word to add.

remove_words(self, wordList)

source code 

Remove words from the stoplist.

Parameters:
  • wordList (list) - The words to remove.

remove_word(self, word)

source code 

Remove a word from the stoplist.

Parameters:
  • word (str) - The word to remove.