I have been instructed with what I would call creating an Index.
Basically, the user is expected to be able to right some text in an empty text box. At the click of a button, the output is expected to show an alphabetically sorted list of the words entered, as well as a line number at which they appear.
so for example:
One fish
two fish
red fish
blue fish.
Black fish
blue fish
old fish
new fish.
This one has
a little star.
This one has a little car.
Say! What a lot
of fish there are.
A 12, 14, 15
ARE 16
BLACK 6
BLUE 4, 7
CAR 14
FISH 1, 2, 3, 4,
HAS 11, 14
LITTLE 12, 14
LOT 15
NEW 9
OF 16
OLD 8
ONE 1, 11, 14
RED 3
SAY 15
STAR 12
THERE 16
THIS 11, 14
TWO 2
WHAT 15
This text was used with reference from a Java document for creating an Index and I followed it through and the expectations are the same as mine, just in another language.
I'm working on paper at the minute to work out an algorithm but I'm getting a little frustrated with my efforts!
A couple of more requirements:
The maximum amount of line number occurrences is 4 so even if a word occurs on 10 different lines, it should only be referenced 4 times
Grammar must be ignored so words which contain !.,? must be removed Words which are spelt :HeLlO must be spelt: hello
Thank you in advanced for the help