Does anyone know how to begin to develop a word counter that can access an input file, read the individual words within the file, and print them along with the number of times they appeared within the document? As in:
Input:
Output:Word sense disambiguation is the process of selecting
the most appropriate meaning for a word, based on
the context in which it occurs. For our purposes it is
assumed that the set of possible meanings, i.e., the
sense inventory, has already been determined. For
example, suppose bill has the following set of possible
meanings: a piece of currency, pending legislation,
or a bird jaw. When used in the context of The
Senate bill is under consideration, a human reader
immediately understands that bill is being used in
the legislative sense. However, a computer program
attempting to perform the same task faces a difficult
problem since it does not have the benefit of innate
common-sense or linguistic knowledge.
To do this, I was thinking of using the Scanner class to get the data, but I'm not sure how to split the paragraph into words, and to associate a counter with the words after.Word: 1
sense: 4
disambiguation: 1
is: 4
the: 10
process: 1
of: 6
selecting: 1
most: 1
appropriate: 1
meaning: 1
for: 1
a: 6
word: 1
based: 1
on: 1
context: 2
in: 4
which: 1
it: 3
occurs: 1
For: 2
our: 1
purposes: 1
assumed: 1
that: 2
set: 2
possible: 2
meanings: 2
other: 1
words: 1
inventory: 1
has: 2
already: 1
been: 1
determined: 1
example: 1
suppose: 1
bill: 3
following: 1
piece: 1
currency: 1
pending: 1
legislation: 1
or: 2
bird: 1
jaw: 1
When: 1
used: 2
The: 1
Senate: 1
under: 1
consideration: 1
human: 1
reader: 1
immediately: 1
understands: 1
being: 1
legislative: 1
However: 1
computer: 1
program: 1
attempting: 1
to: 1
perform: 1
same: 1
task: 1
faces: 1
difficult: 1
problem: 1
since: 1
does: 1
not: 1
have: 1
benefit: 1
innate: 1
common: 1
linguistic: 1
knowledge: 1
Any help would be greatly appreciated!
Bookmarks