Piet Souris wrote:hi Jeremiah,
the exception arises because in file real2.txt line 55 is empty. This is the relevant part of that file:
Carey Brown wrote:It gets a bit tricky when you have two different line formats you have to detect. One possible way of dealing with this is to have a Scanner for the file and use hasNextLine() / nextLine() to get a line. Then create a new Scanner for the String returned by nextLine(). The String Scanner can then detect whether it has one or two int values using hasInt() & nextInt().
Junilu Lacar wrote:On which lines are your friends getting a different number of lexemes than you are? I can't imagine they'd get more than 1 for the lines where you got 1, so the difference in totals must come from other lines. If my math is right, your total is 82 lexemes. What are the extra 11 that they counted that you didn't?