/** * Test program for demonstrating the Stemmer. It reads a file and stems each word, writing the * result to standard out. Usage: Stemmer file-name * * @param args command-line args */ public static void main(String[] args) { PorterStemmer s = new PorterStemmer(); for (int i = 0; i < args.length; i++) { for (int j = 0; j < args[i].length(); j++) { s.add(args[i].charAt(j)); } s.stem(); System.out.println(s.toString()); s.reset(); } }