First I thank anyone who takes the time to help. The internet community is so essential for learning.
Overall goal: I am inputting .txt file, stemming it using a Java build of The 2003 CIIR KStemmer in Eclipse, and outputting a list of stemmed words into a different .txt file.
Easy: inputting the .txt, sorting the .txt into an array of strings or chars, outputting the .txt
Problem: I don't understand how to use the stemmer within my main code.
I have included the CIIR code in a class file (KStemmer.java) and imported the following libraries:
apache-lucene-analyzers.jar
apache-lucene.jar
lucene-analyzers-common-4.2.0.jar
lucene-core-3.4.0.jar
In my main class (StemThis.Java) I want to do something like this:
String wordFromTextFile = new String(); // input word
String stemmedWord = new String(); // output word
printer = new PrintWriter("outputFile") // for file export
KStemmer newStemmer = new KStemmer(); // creating a stemmer
newStemmer.stem(wordFromTextFile); // stemming a word
stemmedWord = newStemmer.return(); // get stemmed word from stemmer
printer.println(stemmedWord); // desired output method
This is obviously too simple. Maybe the KStemmer does not work this way. How do I put strings into a KStemmer and get an output?