Question: Write java code. 1) Reversing Tokens String Tokenization A common task in text processing is to parse a string by deleting the surrounding whitespace characters,
Write java code.
1) Reversing Tokens
String Tokenization A common task in text processing is to parse a string by deleting the surrounding whitespace characters, keeping just the discrete words or tokens which remain. A token is a maximal substring which contains no whitespace characters. For instance consider the preceding sentence to be a string. The tokens in this string are listed as: ("A", "token", "is", "a", "maximal", "substring", "which", "contains", "no", "whitespace", "characters"). Whitespace here is defined to mean spaces, newlines, and tab characters. Using what you know about tokens, make a program that accepts a file called input.txt, reads in all of the tokens in the file, and for each token reverses the token so that it prints the token backwards. The program should print these reversed tokens to a file called output.txt. Your program should be able to accept any arbitrarily sized files, (there should be no limit to the number of words it can reverse) You should submit just the java file itself, however your program should be able to accept and handle any input.txt file that is run against it.
Example
input.txt: The Quick Brown Fox
output.txt ehT kciuQ nworB xoF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
