public class KeywordAnalyzer extends java.lang.Object implements Analyzer
Constructor and Description |
---|
KeywordAnalyzer()
Instantiates a TreeMap object as tokenCounts on creation.
|
KeywordAnalyzer(java.util.Properties properties)
Constructor for KeywordAnalyzer analyzer.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> |
getKeywordMap()
Accessor for the keywordMap instance variable.
|
java.lang.String |
getOutputFilePath()
Retrieves values from properties for path to output file.
|
void |
processToken(java.lang.String token)
Processes a single token.
|
void |
writeOutputFile(java.lang.String inputFilePath)
Writes a text file listing each keyword and a list of the positions in
which it occurs.
|
public KeywordAnalyzer()
public KeywordAnalyzer(java.util.Properties properties)
properties
- Properties - Properties file values for this analyzer.public java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> getKeywordMap()
public void processToken(java.lang.String token)
processToken
in interface Analyzer
token
- String - a single text token.public void writeOutputFile(java.lang.String inputFilePath)
writeOutputFile
in interface Analyzer
inputFilePath
- String - Path of the file being analyzed.public java.lang.String getOutputFilePath()