搜档网
当前位置:搜档网 › 单词统计程序 C++

单词统计程序 C++

单词统计程序 C++
单词统计程序 C++

单词统计

问题描述

文字研究人员需要统计某篇英文小说中某些特定单词的出现次数和位置,试写出一个实现这一目标的文字统计系统。这称为“文学研究助手”。

要求

算法输入:文本文件和词集。

算法输出:单词出现的次数,出现位置所在行的行号(同一行出现两次的只输出一个行号)。

算法要点:

(1)文本串非空且以文件形式存放。

(2)单词定义:用字母组成的字符序列,中间不含空格,不区分大小写。

(3)待统计的单词不跨行出现,它或者从行首开始,或者前置一个空格。

(4)数据结构采用二维链表,单词结点链接成一个链表,每个单词的行号组成一个链表,单词结点作为行号链表的头结点。

需求分析

用户需求:用户可以通过该程序查询和统计一篇英文文章中某些特定单词出现次数和位置。

功能需求:用户可以输入单词来查询单词出现次数和位置;

程序可以正确显示查询结果;

用户可以选择是否在一次输出后继续查询;

在一次查询中的结果记录到一个二维链表中。

概要设计

为达到设计要求,本程序采用二维链表存储单词结点和相关的位置信息。

抽象数据类型:

struct node

{

int col; //行坐标

int row; //所在行的列坐标

node* next; //指向下一个坐标结点的指针

}; //单词坐标坐点类型

struct Node

{

char words[20]; //单词数组

node* ptr; //指向单词坐标结点的指针

Node* next; //指向下一个单词结点的指针

int num; //单词所含字符个数

}; //单词结点

class TLink

{

public:

TLink() { head = NULL; }

//构造函数

~TLink()

//析构函数

{

while( head != NULL )

{

Node* temp;

temp = head;

head = head -> next;

delete temp;

}

}

void Insert( char* Item );

//前条件:参数Item[]为一个字符数组。

//后条件:Item[]所包含的单词被插入到链表。

void calcute(char *szFile,int size);

//前条件:szFile[]以正确保存了文本字符,size为文本字符长度。

//后条件:统计链表每一个插入的单词的个数及所在行、列坐标。

Node* gethead();

//前条件:链表已初始化

//后条件:返回链表头指针

private:

Node* head;

};

char A_to_a( char alp );

//前条件:alp为一个正确的英文字母

//后条件:如果alp是大写字母,则转化为小写字母,否则不变。

void showwindow();

//后条件:显示统计结果。

void show_text();

//前条件:在正确的路径上存在一个英文文本。

//后条件:读入英文文本到字符数组并显示在屏幕上。

void input();

//后条件:读入用户输入的字符并插入到单词链表。

数据结构图解:

将从文件流读入的文章字符存到szFile[]字符数组中,以空格计数行单词个数,以换行符记录文章列数,将输入后插入到链表中的单词与字符数组中的单词比较,遇到相等的则将当前的行列数插入到链表的位置结点中,并且单词个数加1。

本程序允许用户选择是否重复进行,并且对于在一次操作中重复输入的单词,在链表中不进行重复插入。

功能模块:

模块调用:

程序流程图:

主要模块伪码概要设计:

插入函数(参数:Item【】数组):

新建单词结点;

while( Item[i] != '\0' )

{

复制各字符到单词结点的单词数组中;

记录单词字母个数;

}

插入单词字母个数到链表相应域;

temp -> words[i] = '\0';

查找并比较链表中是否已有要插入的单词;

如果有

不进行插入并销毁新建结点;

否则

插入新建的单词结点;

}

/*****************************************************************/

统计函数( 参数:char *szFile, int size)

{

while( 没有到文本字符的结尾 )

{

依次遍历文本字符,遇到非字母字符时计数单词所含字母个数;

while( 没有到链表尾 )

{

if( 单词结点所含单词的字母个数与计数相等 )

{

忽略大小写比较本次遍历到的单词和链表中的结点单词;

if(相等)

插入行列值

}

}

遇空格行单词个数加1;

遇换行列数加1;

}

/****************************************************************/

结构显示模块

while( 没到链表尾 )

{

输出结点单词;

如果存在,则输出单词的所有行、列值及出现次数;

否则输出没有该词或输入错误信息;

}

/*************************************************************/ 输入模块

{

do{

if( 链表不空 )

清空链表;

输出提示信息;

接受用户输入;

while( true )

{

输入的是结束字符;

退出;

记录输入逗号前的单词;

插入到链表;

继续输入;

}

if( 链表空 )

输出"没有插入任何单词!";

else

{

统计;

显示结果;

}

提示是否继续;

输入;

}while( 不继续 );

}

详细设计

程序清单:

//FILE:source.h

#ifndef SOURCE_H

#define SOURCE_H

struct node

{

int col;

int row;

node* next;

};

struct Node

{

char words[20];

node* ptr;

Node* next;

int num;

};

class TLink

{

public:

TLink() { head = NULL; }

~TLink()

{

while( head != NULL )

{

Node* temp;

temp = head;

head = head -> next;

delete temp;

}

}

void Insert( char* Item );

void calcute(char *szFile,int size);

Node* gethead();

private:

Node* head;

};

char A_to_a( char alp );

void showwindow();

void show_text();

void input();

#endif

#include

#include

#include

#include"source.h"

using namespace std;

TLink link;

int i=0;

char szFile[2000];

int main()

{

show_text();

cout << endl;

input();

return 0;

}

/****************************************************************/

void TLink::Insert(char *Item)

{

int flag = 0;

Node* temp;

temp = new Node;

int i = 0;

while( Item[i] != '\0' )

{

temp -> words[i] = Item[i];

++ i;

}

temp -> num = i;

temp -> words[i] = '\0';

Node* ptrr = NULL;

ptrr = link.gethead();

while( ptrr != NULL )

{

if( ptrr -> num == temp -> num )

{

int n;

for( n = 0; n < i; ++ n )

if( A_to_a( ptrr -> words[n] ) != A_to_a( Item[n] ) )

break;

if( n == i )

{

flag = 1;

break;

}

}

ptrr = ptrr -> next;

}

if( flag != 1 )

{

temp -> ptr = NULL;

temp -> next = NULL;

Node* Temp = head;

if( head == NULL )

{

head = temp;

}

else

{

while( Temp -> next != NULL )

Temp = Temp -> next;

Temp -> next = temp;

}

}

else

delete temp;

}

/*****************************************************************/

char A_to_a( char alp )

{

if( ( alp >= 'A' ) && ( alp <= 'Z' ) )

alp = alp + 32;

return alp;

}

/*****************************************************************/

void TLink::calcute(char *szFile, int size)

{

//cout << "calcute is called!" << endl;

int i = 0; //记录已搜索过的字符数-1

int col = 1;//列标

int row = 0;//行标

int count;//记录空格数-1

Node* ptrr = NULL;

while( i < size )

{

ptrr = link.gethead();

int j = 0;//对每个单词从开始计数

while( ( szFile[i] >= 'a' && szFile[i] <= 'z' ) || ( szFile[i] >= 'A' && szFile[i] <= 'Z' ) ) {

++ i;

++ j;

}

while( ptrr != NULL )

{

if( ptrr -> num == j )

{

int n;

for( n = 0; n <= j; ++ n )

if( A_to_a( ptrr -> words[n] ) != A_to_a( szFile[i - j + n] ) )

break;

if( n == j )

{

node* temp;

temp = new node;

temp -> col = col;

temp -> row = row;

temp -> next = NULL;

node* Temp = ptrr -> ptr;

if( ptrr -> ptr == NULL )

{

ptrr -> ptr = temp;

}

else

{

while( Temp -> next != NULL )

Temp = Temp -> next;

Temp -> next = temp;

}

}//插入行数

}

ptrr = ptrr -> next;

}

if( szFile[i] == ' ' || szFile[i] == '\n' )

{

count = -1;

while( szFile[i] == ' ' )

{

++ i; //设置列数

++ row;//行的单词个数加

++ count;//单词之间空格-1

}

row = row - count;

if( szFile[i] == '\n' )

{

++ col; //列遇到换行累加

++ i;

row = 0;//单词的行个数清零

}

}

else

++ i;

}

cout << endl;

}

/****************************************************************/

Node* TLink::gethead()

{

return head;

}

/********************************************************/

void showwindow()

{

Node* curptr = link.gethead();

while( curptr != NULL )

{

int word_num = 0;

for( int k = 0; curptr -> words[k] != '\0'; ++ k )

cout << curptr -> words[k];

cout << endl;

if( curptr -> ptr == NULL )

cout << "没有该词,或输入不正确!" << endl;

else

while( curptr -> ptr != NULL )

{

cout << "(";

cout << curptr -> ptr -> col ;

cout << ",";

cout << curptr -> ptr -> row ;

cout << ")";

cout << ' ';

curptr -> ptr = curptr -> ptr -> next;

word_num ++;

}

cout << endl;

cout << "该单词共出现" << word_num << "次!" << endl; curptr = curptr -> next;

}

}

/*************************************************************/ void show_text()

{

ifstream fin;

fin.open("D:\\english.txt");

if (fin.fail())

{

cout<<"Input file opening failed.\n";

exit(1);

}

char next;

fin.get(next);

while (! fin.eof())

{

szFile[i] = next;

++ i;

fin.get(next);

}

szFile[i] = '\0';

for( int k = 0; k < i; ++ k )

cout << szFile[k];

cout << "*****Total number :" << i << endl;

cout << "***************************************************************************" << endl; }

/**********************************************************************/

void input()

{

char Item[40]; //暂存数组

char in; //接受输入字符

char ans; //判断是否重新开始

do{

if( link.gethead() != NULL )

link.~TLink();

cout << "请输入要统计的单词,单词之间用逗号隔开(输入@键结束,本程序忽略空格):" << endl;

cin >> in;

int flag = 1;

while( true )

{

if( in == '@' )

break;

int m = 0;

while( in != ',' )

{

Item[m] = in;

++ m;

cin >> in;

if( in == '@' )

{

flag = 0;

break;

}

}

Item[m] = '\0';

link.Insert( Item );

if( flag == 0 )

break;

cin >> in;

}

if( link.gethead() == NULL )

cout << "没有插入任何单词!" << endl;

else

{

link.calcute( szFile, i );

showwindow();

}

cout << "是否继续?(Y/y or N/n):";

cin >> ans;

}while( ( ans != 'n' ) && ( ans != 'N' ) );

}

运行结果

结果分析

输入要查找的单词之后,单词插入链表,停止输入后,程序开始在文本字符中查找链表中的单词。

程序从文本数组顺次扫描,并在扫描到空格时记录一个单词的扫描结束,并记录单词所含字母个数,然后查找链表,如有和该单词字母个数相同的记录则进行比较,否则继续查找下一个直到链表

尾。此后程序继续扫描文本字符数组的下一个单词并和链表中单词进行相同的比较过程,直到字符数组扫描完毕。

要想在输出结果后继续,则选择Y或y继续,否则输入N或n退出。

最后输出结果。

本次运行中第一次操作输入is,are@,这是正确的输入,则输出正确的结果;

第二次选择y继续,输入the@,这也是正确的输入,则输出正确结果;

第三次选择y继续,输入microsoft,22%,microsoft@,一、三个输入正确,但是同样的输入,则按照程序设计,只输出一次结果,第二次输入错误,则程序报告输入有误。

选择n,程序按预期结束。

收获与体会

通过本次的课程设计实验,是我对数据结构的设计编程有了更好的理解,进一步学习了把学到的知识运用到实际的一些问题解决中去。巩固了和提高了编程的能力,积累了一些编程技巧和经验。

程序设计是选择一种好的结构,然后设计一个好的算法。数据结构设计的好坏会直接影响到程序算法设计的可实现性及难易程度。在课程设计的过程中使我更深刻认识到结构设计的重要性,有时在结构中加一个记录一个数字的变量也许会使程序代码更明朗和易于设计。

程序设计是一项看似枯燥却会有无穷乐趣的事情,我们在做编程设计时,需要极其的认真、求实、耐心和信心。一点的错误都不会使我们得到预期的结果,所以,我要继续认真学习和练习,多动手动脑,循序渐进的提高自己的程序设计能力。

附:

读入的文本:

01 Microsoft Windows is a complex operating system. It offers

02 so many featuresand does so much that it's impossible for

03 any one person to fully understandthe entire system. This

04 complexity also makes it difficult for someone to decide

05 where to start concentrating the learning effort. Well, I

06 always like to start at the lowest level by gaining a solid

07 understanding of the system's basic building blocks. Once

08 you understand the basics, it's easy to incrementally

09 add any higher-level aspects of the system to your knowledge.

10 So this book focuses on Windows' basic building blocks and

11 the fundamental concepts that you must know when architecting

12 and implementing software targeting the Windows operating system.

13 In short, this book teaches the reader about various Windows features

14 and how to access them via the C and C++ programming languages.

15 Although this book does not cover some Windows concepts-such as the

16 Component Object Model (COM)-COM is built on top of basic building

17 blocks such as processes, threads, memory management, DLLs, thread

18 local storage, Unicode, and so on. If you know these basic building

19 blocks, understanding COM is just a matter of understanding

20 how the building blocks are used. I have great sympathy for people

21 who attempt to jump ahead in learning COM's architecture. They have a

22 long road ahead and are bound to have gaping holes in their knowledge,

23 which is bound to negatively affect their

24 code and their software development schedules.

注:该文本的要求是每行开头如上所示表明行号,且每行结尾有换行符。放在D:\\english.txt路径上。

统计英文词汇

A abscissa横坐标 absence rate缺勤率 absolute number绝对数 absolute value绝对值 accident error偶然误差 accumulated frequency累积频数 alternative hypothesis备择假设 analysis of data分析资料 analysis of variance(ANOVA)方差分析 arith-log paper算术对数纸 arithmetic mean算术均数 assumed mean假定均数 arithmetic weighted mean加权算术均数asymmetry coefficient偏度系数 average平均数 average deviation平均差 B bar chart直条图、条图 bias偏性 binomial distribution二项分布 biometrics生物统计学 bivariate normal population双变量正态总体 C cartogram统计图 case fatality rate(or case mortality)病死率 census普查 chi-sguare(X2) test卡方检验 central tendency集中趋势 class interval组距 classification分组、分类 cluster sampling整群抽样 coefficient of correlation相关系数 coefficient of regression回归系数 coefficient of variability(or coefficieut of variation)变异系数 collection of data收集资料 column列(栏) combinative table组合表 combined standard deviation合并标准差 combined variance(or poolled variance)合并方差complete survey全面调查

统计学英语词汇

统计学英语词汇 发布: 2008-10-08 23:42 | 作者: zhou_209 | 来源: 6sigma品质网 统计学的一些英语词汇,希望对大家有用. A abscissa 横坐标 absence rate 缺勤率 absolute number 绝对数 absolute value 绝对值 accident error 偶然误差 accumulated frequency 累积频数 alternative hypothesis 备择假设 analysis of data 分析资料 analysis of variance(ANOVA) 方差分析 arith-log paper 算术对数纸 arithmetic mean 算术均数 assumed mean 假定均数 arithmetic weighted mean 加权算术均数 asymmetry coefficient 偏度系数 average 平均数 average deviation 平均差 B bar chart 直条图、条图 bias 偏性 binomial distribution 二项分布 biometrics 生物统计学 bivariate normal population 双变量正态总体 C cartogram 统计图

case fatality rate(or case mortality) 病死率 census 普查 chi-sguare(X2) test 卡方检验 central tendency 集中趋势 class interval 组距 classification 分组、分类 cluster sampling 整群抽样 coefficient of correlation 相关系数 coefficient of regression 回归系数 coefficient of variability(or coefficieut of variation) 变异系数collection of data 收集资料 column 列(栏) combinative table 组合表 combined standard deviation 合并标准差 combined variance(or poolled variance) 合并方差complete survey 全面调查 completely correlation 完全相关 completely random design 完全随机设计 confidence interval 可信区间,置信区间 confidence level 可信水平,置信水平 confidence limit 可信限,置信限 constituent ratio 构成比,结构相对数 continuity 连续性 control 对照 control group 对照组 coordinate 坐标 correction for continuity 连续性校正 correction for grouping 归组校正 correction number 校正数 correction value 校正值 correlation 相关,联系 correlation analysis 相关分析 correlation coefficient 相关系数 critical value 临界值 cumulative frequency 累积频率

统计出现次数最多的3个单词

题目要求:使用c语言编程,统计出给定data.dat文件中的出现次数最多的 三个单词,以及这三个单词的出现的次数,计算程序运行的时间,结果写入result.dat中。(注:这里不区分单词大小写,如he与He当做是同一单词计数) 本程序使用二叉排序树方式将所有单词放入树中然后在其中查找相同单词,出现相同的则把它的出现次数加1,否则继续在左右子树中查找。最后使用数组将A[first],A[second],A[third]三个单词进行排序,并用这三个单词余剩余所有单词进行比较,不断更新,最后找到出现次数最多的三个单词,输出到文件中。 #include #include #include #include #include #define MAX 20 typedef struct BTNode { char *word; unsigned long count; struct BTNode *lchild; struct BTNode *rchild; }BTNode; struct words { char str[20]; //用来存放该单词 int num; }A[7500000]; struct words a; int k=0; int sum=0; void GetWord(FILE *fp,int lim,char word[])//获取一个单词 { char *w=word; char c; while(isspace(c=getc(fp))); //跳过空格 if(c!=EOF) c=tolower(c); *word++=c; if(!isalpha(c))//单词第一个不是字母,退出 {

统计学词汇中英文对照完整版

统计学词汇中英文对照完整版 Absolute deviation, 绝对离差 Absolute number, 绝对数 Absolute residuals, 绝对残差 Acceleration array, 加速度立体阵 Acceleration in an arbitrary direction, 任意方向上的加速度Acceleration normal, 法向加速度 Acceleration space dimension, 加速度空间的维数Acceleration tangential, 切向加速度 Acceleration vector, 加速度向量 Acceptable hypothesis, 可接受假设 Accumulation, 累积 Accuracy, 准确度 Actual frequency, 实际频数 Adaptive estimator, 自适应估计量 Addition, 相加 Addition theorem, 加法定理 Additive Noise, 加性噪声 Additivity, 可加性 Adjusted rate, 调整率 Adjusted value, 校正值 Admissible error, 容许误差 Aggregation, 聚集性 Alpha factoring,α因子法 Alternative hypothesis, 备择假设 Among groups, 组间 Amounts, 总量 Analysis of correlation, 相关分析 Analysis of covariance, 协方差分析 Analysis Of Effects, 效应分析 Analysis Of Variance, 方差分析 Analysis of regression, 回归分析 Analysis of time series, 时间序列分析 Analysis of variance, 方差分析 Angular transformation, 角转换 ANOVA (analysis of variance), 方差分析 ANOVA Models, 方差分析模型 ANOVA table and eta, 分组计算方差分析 Arcing, 弧/弧旋 Arcsine transformation, 反正弦变换 Area 区域图 Area under the curve, 曲线面积 AREG , 评估从一个时间点到下一个时间点回归相关时的误差

C语言统计文件中的字符数、单词数以及总行数

C语言统计文件中的字符数、单词数以及总行数 统计文件的字符数、单词数以及总行数,包括: 每行的字符数和单词数 文件的总字符数、总单词数以及总行数 注意: 空白字符(空格和tab缩进)不计入字符总数; 单词以空格为分隔; 不考虑一个单词在两行的情况; 限制每行的字符数不能超过1000。 代码如下 #include #include int *getCharNum(char *filename, int *totalNum); int main(){ char filename[30]; // totalNum[0]: 总行数totalNum[1]: 总字符数totalNum[2]: 总单词数 int totalNum[3] = {0, 0, 0}; printf("Input file name: "); scanf("%s", filename); if(getCharNum(filename, totalNum)){ printf("Total: %d lines, %d words, %d chars\n", totalNum[0], totalNum[2], totalNum[1]); }else{ printf("Error!\n"); } return 0; } /** * 统计文件的字符数、单词数、行数 * * @param filename 文件名 * @param totalNum 文件统计数据 * * @return 成功返回统计数据,否则返回NULL **/ int *getCharNum(char *filename, int *totalNum){ FILE *fp; // 指向文件的指针 char buffer[1003]; //缓冲区,存储读取到的每行的内容 int bufferLen; // 缓冲区中实际存储的内容的长度 int i; // 当前读到缓冲区的第i个字符 char c; // 读取到的字符

统计学专业英语词汇完整版

统计学专业英语词汇 A Absolute deviation,绝对离差 Absolute number,绝对数 Absolute residuals,绝对残差 Acceleration array,加速度立体阵 Acceleration in an arbitrary direction,任意方向上的加速度Acceleration normal,法向加速度 Acceleration space dimension,加速度空间的维数Acceleration tangential,切向加速度 Acceleration vector,加速度向量 Acceptable hypothesis,可接受假设 Accumulation,累积 Accuracy,准确度 Actual frequency,实际频数 Adaptive estimator,自适应估计量 Addition,相加 Addition theorem,加法定理 Additivity,可加性 Adjusted rate,调整率 Adjusted value,校正值 Admissible error,容许误差 Aggregation,聚集性 Alternative hypothesis,备择假设 Among groups,组间 Amounts,总量 Analysis of correlation,相关分析 Analysis of covariance,协方差分析 Analysis of regression,回归分析 Analysis of time series,时间序列分析 Analysis of variance,方差分析 Angular transformation,角转换 ANOVA(analysis of variance),方差分析 ANOVA Models,方差分析模型 Arcing,弧/弧旋 Arcsine transformation,反正弦变换 Area under the curve,曲线面积 AREG,评估从一个时间点到下一个时间点回归相关时的误差ARIMA,季节和非季节性单变量模型的极大似然估计Arithmetic grid paper,算术格纸 Arithmetic mean,算术平均数 Arrhenius relation,艾恩尼斯关系 Assessing fit,拟合的评估 Associative laws,结合律Asymmetric distribution,非对称分布 Asymptotic bias,渐近偏倚 Asymptotic efficiency,渐近效率 Asymptotic variance,渐近方差 Attributable risk,归因危险度 Attribute data,属性资料 Attribution,属性 Autocorrelation,自相关 Autocorrelation of residuals,残差的自相关 Average,平均数 Average confidence interval length,平均置信区间长度Average growth rate,平均增长率 B Bar chart,条形图 Bar graph,条形图 Base period,基期 Bayes theorem, 贝叶斯定理 Bell-shaped curve,钟形曲线 Bernoulli distribution,伯努力分布 Best-trim estimator,最好切尾估计量 Bias,偏性 Binary logistic regression,二元逻辑斯蒂回归 Binomial distribution,二项分布 Bisquare,双平方 Bivariate Correlate,二变量相关 Bivariate normal distribution,双变量正态分布 Bivariate normal population,双变量正态总体 Biweight interval,双权区间 Biweight M-estimator,双权M估计量 Block,区组/配伍组 BMDP(Biomedical computer programs),BMDP统计软件包Box plots,箱线图/箱尾图 Break down bound,崩溃界/崩溃点 C Canonical correlation,典型相关 Caption,纵标目 Case-control study,病例对照研究 Categorical variable,分类变量 Catenary,悬链线 Cauchy distribution,柯西分布 Cause-and-effect relationship,因果关系 Cell,单元 Censoring,终检 Center of symmetry,对称中心

单词的检索与计数教材

内江师范学院计算机科学学院 数据结构课程设计报告 课题名称:文本文件单词的检索与计数 姓名: 学号: 专业班级:软件工程 系(院):计算机科学学院 设计时间:20XX 年X 月X日 设计地点: 成绩:

1.课程设计目的 (1).训练学生灵活应用所学数据结构知识,独立完成问题分析,结合数据结构理论知识,编写程序求解指定问题。 (2).初步掌握软件开发过程的问题分析、系统设计、程序编码、测试等基本方法和技能; (3).提高综合运用所学的理论知识和方法独立分析和解决问题的能力; (4).训练用系统的观点和软件开发一般规范进行软件开发,巩固、深化学生的理论知识,提高编程水平,并在此过程中培养他们严谨的科学态度和良好的工作作风。 2.课程设计任务与要求: 文本文件单词的检索与计数软件 任务:编写一个文本文件单词的检索与计数软件, 程序设计要求: 1)建立文本文件,文件名由用户键盘输入 2)给定单词的计数,输入一个不含空格的单词,统计输出该单词在文本中的出现次数 要求: (1)、在处理每个题目时,要求从分析题目的需求入手,按设计抽象数据类型、构思算法、通过设计实现抽象数据类型、编制上机程序和上机调试等若干步骤完成题目,最终写出完整的分析报告。前期准备工作完备与否直接影响到后序上机调试工作的效率。在程序设计阶段应尽量利用已有的标准函数,加大代码的重用率。 (2)、设计的题目要求达到一定工作量(300行以上代码),并具有一定的深度和难度。 (3)、程序设计语言推荐使用C/C++,程序书写规范,源程序需加必要的注释; (4)、每位同学需提交可独立运行的程序; (5)、每位同学需独立提交设计报告书(每人一份),要求编排格式统一、规范、内容充实,不少于8页(代码不算); (6)、课程设计实践作为培养学生动手能力的一种手段,单独考核。 3.课程设计说明书 一需求分析 3.1 串模式匹配算法的设计要求 在串的基本操作中,在主串中查找模式串的模式匹配算法——即求子串位置的函数Index(S,T),是文本

杭电1004统计单词最多的个数

Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51003 Accepted Submission(s): 18283 Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. This year, they decide to leave this lovely job to you. Input Input contains multiple test cases. Each test case starts with a number N (0 < N <= 1000) -- the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lower-case letters. A test case with N = 0 terminates the input and this test case is not to be processed. Output For each case, print the color of balloon for the most popular problem on a single line. It is guaranteed that there is a unique solution for each test case. Sample Input 5 green red blue red red 3 pink orange pink #include"stdio.h" #include"string.h" #define N 1111

统计学英语词汇

https://www.sodocs.net/doc/2d14866120.html, 统计学专业词汇英语翻译  大蚂蚱社区 https://www.sodocs.net/doc/2d14866120.html, 声明:本资源整理来自网络,禁止商用! Abbe-Helmert criterion Abbe-Helmert准则 美、英、加标准(美军标准105D) ABC standard (MIL-STD-105D) 非常态曲线 abnormal curve 非常态性 abnormality 简易生命表 abridged life table 突出分布;突出分配 abrupt distribution 绝对连续性 absolute continuity 绝对离差 absolute deviation 绝对离势 absolute dispersion 绝对有效性 absolute efficiency 估计量的绝对有效性 absolute efficiency of estimator 绝对误差 absolute error 绝对次数 absolute frequency 绝对测度 absolute measure 绝对动差 absolute moment 绝对常态计分检定 absolute normal score test 绝对临界 absolute threshold 绝对变异 absolute variation

https://www.sodocs.net/doc/2d14866120.html, 绝对不偏估计量 absolutely unbiased estimator 吸收界限 absorbing barrier 吸收状态 absorbing state 吸收系数 absorption coefficient 吸收分布 absorption distributions 吸收律 absorption law 加速因子 accelerated factor 加速寿命试验 accelerated life test 加速随机逼近 accelerated stochastic approximation 加速试验 accelerated test 乘幂加速近似 acceleration by powering 允收制程水准 acceptable process level 允收品质 acceptable quality 允收品质水准 acceptable quality level (AQL) 允收可靠度水准 acceptable reliability level (ARL) 允收;验收 acceptance 接受界限;允收界线 acceptance boundary 允收系数 acceptance coefficient 允收管制图 acceptance control chart 允收管制界限 acceptance control limit 接受准则;允收准则 acceptance criterion 允收误差 acceptance error

统计用的英文单词

统计用的英文单词 decimal ['des?ml] adj. 十进位的,小数的n. 小数 align [??la?n] vt. 使成一线,使结盟;排整齐vi. 排列;成一条线 paste [pe?st] vt. 粘贴,张贴;以…覆盖于 tutorial [tju:?t?:ri?l] n. 个人辅导的;教程,辅导材料;使用说明书adj. 家庭教师的;指导教师的;辅导的;监护人的 string [str??]n. 绳子,带子;线丝,植物纤维;串;[计算机科学]字符串vt. 上弦,调弦;使排成一行或一系列;绑,系或用线挂起;延伸或扩展 gallery ['ɡ?l?r?] . 画廊,走廊;(教堂,议院等的)边座;旁听席;大批观众 sort cases 数据排序; 排序案件 std. deviation [计][WIN]标准偏差standard deviation variance [?ve?ri?ns] n.;<数>方差 S.E. mean 均值的标准误standard error skewness [sk'ju:nes] 偏斜 kurtosis [k?:'t??s?s] n. 峰度,峰态,峭度 dependent list 因变量列表 Levene’s Test for Equality of variances Levene's方差齐性检验sig. abbr. signetur (Latin=mark with directions) (拉丁语)方向标志signetur ['s?ɡn?t?:] [医](拉)标记,用法签

signature [?s?gn?t??(r)] n. 签名;署名;识别标志,鲜明特征;[医] 药的用法说明 df degree of freedom 自由度 std. Error Mean SEM 均数标准误【是描述均数抽样分布的离散程度及衡量均数抽样误差大小的尺度,反映的是样本均数之间的 变异。标准误用来衡量抽样误差。标准误越小,表明样本统计 量与总体参数的值越接近,样本对总体越有代表性,用样本统 计量推断总体参数的可靠度越大。因此,标准误是统计推断可 靠性的指标。】 One-way ANOV A 单变量-单因素方差分析 analysis of variance 方差分析ANOV A GLM Univariate 单变量多因素方差分析 GLM Multivariate 多变量多因素方差分析 Univariate [ju:n?'ve?r??t] adj. 单变量的,单变的 方差分析,多元回归,t检验都属于参数统计检验(parametric ),参数检验的前提是总体方差必须相同,如果不满足方差齐性检验,是不能进行方差分析,t检验,多元回归等参数检验。方差不齐的情况下我们可以做非参数检验(non-parametric),Tamhane's T2是非参数检验的一种,不是方差分析。除了Tamhane’s T2,在方差不齐的情况下可用的非参数检验还有,Wilcoxon Test, Friedman Test, Mann-whitney Test, Kruskal-Wallis test, 等等。

统计学专业英语词汇汇总

统计学复试专业词汇汇总 population 总体 sampling unit 抽样单元 sample 样本 observed value 观测值 descriptive statistics 描述性统计量 random sample 随机样本 simple random sample 简单随机样本 statistics 统计量 order statistic 次序统计量 sample range 样本极差 mid-range 中程数 estimator 估计量 sample median 样本中位数 sample moment of order k k阶样本矩 sample mean 样本均值 average 平均数 arithmetic mean 算数平均值 sample variance 样本方差 sample standard deviation 样本标准差sample coefficient of variation 样本变异系数

standardized sample random variable 标准化样本随机变量sample coefficient of skewness (歪斜)样本偏度系数 sample coefficient of kurtosis (峰态) 样本峰度系数 sample covariance 样本协方差 sample correclation coefficient 样本相关系数 standard error 标准误差 interval estimator 区间估计 statistical tolerance interval 统计容忍区间 statistical tolerance limit 统计容忍限 confidence interval 置信区间 one-sided confidence interval 单侧置信区间 prediction interval 预测区间 estimate 估计值 error of estimation 估计误差 bias 偏倚 unbiased estimator 无偏估计量 maximum likelihood estimator 极大似然估计量 estimation 估计 maximum likelihood estimation 极大似然估计 likelihood function 似然函数

英语单词的实际使用频率进行统计

下面是常见的2000英语单词按使用频率从高到低进行排列的,因为它是按国外英语单词的实际使用频率进行统计的,可能不太适合在中国的英语单词实际使用频率,但它有助你了解英语单词的实际使用情况。 General Words Basic Words General Adjectives General Nouns 1)General Words 1 the 2 be 3 of 4 and 5 a 6 to 7 in 8 he 9 have 10 it 11 that 12 for 13 they 14 I 15 with 16 as 17 not 18 on 19 she 20 at 21 by 22 this 23 we 24 you 25 do 26 but 27 from 28 or 29 which 30 one 31 would 32 all 33 will 34 there 35 say 36 who 37 make 38 when 39 can 40 more 41 if 42 no 43 man 44 out 45 other 46 so 47 what 48 time 49 up 50 go 51 about 52 than 53 into 54 could 55 state 56 only 57 new 58 year 59 some 60 take 61 come 62 these 63 know 64 see 65 use 66 get 67 like 68 then 69 first 70 any 71 work 72 now 73 may 74 such 75 give 76 over 77 think 78 most 79 even 80 find 81 day 82 also 83 after 84 way 85 many 86 must 87 look 88 before 89 great 90 7 back 91 through 92 long 93 where 94 much 95 should 96 well 97 people 98 down 99 own 100 just 101 because 102 good 103 each 104 those 105 feel 106 seem 107 how 108 high 109 too

统计文本中单词的个数

江西理工大学软件学院 计算机类课程实验报告 课程名称: 统计文本中单词个数 班级: 11软件会计4班 姓名: 黄健 学号: 江西理工大学软件学院 一、目录 1、目录--—-——-—-—------—---——--——-----------——---——-—-------—-—-----—2 2、实验目得—-——-—--—-—---——---—----------------—--—-—-—------—---——3 3、实验要求—-------—------——-------——-----————-----——--—----—------3 4、实验仪器设备与材料-———--—-----------—----—-—---—--—----—---3 5、实验原理—--—-—-—-—-———---——--—--————-—---———-—-—-———---——--——---4 6、实验步骤———-—------—-—-——-------——-------—-------——--—-------———5 7、实验原始记录-----————--—----———-—--—--—-——

-—-------——-—--—---—6 8、实验数据分析计算结果—-—--—-------—----—--—------—--——-—-—-10 9、实验心得体会—-—-—---—-—-—--——-—-----—-------—--———--——-—--—-—-11 10、思考题-————---—-——---—---—-—---—-——----—--—————--—-—-—----—---——12 二:实验目得: 一个文本可以瞧成就是一个字符序列,在这个序列中,有效字符被空格分隔为一个个单词、设计出一种算法来去统计出一个文本中单词得个数。 三:实验要求: 1.被处理文本得内容可以由键盘读入 2.可以读取任意文本内容,包括英文、汉字等 3.设计算法统计文本中单词得个数 4.分析算法得时间性能 四:实验仪器设备与材料 参考书籍 电脑及其配件 Microsoft VisulaiC++6、0 五:实验原理 设计一个计数器count统计文本中单词得个数。在逐个读入与检查

课设报告统计英文单词数

“程序设计基础” 课程设计报告 (一)需求和规格说明

该系统的功能是给定一个英文段落(单词个数<100),利用哈希表(表长最大为20)统计单词出现的频度,并能根据要求显示出给定单词在段落中出现的位置。执行程序时由用户在键盘上输入程序中规定的运算命令;相应的输入数据和运算结果显示在其后。 该系统的实现是通过哈希函数的建立和查找分析,用线性探测再散列来处理冲突,从而得到哈希表并实现哈希表的查找。该文章对哈希函数的应用方法是使用除留余数法构造,使用链地址法进行冲突处理。 2.1技术可行性 哈希查找是通过计算数据元素的存储地址进行查找的一种方法。 哈希查找的操作步骤: 用给定的哈希函数构造哈希表; 根据选择的冲突处理方法解决地址冲突; 在哈希表的基础上执行哈希查找。 2.2需求可行性 世界上的事物都是有发展的,企图跨越阶段或者停滞,一切生命就都没有存在的理由了。频率就是一个既动态又静态的东西,我们能肯定的是很多古词和今词是不一样的,今日被淘汰了,也就是说,今天的频率的统计是一定有确定的结论的。也有一些古词仍在今日用着,或者在淘汰之中,所以频率难以确定。我们知道黑天和白天是有区别的,但它们的交界点,却不是那么容易分辨了,恐怕需要经过科学家的精密研究。交界点不容易确定,并不意味着事物之间没有区别。世界上的事物都是有区别又有联系的。有些人读书读傻了,钻了牛角尖,他弄不清两个事物之间的区别应该划在哪里,后来就连两个事物之间有区别也不敢认定了。频率的统计是为了区别常用词和非常用词,方法可能不准确,但不至于否定常用词和非常用词之间的区别吧。我们应该使统计精密起来。火车今天不用火了,但如果当初也不用,就没有今天的“火车”了。事物的变化是不可能停止的,但总还有个静态的定位,否则人们就无法认识任何事物了。频率虽然是个复杂的问题,但科学的研究是必要的。 3 需求分析 给定一个英文段落(单词个数<100),利用哈希表(表长最大为20)统计单词出现的频度,并能根据要求显示出给定单词在段落中出现的位置。执行程序时由用户在键盘上输入程序中规定的运算命令;相应的输入数据和运算结果显示在其后。测试数据:给定一个英文段落 显示出不同英文单词的出现频度。 给定一个英文单词,判断段落中是否含有该单词,如有,依次显示出该单词在段落中出现的位置。 基本要求:哈希函数使用除留余数法构造,使用链地址法进行冲突处理。 (二)设计 构造哈希函数 void initial() //哈希表的初始化 { for(int i(0); i<100; i++) { haxilist[i].head=NULL; haxilist[i].tail= NULL; } cout<<"哈希表初始化完成,准备读入文件,请将需要操作的文件命名为file.txt放到文件夹中"<

单词统计

江西理工大学 实 验 报 告 系机电工程班级11机械电子(2)姓名杨锦其学号11212203 课程数据结构教师刘廷苍

实验题目:统计文本中单词的个数 一.实验目的 一个文本可以看成是一个字符序列,在这个序列中,有效字符被空格分隔为一个个单词。统计算法统计文本中单词的个数。 二.实验内容 (1)被处理文本的内容可以由键盘读入; (2)可以读取任意文本内容,包括英文、汉字等; (3)设计算法统计文本中的单词个数; (4)分析算法的时间性能。 三.设计与编码 1.理论知识 设置一个计数器count统计文本中的单词个数。在逐个读入和检查字符时,需要区分当前字符是否是空格。不是空格的字符一定是某个单词的一部分,空格的作用就是分隔单词。但即使当前字符不是空格,他是不是新词的开始还依赖于前一个字符是否是空格,只有当前字符是单词的首字符时,才可以给计数器加1。如果遇到非空格字符,则是新词。读入过程在某单词内部,则不会是新词。 2.分析 输入要查找的单词之后,单词插入链表,停止输入后,程序开始在文本字符中查找链表中的单词。 程序从文本数组顺次扫描,并在扫描到空格时记录一个单词的扫描结束,并记录单词所含字母个数,然后查找链表,如有和该单词字母个数相同的记录则进行比较,否则继续查找下一个直到链表尾。此后程序继续扫描文本字符数组的下一个单词并和链表中单词进行相同的比较过程,直到字符数组扫描完毕。 3.详细代码 #include #include #include #include using namespace std; #ifndef SOURCE_H #define SOURCE_H struct node {

SPSS统计分析最全中英文对照表

SPSS 专业技术词汇、短语的中英文对照索引 % of cases 各类别所占百分比 1-tailed 单尾的 2 Independent Samples 两个独立样本的检验 2 Related Samples 两个相关样本检验 2-tailed 双尾的 3-D (=dimensional) 三维-->三维散点图 A Above 高于 Absolute 绝对的-->绝对值 Add 加,添加 Add Cases 合并个案 Add cases from... 从……加个案 Add Variables 合并变量 Add variables from... 从……加变量 Adj.(=adjusted) standardized 调整后的标准化残差 Aggregate 汇总-->分类汇总 Aggregate Data 对数据进行分类汇总 Aggregate Function 汇总函数 Aggregate Variable 需要分类汇总的变量 Agreement 协议 Align 对齐-->对齐方式 Alignment 对齐-->对齐方式 All 全部,所有的 All cases 所有个案 All categories equal 所有类别相等 All other values 所有其他值 All requested variables entered 所要求变量全部引入 Alphabetic 按字母顺序的-->按字母顺序列表 Alternative 另外的,备选的 Analysis by groups is off 分组分析未开启 Analyze 分析-->统计分析 Analyze all cases, do not create groups 分析全部个案,不建立分组Annotation 注释 ANOV A Table ANOV A表 ANOV A table and eta (对分组变量)进行单因素方差分析并计算其η值Apply 应用 Apply Data Dictionary 应用数据字典 Apply Dictionary 应用数据字典 Approximately 大约 Approximately X% of all cases 从所有个案中随机选择约X%的个案

统计文本中单词地个数

理工大学软件学院计算机类课程实验报告 课程名称:统计文本中单词个数班级:11软件会计4班 姓名:黄健 学号:11222122 理工大学软件学院

一、目录 1、目录--------------------------------------------------------------2 2、实验目的--------------------------------------------------------3 3、实验要求--------------------------------------------------------3 4、实验仪器设备与材料-----------------------------------------3 5、实验原理--------------------------------------------------------4 6、实验步骤--------------------------------------------------------5 7、实验原始记录--------------------------------------------------6 8、实验数据分析计算结果--------------------------------------10 9、实验心得体会--------------------------------------------------11 10、思考题----------------------------------------------------------12

相关主题