Make the constructor take a func already
This commit is contained in:
@@ -5,8 +5,8 @@ import sys, re, operator, string
|
|||||||
# The Quarantine class for this example
|
# The Quarantine class for this example
|
||||||
#
|
#
|
||||||
class TFQuarantine:
|
class TFQuarantine:
|
||||||
def __init__(self):
|
def __init__(self, func):
|
||||||
self._funcs = []
|
self._funcs = [func]
|
||||||
|
|
||||||
def bind(self, func):
|
def bind(self, func):
|
||||||
self._funcs.append(func)
|
self._funcs.append(func)
|
||||||
@@ -68,7 +68,6 @@ def top25_freqs(word_freqs):
|
|||||||
#
|
#
|
||||||
# The main function
|
# The main function
|
||||||
#
|
#
|
||||||
quarantine = TFQuarantine()
|
quarantine = TFQuarantine(get_input).bind(extract_words).bind(remove_stop_words).bind(frequencies).bind(sort).bind(top25_freqs)
|
||||||
quarantine.bind(get_input).bind(extract_words).bind(remove_stop_words).bind(frequencies).bind(sort).bind(top25_freqs)
|
|
||||||
quarantine.execute()
|
quarantine.execute()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user