diff --git a/工程化/类型申明/tf-24.py b/工程化/类型申明/24A.py similarity index 100% rename from 工程化/类型申明/tf-24.py rename to 工程化/类型申明/24A.py diff --git a/工程化/类型申明/24B.py b/工程化/类型申明/24B.py new file mode 100644 index 0000000..6a55900 --- /dev/null +++ b/工程化/类型申明/24B.py @@ -0,0 +1,16 @@ +import cppy.cp_util as util + + +def extract_words(path_to_file:str) -> list: + return util.extract_file_words(path_to_file) + +def frequencies( word_list:list ) -> dict : + return util.get_frequencies(word_list) + +def sort(word_freq:dict) -> list : + return util.sort_dict(word_freq) + + +if __name__ == "__main__": + word_freqs = sort( frequencies(extract_words( util.testfilepath )) ) + util.print_word_freqs(word_freqs) \ No newline at end of file