Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

Top 10 most used words in a text document

How do I get the top 10 most used words in a text document ?
Any examples out their ?
0
u2envy1
Asked:
u2envy1
  • 2
2 Solutions
 
angus_young_acdcCommented:
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
 
u2envy1Author Commented:
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
 
Gautham JanardhanCommented:
u can use the grioup by function available for the list to group by the words and then check the count
0
 
u2envy1Author Commented:
Thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now