Yes you are right you have understood my need correctly here is my updated code still i am confused about using Regular Expression.
import java.io.*;
import java.util.*;
class...
Type: Posts; User: Dinesh Raja
Yes you are right you have understood my need correctly here is my updated code still i am confused about using Regular Expression.
import java.io.*;
import java.util.*;
class...
The variable "n" has been replaced by "k".
k is used for storing an number which says the top occurring words i mean if hello:4,hi:3,norm:1 and the user enters 2 for "k" then hello:4,hi:3 is only...
Yes it must read ALL THE WORDS from ALL the files present in the path and add them all to the ArrayList BEFORE sorting.
I am sorry forgot to press "Shift" while typing "C" yes its built-in...
Here is the design
1)The application must prompt the user to enter the number "n" which is the top frequent words if n=2 the code must show the top two words with largest count as a result.
2)The...
now i have replaced j+1 with j now no exception is thrown.
Kindly check my previous post i have modified the logic now using ArrayList and Collections.frequency function to count the frequency of...
Norm,here i have modified the code now i have decided to read the file contents and add it to an List(ArrayList) by splitting the contents by space and i am using the inbuilt function of collection...
After adding the printing statement to print the line variable contents my output is as follows:
Enter the number of words to find its frequency:
3
Enter the file path to analyse the words:...
i have made the code to store the contents of line variable as an string array (words) by using space as delimiter and i am printing the contents of that words array,I have not made the code as to...
sorry i will follow this method of posting right from now thanks for being patient with my mistakes and here is the code which i am having now
import java.io.*;
import java.util.*;
class...
Okay i have revoked the change in scanner object and i have added the println statement after splitting the contents by space (Line number:33)Norm
import java.io.*;
import java.util.*;
class Counter {
public static void main(String[] args) throws NullPointerException {
System.out.println("Enter the number of words to find...
I commented out the second scanner object "scan 1" now its not allowing me to enter an text its not listening here is the output
Enter the number of words to find its frequency:
3
Enter the file...
here is the output after adding "System.out.println("1"+ java.util.Arrays.toString(words));"
Enter the number of words to find its frequency:
3
Enter the file path to analyse the words:...
import java.io.*;
import java.util.*;
class Counter {
public static void main(String[] args) throws NullPointerException {
System.out.println("Enter the number of words to find...
yes i am sorry i have forgot about that post :( i will continue from there
Yes Norm but i have forgot about this post i am sorry for posting the same problem again but i have updated the code now i will remove my new post and continue it here :)
--- Update ---
I have...
Hi,I am working on an small assignment to read the text file(s) and count the frequency of words occurring in those files and print the top n words (which user will specify) and print the word and...
Actually i have not coded it i am asking how can i do that and the root word can be in any part of the text like it can start with or endwith or it may contain it.
I am defining based on my code requirements if my code reads an text file a.txt it contains 6 words say big,bigger,biggest and long,longest then the root words are big and long so my code needs to...
Can i use substring formation?or is there any other good way for it
But my code is going to find the frequency of words for an random file which the user selects so its not possible to predetermine the root words list and use it for reference :-(
Thats why i am confused how can i achieve it i couldnt find any logic for this but i need to do that in my code :(
I meant to say that for example tallest and taller are derived or enhanced from the word "tall" so now the frequency of tall must be 3
I am sorry in a hurry i made the post like that now i have...
Hello i am doing an small project to find the top "n" words of an text file based on their frequency of occurrence but i am having few problems in my code now its printing the number of occurrences...
i have found that using BK-tree algorithm will be efficient way i am going through it :)