java - sentence counter from a file -
I'm trying to create a simple program that counts the word, some strings and sentences. I have a counter counter and I have a counter that some strings are counted, but I can not understand how to count the sentences if I essentially have more than one. "
So far this is my code ..
int count = 0; // When there is something in the file, while reading and counting (inputFile.hasNext ()) {string token = inputFile.next (); Count ++; } Int characters = 0; Scanner scanner = new scanner (file); While (scanner.hasNextLine ()) {string next token = scanner.xt (); If (nextToken.equalsIgnoreCase ("for")) {Letters ++; }} There are many libraries that you can try, more complex people like NALP, such as Penispip, Waka and Gate. (See)
It all depends on how deep you want to look at it.
Comments
Post a Comment