203
社区成员
这个作业属于那个课程 | 广工软件工程课程学习社区 |
---|---|
这个作业要求在哪里 | 个人项目作业-论文查重 |
这个作业的目标 |
1.PSP表格的制作 2.编写代码实现论文查重的需求 3.进行对工程的单元测试、性能分析等 4.掌握使用github管理代码文件 |
github.com/805557409/805557409/tree/2
题目:论文查重
描述如下:
设计一个论文查重算法,给出一个原文文件和一个在这份原文上经过了增删改的抄袭版论文的文件,在答案文件中输出其重复率。
原文示例:今天是星期天,天气晴,今天晚上我要去看电影。
抄袭版示例:今天是周天,天气晴朗,我晚上要去看电影。
要求输入输出采用文件输入输出,规范如下:
从命令行参数给出:论文原文的文件的绝对路径。
从命令行参数给出:抄袭版论文的文件的绝对路径。
从命令行参数给出:输出的答案文件的绝对路径。
PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
planning | 计划 | 20 | 20 |
· Estimate | · 估计这个任务需要多少时间 | 875 | 1215 |
Development | 开发 | 50 | 40 |
· Analysis | · 需求分析 (包括学习新技术) | 120 | 200 |
· Design Spec | · 生成设计文档 | 120 | 150 |
· Design Review | · 设计复审 | 10 | 25 |
· Coding Standard | · 代码规范 (为目前的开发制定合适的规范) | 40 | 50 |
· Design | · 具体设计 | 60 | 60 |
· Coding | · 具体编码 | 100 | 150 |
· Code Review | · 代码复审 | 300 | 350 |
· Test | · 测试(自我测试,修改代码,提交修改) | 120 | 60 |
Reporting | 报告 | 30 | 60 |
· Test Repor | · 测试报告 | 10 | 20 |
· Size Measurement | · 计算工作量 | 10 | 20 |
· Postmortem & Process Improvement Plan | · 事后总结, 并提出过程改进计划 | 5 | 10 |
· 合计 | 875 | 1215 |
5.模块分类
1.文件读写模块
2.相似度计算模块
3.参数检测模块
4.性能分析模块
1.文件读写模块
public class ReadTxtTest {
public void readTest() {
// 路径存在,正常读取
String str = ReadTxt.read("D:/test/orig.txt");
String[] strings = str.split(" ");
for (String string : strings) {
System.out.println(string);
}
}
public void readFail() {
// 路径不存在,读取失败
String str = ReadTxt.read("D:/test/none.txt");
}
}
2.相似度计算模块
def cal_sim(t1,t2):
from difflib import SequenceMatcher
ratio =SequenceMatcher(lambda x: x=="[a-zA-Z0-9\u4e00-\u9fa5]",t1,t2).ratio()
return ratio
3.参数检测模块
def parameter_check(add):
if len(add)!=4:
print("输入参数不匹配")
4.性能分析模块
8797016 function calls (8797002 primitive calls) in 3.229 seconds
Ordered by: standard name