diff --git a/一盘大棋/A03.py b/一盘大棋/A03.py index e69de29..15b6479 100644 --- a/一盘大棋/A03.py +++ b/一盘大棋/A03.py @@ -0,0 +1,13 @@ +import re, sys, collections +from cppy.cp_util import * + +stopwords = set(open( stopwordfilepath,encoding = 'utf8' ).read().split(',')) +words = re.findall('[a-z]{2,}', open( testfilepath,encoding = 'utf8').read().lower()) +counts = collections.Counter(w for w in words if w not in stopwords) +for (w, c) in counts.most_common(10): + print(w, '-', c) + +''' +熟练的软件工程师,会如此简单完成任务 +后面的例子,我们必须变的啰嗦一些,不能用这种太 hacker 的写法 +''' \ No newline at end of file diff --git a/基本结构/031 对象化/tf-11.py b/基本结构/031 对象化/A21.py similarity index 100% rename from 基本结构/031 对象化/tf-11.py rename to 基本结构/031 对象化/A21.py diff --git a/基本结构/031 对象化/tf-13.py b/基本结构/031 对象化/A22.py similarity index 100% rename from 基本结构/031 对象化/tf-13.py rename to 基本结构/031 对象化/A22.py diff --git a/计算设备/注册回调/tf-15.py b/语言特性/注册回调/tf-15.py similarity index 100% rename from 计算设备/注册回调/tf-15.py rename to 语言特性/注册回调/tf-15.py diff --git a/计算设备/注册回调_订阅制/tf-16.py b/语言特性/注册回调_订阅制/tf-16.py similarity index 100% rename from 计算设备/注册回调_订阅制/tf-16.py rename to 语言特性/注册回调_订阅制/tf-16.py diff --git a/计算设备/消息驱动的对象/tf-12.py b/语言特性/消息驱动的对象/tf-12.py similarity index 100% rename from 计算设备/消息驱动的对象/tf-12.py rename to 语言特性/消息驱动的对象/tf-12.py diff --git a/计算设备/消息驱动的对象_线程独立/tf-29.py b/语言特性/消息驱动的对象_线程独立/tf-29.py similarity index 100% rename from 计算设备/消息驱动的对象_线程独立/tf-29.py rename to 语言特性/消息驱动的对象_线程独立/tf-29.py