|
ibi Patterns .NET API
|
This class contains a list of synonyms that can be used while searching. More...
Public Member Functions | |
| NetricsThesaurus (String name) | |
| A thesaurus is used to equate terms which are not typographically similar. | |
| NetricsThesaurus (String name, String filename, String encoding) | |
| A thesaurus is used to equate terms which are not typographically similar. | |
| void | addEquivalenceClass (String[] terms) |
| Add an array of synonyms. | |
| int | addClassesFrom (NetricsFieldedReader rsrc) |
| Add a set of classes from a fielded source. | |
Public Member Functions inherited from NetricsServerInterface.NetricsBaseThesaurus | |
| void | setCharmap (String name) |
| Specifies the character map used to translate thesaurus entries. | |
| void | setExactMatchMode () |
| Select exact match mode. | |
This class contains a list of synonyms that can be used while searching.
|
inline |
A thesaurus is used to equate terms which are not typographically similar.
Dick is a commonly used nickname for Richard, and the terms should be considered to be equivalent. This can be accomplished by loading a thesaurus in which these two terms share an equivalence class. In general, all terms which are synonyms but are not typographically similar should be included in a thesaurus. If a term is included in two equivalence classes, it is considered to be a synonym for all terms in both classes. However, each term in the first class is not considered to be a synonym of each term in the second class. For instance, although duck might be a synonym for bird and crouch, bird and crouch are not considered synonyms.
This constructor creates an empty thesaurus, one with no equivalence classes. Classes must be added using the addClassesFrom or addEquivalenceClass methods.
| name | The name of the thesaurus |
Sample code
|
inline |
A thesaurus is used to equate terms which are not typographically similar.
In this case, thesaurus equivalence classes are loaded from a CSV file read by the server. Each line will be an equivalence class and terms are comma separated. Do not call addEquivalence class when using this constructor - it will throw an exception.
A sample Thesaurus csv file consisting of 2 records follows:
Margaret,Margie,Peggy
Inc,Incorporated
This sample code shows how to create a Thesaurus in the ibi™ Patterns - Search Server running on the localhost listening to port 5051.
| name | The name of the thesaurus to be created |
| filename | The name of the file (on the server) from which to read the thesaurus. The file must be located inside the server's loadable-data directory. |
| encoding | This defines the character encoding used in the file. Currently supported encodings are: "UTF-8" or "LATIN1". DEFAULT: "LATIN1" |
|
inline |
Add a set of classes from a fielded source.
This adds a set of equivalence classes from a fielded record source. Each fielded record is considered one equivalence class. Each equivalence class must have at least two entries.
| rsrc | A NetricsFieldedReader object that provides the equivalence classes. |
|
inline |
Add an array of synonyms.
| terms | All Strings which are elements of the array are considered to be equal for the purpose of record scoring. |