Solved

Top 10 most used words in a text document

Posted on 2009-04-07
4
691 Views
Last Modified: 2012-08-13
How do I get the top 10 most used words in a text document ?
Any examples out their ?
0
Comment
Question by:u2envy1
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 250 total points
ID: 24086236
One way would be to read each word in the document, and add it to a list.  Then do a count of how many times each word appears.
0
 

Author Comment

by:u2envy1
ID: 24086330
How will I do the count ? Then do a count of how many times each word appears.
If I have a list List<string> myList = new List<String>();
How do I count ?
myList.Add("The");
myList.Add("lazy");
myList.Add("Brown");
myList.Add("Fox");
myList.Add("was");
myList.Add("too");
myList.Add("lazy");
myList.Add("to");
myList.Add("jump");
myList.Add("over");
myList.Add("the");
myList.Add("brown");
myList.Add("dog");

0
 
LVL 29

Assisted Solution

by:Gautham Janardhan
Gautham Janardhan earned 250 total points
ID: 24086541
u can use the grioup by function available for the list to group by the words and then check the count
0
 

Author Closing Comment

by:u2envy1
ID: 31567444
Thx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question