1.需求:对于给定的英文文章进行单词频率的统计 2.分析: (1)建立一个如下图所示的数据库表word_frequency用来存放单词和其对应数量 (2)Scanner输入要查询的英文文章存入String中 (3)对String根据空格进行拆分存入word_frequency表中,并统计相应数量 (4)对word_frequency表中的数据按照频率由大到小,频率相同的情况下按照字母表顺序排序并输出 3.具体实现代码: 4.输入语句:You should help to set the dinn
测试项目 博客文章地址:[http://www.cnblogs.com/jx8zjs/p/5862269.html] 工程地址:https://coding.net/u/jx8zjs/p/wordCount/git ssh://git@git.coding.net:jx8zjs/wordCount.git 测试用例: 1. My English is very very pool 2.地址 [http://www.gutenberg.org/files/2600/2600-0.txt] 待测单元
本周根据杨老师的spec对英语文章词频统计进行了改进 1.需求分析: 对英文文章中的英文单词进行词频统计并按照有大到小的顺序输出, 2.算法思想: (1)构建一个类用于存放英文单词及其出现的次数 class WordAndNum{ public String word; public int num; } (2)从txt中获取字符串 BufferedReader in=new BufferedReader(new FileReader("D:\\test.txt")); String
计数 直接上代码 public class LocalStormSumTopology { public static void main(String[] agrs) { //Topology是通过build模式创建出来的 //storm中的所有作业都是通过topology来指定的 TopologyBuilder builder = new TopologyBuilder(); //在设置bolt到topology时,需要设置该bolt的上游的spout或者bolt的id,这样topology