Package net.ontopia.topicmaps.classify
Class FrequencyAnalyzer
- java.lang.Object
-
- net.ontopia.topicmaps.classify.FrequencyAnalyzer
-
- All Implemented Interfaces:
TermAnalyzerIF
public class FrequencyAnalyzer extends Object implements TermAnalyzerIF
INTERNAL: A frequency table giving the frequency with which a particular word is used in a particular language.
-
-
Constructor Summary
Constructors Constructor Description FrequencyAnalyzer(File file)
INTERNAL: Loads a frequency table from a file.FrequencyAnalyzer(String filename)
INTERNAL: Loads a frequency table as a resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
analyzeTerm(Term term)
void
endAnalysis()
void
startAnalysis(TermDatabase tdb)
-
-
-
Field Detail
-
freqs
protected gnu.trove.map.hash.TObjectDoubleHashMap<String> freqs
-
-
Constructor Detail
-
FrequencyAnalyzer
public FrequencyAnalyzer(String filename)
INTERNAL: Loads a frequency table as a resource. The format is a plain text file where each line is 'term;factor' where factor is a real in the range 0-1. The score of the term after classification is multiplied with the factor. Thus, a factor of 0.5 will reduce the score of the term by half.
-
FrequencyAnalyzer
public FrequencyAnalyzer(File file)
INTERNAL: Loads a frequency table from a file. The format is a plain text file where each line is 'term;factor' where factor is a real in the range 0-1. The score of the term after classification is multiplied with the factor. Thus, a factor of 0.5 will reduce the score of the term by half.
-
-
Method Detail
-
analyzeTerm
public void analyzeTerm(Term term)
- Specified by:
analyzeTerm
in interfaceTermAnalyzerIF
-
startAnalysis
public void startAnalysis(TermDatabase tdb)
- Specified by:
startAnalysis
in interfaceTermAnalyzerIF
-
endAnalysis
public void endAnalysis()
- Specified by:
endAnalysis
in interfaceTermAnalyzerIF
-
-