术语频率使用java程序 [英] term frequency using java program

查看:119
本文介绍了术语频率使用java程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一套文件。我想知道每个文档中每个单词的频率计数(即)使用java程序的术语频率。提前致谢。我知道如何找到每个单词的频率计数。我的问题是如何从文档列表中获取每个文档中的唯一单词

I have set of documents. I want to know the frequency count of each word in each document (i.e) term frequency using java program. thanks in advance. I know how to find the frequency count for each word. My question is about how to take the unique words in each document from the list of documents

推荐答案

您可以在空格上拆分文档和标点符号,遍历生成的数组,然后计算每个单词的频率( Map< String,Integer> 将真正帮助你解决这个问题。)

You can split your documents on spaces and punctuation, go through the resulting array and then count frequency for each word (a Map<String, Integer> would really help you with this).

资源:

  • Java - faster data structure to count word frequency?

关于同一话题:

  • How to count words in java

这篇关于术语频率使用java程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆