From b4a280c55c635e940d8b17054bbd95682b368341 Mon Sep 17 00:00:00 2001 From: zj3D Date: Sat, 16 Mar 2024 20:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=94=B3=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工程化/类型申明/{tf-24.py => 24A.py} | 0 工程化/类型申明/24B.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) rename 工程化/类型申明/{tf-24.py => 24A.py} (100%) create mode 100644 工程化/类型申明/24B.py 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