Package com.netrics.likeit
Class NetricsBaseThesaurus
- java.lang.Object
-
- com.netrics.likeit.NetricsBaseThesaurus
-
- Direct Known Subclasses:
NetricsCombinedThesaurus
,NetricsThesaurus
,NetricsWeightedDictionary
public abstract class NetricsBaseThesaurus extends java.lang.Object
This is an internal base class implementing thesaurus common functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
addClassesFrom(NetricsFieldedReader rsrc)
Load classes from aNetricsFieldedReader
source.void
setCharmap(java.lang.String name)
Set the character map for this thesaurus.void
setExactMatchMode()
Select exact match mode.java.lang.String
toString()
-
-
-
Method Detail
-
addClassesFrom
public abstract int addClassesFrom(NetricsFieldedReader rsrc) throws NetricsFileFormatException, NetricsException
Load classes from aNetricsFieldedReader
source. The data in the source must match the thesaurus type (NetricsCombinedThesaurus
, etc.)- Parameters:
rsrc
- The data source- Returns:
- the number of classes added.
- Throws:
NetricsFileFormatException
- If the file has invalid content.NetricsException
- If an equivalence class is invalid.
-
setCharmap
public void setCharmap(java.lang.String name)
Set the character map for this thesaurus.
Set the character map that is used to map all class entries. This should be the same character map assigned to the table fields this thesaurus will be applied to. It defaults to the standard character map.- Parameters:
name
- The name of an existing character map.
-
setExactMatchMode
public void setExactMatchMode()
Select exact match mode.
Calling this method sets the match mode to exact matching. By default the match mode is set to inexact match mode. With an exact match mode terms must match exactly (after the character map is applied) for the thesaurus match and any associated weighting or penalty to be applied. In the default inexact mode a match will be applied even if the term in the query or record is slightly different than the term in the thesaurus. The amount of difference allowed between the thesaurus term and the term in the record or query is determined by the length of the term, short terms must match exactly, longer terms allow one or two character differences.
One place where exact mode may be appropriate is when you you have terms in your thesaurus that are very similar but must not be confused.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-