public class NetricsCombinedThesaurus
extends java.lang.Object
Constructor and Description |
---|
NetricsCombinedThesaurus(java.lang.String name)
Create an empty combined thesaurus.
|
NetricsCombinedThesaurus(java.lang.String name,
java.lang.String filename,
java.lang.String encoding)
Create a combined thesaurus from a server side CSV file.
|
Modifier and Type | Method and Description |
---|---|
int |
addClassesFrom(NetricsFieldedReader rsrc)
Add a set of classes from a fielded source.
|
void |
addEquivalenceClass(java.lang.String[] terms,
double weight,
double penalty)
Add a set of related terms with associated weight and penalty.
|
void |
setCharmap(java.lang.String name)
Set the character map for this thesaurus.
|
void |
setExactMatchMode()
Select exact match mode.
|
public NetricsCombinedThesaurus(java.lang.String name)
name
- The name of the combined thesaurus to be created.NetricsThesaurus
,
NetricsWeightedDictionary
public NetricsCombinedThesaurus(java.lang.String name, java.lang.String filename, java.lang.String encoding)
name
- The name of the combined thesaurus to be created.filename
- The name of the file readable by the server
from which to read the thesaurusencoding
- This defines the character encoding used
in the file. Currently supported encodings are:
"UTF-8" or "LATIN1". DEFAULT: "LATIN1"NetricsThesaurus
,
NetricsWeightedDictionary
public void addEquivalenceClass(java.lang.String[] terms, double weight, double penalty)
terms
- The terms to be weighted.weight
- The weight of the term.penalty
- The substitution penalty for terms in this class.public int addClassesFrom(NetricsFieldedReader rsrc) throws NetricsFileFormatException, NetricsException
rsrc
- a NetricsFieldedReader object that provides the
equivalence classes.NetricsFileFormatException
- if there was an error reading
records from the source.NetricsException
- if an equivalence class has less than 3
entries or the first two are not valid float values.NetricsCSVReader
public void setCharmap(java.lang.String name)
name
- The name of an existing character map.public void setExactMatchMode()