I hope someone can help, I need to read a text file that the user inputs, the program then has to find words that appear more than 3 or 4 times and replace them with a shorthand version.
so the following text:
"hello, some times some people say hello and some times they don't, times sure are changing, say hello to the future"
would be condensed and written to a new file as:
"hello(h*), some(*s) times(t*) s* people say h* and s* t* they don't, t* sure are changing, say h* to the future"
My idea was to take the input file, and add each string to an array. Then re-read the file, and check each word to see if it appears more than twice in the array. If it does then output is substring of the array concatenated with an asterix, otherwise just output the string as it appears. . . problem is I can't seem to implement my plan very effectively at all