|
|
@ -21,8 +21,7 @@ class ConcreteWordFrequencyController(WordFrequencyController):
|
|
|
|
self.word_freq = get_frequencies(self.word_list)
|
|
|
|
self.word_freq = get_frequencies(self.word_list)
|
|
|
|
self.word_freq = sort_dict(self.word_freq)
|
|
|
|
self.word_freq = sort_dict(self.word_freq)
|
|
|
|
def print_word_freqs(self, number):
|
|
|
|
def print_word_freqs(self, number):
|
|
|
|
for (w, c) in self.word_freq[:number]:
|
|
|
|
print_word_freqs( self.word_freq,number)
|
|
|
|
print(w, '-', c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#定义享元工厂
|
|
|
|
#定义享元工厂
|
|
|
|
class WordFrequencyControllerFactory():
|
|
|
|
class WordFrequencyControllerFactory():
|
|
|
|