I am writing a parser that removes all punctuation from a text file and puts the words in a Map that associates each word with the number of times it occurs in the file. I use a Scanner to read the txt file, but it reads the file name instead of the actual file. For instance:
parse("./src/filename.txt")
is read as "srcfilenametxt" and is associated with a value 1. Unfortunately, I can't include more code because this is for a class assignment. How do I get it to correctly read the file?
Scannerdoes not have aparse()method. You'll need to show us at least a bit more code. Where is aScannerinvolved here?