Work requirements | https://edu.cnblogs.com/campus/jssf/infor_computation17-31/homework/10534 |
---|---|
My aim in this course is | Learn to cooperate, Chinese text word frequency statistics |
This job helped me in terms of what specific goals | Test code, run code allows me to better understand the contents of this course |
references | https://www.cnblogs.com/guoming0000/archive/2012/06/13/2548350.html https://blog.csdn.net/qq_44174481/article/details/95921514?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2 https://blog.csdn.net/sand8o8time/article/details/81412661?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-6 |
Cloud link code | https://gitee.com/yuan_jia_hao/learngit.git |
Job 1
Each person twice for the job before the code is written, the requirements for, and follow the code specifications (style specifications, design specifications) requires students to judge other programs, and code review (code reuse according to the audit table https: //www.cnblogs .com / xinz / archive / 2011/ 11/20 / 2255971.html), the number of evaluations required no less than eight passengers,
evaluation content directly on your job back comments are evaluated in
the same time another set up a blog, you will make the reviews screenshot or link on the blog, and talk about their overall view in your blog,
to sum up
The provisions of the code is the code specifications must comply with certain conditions. With the specification when the code will look beautiful and easy to understand, code review as well as the role of the exchange and dissemination.
Operation two
They team up to pair programming freedom
Reference pair programming, process ( https://www.cnblogs.com/xinz/archive/2011/08/07/2130332.html) carry out two have worked together to complete this project
to achieve a simple and complete software tool (the Chinese version file character statistics program): for the novel "Dream of Red Mansions" requirement can analyze the various characters come to the number of times each chapter gyrus respective arise, these statistics can be written to a csv file format.
Unit test, regression test, performance test, the use of associated tools in the course of achieving the above program.
To practice Personal Software Process (PSP), and gradually record their own time spent in each part of software engineering.
The use of source code management system (GitHub, Gitee, Coding.net, etc.);
for the formation of the above-mentioned software programs, new text for the novel "Water Margin" analysis of the various chapters figures occurrences, to examine the code.
The above program development process of pair programming to record a new blog, especially the need to show the pair programming process through various forms, and procedures for obtaining the "Dream of Red Mansions" and "Water Margin" section of each character and the number of occurrences of this character appears always full number, to show by bar graphs, pie charts, tables and other forms.
"Dream of Red Mansions" and "Water Margin" fiction text will be sent to the group.
Note that the requirements of sub-section can automatically figure occurrences
clc;
close all;
dirs = dir('D:\homebook\honglou.txt');%*号是通配符,读取当前路径下的所有的txt文件
writein = fopen('result.txt','a');%这里是新开一个文本文件供写入结果
%dircell=struct2cell(dirs)';%结构体转换成元胞数组,并将结果转置一下,让第一列全为文件名
%filenames = dircell(:,1);%(:,1)代表所有行的第一列
for j = 1:120 %这里之所以设为120,是因为红楼梦一共120章啊,哈哈
%fid = dlmread(['D:\homebook\honglou.txt',dirs(j).name],''0,1)
fid = fopen(dirs(j).name,'r');
if fid == -1
disp('Can not open the file');
return
end
dict = char('贾宝玉','宝玉','通灵宝玉','林黛玉','黛玉','薛宝钗','宝钗','王熙凤','凤丫头','凤姐','史湘云','湘云','秦可卿','秦氏','妙玉','贾迎 春','迎春','贾巧姐','巧姐','贾惜春','惜春','贾元春','元春','贾探春','探春','李纨','李氏'); %字典,你要查找的关键字
freq = zeros(size(dict,1),1);%频率
while(~feof(fid))
aLine = fgetl(fid);
disp(aLine)
for i = 1:size(dict,1)%deblank使用原因:词语长度不一,dict生成时,会在短的词语后面加空格,查找的时候必须去掉,否则搜索不到
re = strfind(aLine,deblank(dict(i,:)));%strfind函数可以返回查找对象的位置
freq(i) = freq(i) + length(re);
end
end
for i = 1:size(dict,1)
disp([dict(i,:),'出现次数:',num2str(freq(i))])
fprintf(writein,'%s ',num2str(freq(i)));
end
fprintf(writein,'\n');
fclose(fid);
end
PSP | Personal Software Process Stages | Estimated time consuming | The actual time-consuming |
---|---|---|---|
Planning | plan | 6h | 12h |
Estimate | Estimate how much time this task requires | one week | Two weeks |
Development | Develop | one week | one week |
Analysis | demand analysis | 48h | 72h |
Coding Standard | Code Specification | 1 hour | 4 hours |
Design | Specific design | 24h | 48h |
Coding | Specific coding | 48h | 120h |
Code Review | Code Review | 2h | 3h |
Test Test | 1h | 2h | |
Reporting | report | 1h | 1.5h |
With a total time | --- | Two weeks | Two weeks |