# COUNT PROJECT **Repository Path**: wangbo2714/count-project ## Basic Information - **Project Name**: COUNT PROJECT - **Description**: No description available - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-25 - **Last Updated**: 2024-10-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: 第二次作业 ## README # COUNT PROJECT ## 项目介绍 本项目是软件技术基础的第二次作业 ## 功能说明 本软件可以自动统计txt文件中纯英文语段的字符、单词和句子数量,使用Python的unittest库完成单元测试功能 ## 使用说明 ### 1.在版本文件文件夹如"V0.2"文件夹下打开命令行窗口 ### 2.命令模式: wc.exe [参数] [文件名] count.exe -c file.txt 统计字符数 count.exe -w file.txt 统计单词数 count.exe -s file.txt 统计句子数 count.exe -line Source/count.py 统计代码行数 count.exe -emp Source/count.py 统计空白行数 count.exe -cmt Source/count.py 统计注释行数 ### 3.单元测试:在UnitTest文件夹中打开命令行窗口,输入CountUnitTest.exe执行即可 ## 注意事项 #### 受Windows系统限制,使用命令前需要加上./ #### 使用V0.3的统计行数命令时,需要加上Source/进入子文件夹 #### 务必在exe文件所在的文件夹下打开命令行窗口 #### 若修改txt文件务必保证格式正确且全部为英文 ## 文件列表 File:存放所有版本及其文件的主文件夹 Vx.x: 分别存放各个版本文件的文件夹 Source:存放程序源码 UnitTest:单元测试文件 count.exe:可执行文件,需要使用命令行打开 testx.txt:测试文档 test.png:运行结果截图 ## 例程测试 test1测试数据: In the quiet of the night, beneath the silver glow of the moon, love blooms like a rare flower. Heartbeats echo in the silence, each pulse a testament to deep longing. The stars, like distant dreams, twinkle above, whispering secrets to the winds. Each glance shared between lovers ignites a spark, igniting a fire that neither time nor distance can extinguish. Yet, with joy comes the shadow of sorrow, for the heart knows both bliss and pain. In this dance of fate, passion reigns supreme, weaving stories that transcend the ages, forever etched in the tapestry of time. V0.1: 无 V0.2: INPUT:./count.exe -c test1.txt OUTPUT:字符数: 572 INPUT:./count.exe -w test1.txt OUTPUT:单词数: 98 INPUT:./count.exe -s test1.txt OUTPUT:句子数: 6 V0.3: 在V0.2的基础上加入以下功能 INPUT:./count.exe -line Source/count.py OUTPUT:代码总行数: 85 INPUT:./count.exe -emp Source/count.py OUTPUT:空行数: 23 INPUT:./count.exe -cmt Source/count.py OUTPUT:注释行数: 12