单词统计

单词统计
单词统计

江西理工大学

系机电工程班级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

{

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();

int i=0;

char szFile[2000];

TLink link;

void TLink::Insert(char *Item)

{

TLink link;

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 << "\n没有该词,或输入不正确!" << endl;

else

cout<<"位置(行,列):";

while( curptr -> ptr != NULL )

{

cout << "(";

cout << curptr -> ptr -> col-1 ;

cout << ",";

cout << curptr -> ptr -> row ;

cout << ")";

cout << ' ';

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

word_num ++;

}

cout << endl;

cout << "\n该单词共出现" << word_num << "次!" << endl;

curptr = curptr -> next;

}

}

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

{

ifstream fin;

fin.open("1.txt");

if (fin.fail())

{

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

exit(1);

}

char next;

int x=0,yy=0;

fin.get(next);

while (! fin.eof())

{

if(!(next>=65&&next<=90||next<=122&&next>=97)) yy=yy+1;

else yy=0;

if(yy==1)++x;

szFile[i] = next;

++ i;

fin.get(next);

}

szFile[i] = '\0';

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

cout << szFile[k];

cout << "\n\n*****单词总数:" << x<< endl;

}

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

void input()

{

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

char in; //接受输入字符

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

do{

if( link.gethead() != NULL )

link.~TLink();

cout << "\n请输入要统计的单词(输入#键结束):" << endl;

cin >> in;

int flag = 1;

while( true )

{

if( in == '#' )

break;

int m = 0;

while(in>=65&&in<=90||in<=122&&in>=97)

{

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' ) );

}

int putall(char *aa)

{

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

char in; //接受输入字符

int sd=0;

do{

if( link.gethead() != NULL )

link.~TLink();

in=aa[sd];if(aa[sd]== '#') break;sd++;

int flag = 1;

while( true )

{

if( in == ' ' )

break;

int m = 0;

while(in>=65&&in<=90||in<=122&&in>=97)

{

Item[m] = in;

++ m;

in=aa[sd];if(aa[sd]== '#') break;sd++;

if( in == ' ' )

{

flag = 0;

break;

}

}

Item[m] = '\0';

link.Insert( Item );

if( flag == 0 )

break;

in=aa[sd];if(aa[sd]== '#') break;sd++;

}

if( link.gethead() == NULL )

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

else

{

link.calcute( szFile, i );

showwindow();

}

}while(aa[sd]!= '#');return 0;

}

int fo(char *aa)

{

FILE *fp1;

char ch;

if((fp1=fopen("1.txt","w"))==NULL)

{

printf("Cannot open file strike any key exit!"); getchar();

return 0;

}

printf("请输入段落(要结束请按#):\n");

ch=getchar(); int i=0;

while ((aa[i]=ch)!='#')

{

fputc(ch,fp1);i++;

ch=getchar();

}

fputc(ch,fp1);

cout<

fclose(fp1);

return 0;

}

int main()

{ char aa[10000]={'a'},yn;

fo(aa);

show_text();

input();

cout<<"是否要显示所有单词数量及位置(是:y/Y ,否:n/N):";

cin>>yn;

if(( yn!= 'n' ) && ( yn != 'N' ))

putall(aa);

return 0;

}

#endif

四.运行与调试

1.输入数据:I want to go to school,I want to have a good future!

2.输出数据:******单词总数:13

附图:

五.总结与心得

这次实验让我明白要能够结合自己所学的理论知识独立完成问题分析,整合编写程序,提高自己综合运用所学知识的方法和解决问题的能力。这次实验也同时让我个人认识到了自己知识的不足,并让我对数据结构有了全新的认识,要好好学习数据结构,充实自己。而且也让我知道了对于数据结构的学习理论与实际的

相结合是很重要的,只有理论知识是远远不够的,只有把所学的理论知识与实际相结合起来,才能让自己所学到的知识得到到应用,从而提高自己的实践动手能力和独立思考能力。相信此次的实验会对日后的学习起到相当大的指导作用。

统计学英语词汇

统计学英语词汇 发布: 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 累积频率

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

统计学专业英语词汇 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,单元 精品文档

统计学专业名词中英对照

population 母体 sample 样本 census 普查 sampling 抽样 quantitative 量的 qualitative/categorical 质的 discrete 离散的 continuous 连续的 population parameters 母体参数 sample statistics 样本统计量 descriptive statistics 叙述统计学 inferential/inductive statistics 推论/归纳统计学levels of measurement 衡量尺度 nominal scale 名目尺度 ordinal scale 顺序尺度 interval scale 区间尺度 ratio scale 比例尺度 frequency distribution 次数分配 relative frequency 相对次数 range 全距 class midpoint 组中点 class limits 组限 class boundaries 组界 class width 组距 cumulative frequency (以下) 累加次数 decumulative frequency 以上累加次数 histogram 直方图 pie chart 饼图 ogive 肩形图 frequency polygon 多边形图 cumulative frequency polygon 累加次数多边形图box plot 盒须图 stem and leaf plot 枝叶图 measures of central tendency 中央趋势量数 mean 平均数 median 中位数 mode 众数 location measures 位置量数 percentile 百分位数 quartile 四分位数 decile 十分位数

100个最高频英语语词汇统计表

标准文档 实用文案The First Hundred 1. the 2. of 3. and 4. a 5. to 6. in 7. is 8. you 9. that 10. it 11. he 12. was 13. for 14. on 15. are 16. as 17. with 18. his 19. they 21. at 22. be 23. this 24. have 25. from 26. or 27. one 28. had 29. by 30. word 31. but 32. not 33. what 34. all 35. were 36. we 37. when 38. your 39. can 41. there 42. use 43. an 44. each 45. which 46. she 47. do 48. how 49. their 50. if 51. will 52. up 53. other 54. about 55. out 56. many 57. then 58. them 59. these 61. some 62. her 63. would 64. make 65. like 66. him 67. into 68. time 69. has 70. look 71. two 72. more 73. write 74. go 75. see 76. number 77. no 78. way 79. could 81. my 82. than 83. first 84. water 85. been 86. call 87. who 88. oil 89. its 90. now 91. find 92. long 93. down 94. day 95. did 96. get 97. come 98. made

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

统计学词汇中英文对照完整版 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 , 评估从一个时间点到下一个时间点回归相关时的误差

完整版统计学专业名词中英对照.doc

统计学专业名词·中英对照 我大学毕业已经多年,这些年来,越发感到外刊的重要性。读懂外刊要有不错的英语功底,同时,还需要掌握一定的专业词汇。掌握足够的专业词汇,在国内外期刊的阅读和写作中会游刃有余。 在此小结,按首字母顺序排列。这些词汇的来源,一是专业书籍,二是网上查找,再一个是比较重要的期刊。当然,这些仅是常用专业词汇的一部分,并且由于个人精力、文献查阅的限制,难免有不足和错误之处,希望读者批评指出。 A abscissa 横坐标 absence rate缺勤率 Absolute deviation 绝对离差 Absolute number 绝对数 absolute value 绝对值 Absolute residuals 绝对残差 accident error 偶然误差 Acceleration array 加速度立体阵 Acceleration in an arbitrary direction 任意方向上的加速度 Acceleration normal 法向加速度 Acceleration space dimension 加速度空间的维数 Acceleration tangential 切向加速度 Acceleration vector 加速度向量 Acceptable hypothesis 可接受假设 Accumulation 累积

Accumulated frequency 累积频数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 data 分析资料Analysis Of Effects 效应分析Analysis Of Variance 方差分析Analysis of regression 回归分析

统计英文词汇

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全面调查

单词的检索与计数教材

内江师范学院计算机科学学院 数据结构课程设计报告 课题名称:文本文件单词的检索与计数 姓名: 学号: 专业班级:软件工程 系(院):计算机科学学院 设计时间: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),是文本

统计学英语词汇

https://www.360docs.net/doc/431357363.html, 统计学专业词汇英语翻译  大蚂蚱社区 https://www.360docs.net/doc/431357363.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.360docs.net/doc/431357363.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

词频统计 C代码

词频统计排序 统计英文文献中的词频,并排序 作业单词统计部分采用字典树的方法将单词分类并统计,然后采用字典树的遍历将字典树统计的字符按顺序拼接并将词频读出统一存入数组中,最后采用冒泡排序的方法将数组中的词频按从小到大的顺序排列并输出到文件中。 源代码: #include #include #include #define MAX 27 //26个字母和' //字典树的结构体定义 typedef struct Word { Word *next[MAX]; //数组下标0-25代表小写字母,26' int num; }; //结构体定义:单词和对应频率 typedef struct tlist { char word[200]; int time; }; struct tlist list[3000000]; Word *root; char str[200]=""; char tempword[1000]; int size=0; //新建单词的函数 void createWord(char *str) { int len = strlen(str), id; Word *p = root, *q; for(int i = 0; i < len; i ++)//遍历单词判断当前字符是否为字母或' { if(str[i] >= 'a' && str[i] <= 'z') id = str[i] - 'a'; if(str[i] >= 'A' && str[i] <= 'Z')

id = str[i] - 'A'; if(str[i] == '\'') id = 26; if(p->next[id] == NULL)//若已到达链表结尾,开辟新的结构体存入字母 { q = (Word *)malloc(sizeof(Word)); for(int j = 0; j < MAX; j ++) {q->num=0;q->next[j] = NULL;} p->next[id] = q; p = p->next[id]; } else//若未到达链表结尾,指针指向下一个 { p = p->next[id]; } } p->num++; } //读单词的函数 void readWord(Word *p,int len) { int i; for(i=0;i<27;i++) { if(p->next[i]!=NULL) { if (i==26) {str[len+1]='\0';str[len]='\'';len++;} else { str[len]='a'+i; len++; } readWord((Word*)p->next[i],len); len--; } } if(p->num!=0) { str[len]='\0' ; strcpy(list[size].word,str); //如果遇到单词结束标志,将str存入list[size].word

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

下面是常见的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

统计用的英文单词

统计用的英文单词 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 似然函数

课设报告统计英文单词数

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

该系统的功能是给定一个英文段落(单词个数<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 {

统计学专业词汇中英对照

统计学专业词汇中英对照 Absolutedeviation,绝对离差 Absolutenumber,绝对数 Absoluteresiduals,绝对残差 Accelerationarray,加速度立体阵Accelerationinanarbitrarydirection,任意方向上的加速度Accelerationnormal,法向加速度Accelerationspacedimension,加速度空间的维数Accelerationtangential,切向加速度 Accelerationvector,加速度向量 Acceptablehypothesis,可接受假设 Accumulation,累积 Accuracy,准确度 Actualfrequency,实际频数 Adaptiveestimator,自适应估计量 Addition,相加 Additiontheorem,加法定理 Additivity,可加性 Adjustedrate,调整率 Adjustedvalue,校正值 Admissibleerror,容许误差 Aggregation,聚集性 Alternativehypothesis,备择假设 Amonggroups,组间 Amounts,总量 Analysisofcorrelation,相关分析 Analysisofcovariance,协方差分析 Analysisofregression,回归分析 Analysisoftimeseries,时间序列分析 Analysisofvariance,方差分析 Angulartransformation,角转换 ANOVA(analysisofvariance),方差分析 ANOVAModels,方差分析模型 Arcing,弧/弧旋 Arcsinetransformation,反正弦变换 Areaunderthecurve,曲线面积 AREG,评估从一个时间点到下一个时间点回归相关时的误差ARIMA,季节和非季节性单变量模型的极大似然估计Arithmeticgridpaper,算术格纸 Arithmeticmean,算术平均数 Arrheniusrelation,艾恩尼斯关系 Assessingfit,拟合的评估 Associativelaws,结合律

常用统计词汇

常用统计词汇 随着外语的普及,下面一些常用的统计词汇是我们必须掌握的: 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 , 校正值 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, 角转换 ANOV A (analysis of variance), 方差分析 ANOV A Models, 方差分析模型 Arcing, 弧/弧旋 Arcsine transformation, 反正弦变换 Area under the curve, 曲线面积 AREG , 评估从一个时间点到下一个时间点回归相关时的误差ARIMA, 季节和非季节性单变量模型的极大似然估计Arithmetic grid paper, 算术格纸 Arithmetic mean, 算术平均数 Arrhenius relation, 艾恩尼斯关系 Assessing fit, 拟合的评估 Associative laws, 结合律

相关文档
最新文档