Is there a way to read a single character at a time from the input and process it, without tokenizing the vocabulary?
The toCharArray() function on Strings might be useful here.
for(char c : s.toCharArray())
System.out.println(c);
And to print only the lowercase ones in the string- Thanks @fge
for(Character c : s.toCharArray()){
if(Character.isLowerCase(c))
System.out.println(c);
}
You can use Guava's CharMatcher to extract lower case letters from your string, then use Joiner to put each character on a new line.
You can do all this in a single line of code as shown below:
System.out.println(Joiner.on('\n').join(Lists.charactersOf(CharMatcher.JAVA_LOWER_CASE.retainFrom(s))));
You can use read() from BufferedReader which reads one char
at a time.