A simplified interface to the noun singularization services provided by ULStemmer.
More...
#include <ulsingularizer.h>
A simplified interface to the noun singularization services provided by ULStemmer.
ULSingularizer::ULSingularizer |
( |
| ) |
|
ULSingularizer::~ULSingularizer |
( |
| ) |
|
|
virtual |
void ULSingularizer::clear |
( |
| ) |
|
Sets this singularizer to its default state.
Computes all singulars for the specified word, if any exist. This interface is intended to provide completeness, since there is an occasional word that is the plural form for more than one singular noun (e.g. "busses", which is one of the allowed plural forms for "bus", and also the plural form of the archaic word "buss"). However, we strongly recommend the use of the getSingular method in most applications, since "busses" situations are so rare.
- Returns
- ULError::NoError if the operation was successful, ULError::NoMatch if there are no singular nouns for which the specified word is a plural, or ULError::ObjectUninitialized if this ULSingularizer is uninitialized.
- Parameters
-
[in] | word | The word for which the singular forms are desired. |
[out] | singularList | The list of singular forms corresponding to the given word. |
- Parameters
-
[out] | serviceList | Used to return a list of all the services this ULWorker can provide. |
Implements ULWorker.
- Returns
- a pointer to the ULDissector used by this singularizer.
const ULLanguage & ULSingularizer::getLanguage |
( |
| ) |
const |
- Returns
- the language for which this singularizer is able to compute singulars.
Computes a singular for the specified word, if one exists.
This interface is more convenient than that of getAllSingulars, and gives you complete singular information for all plural nouns that correspond to only one singular (which is the vast majority of cases). But for those few plurals that have multiple singulars (e.g. busses –> bus/buss), getSingular only returns one of the available singulars. Still, the number of such cases is so small that we strongly recommend using getSingular instead of getAllSingulars.
- Returns
- ULError::NoError if the operation was successful, ULError::NoMatch if there are no singular nouns for which the specified word is a plural, or ULError::ObjectUninitialized if this ULSingularizer is uninitialized.
- Parameters
-
[in] | word | The word for which a singular form is desired. |
[out] | singular | The singular form for the given word. |
- Returns
- true if the specified service can be performed by this ULWorker, and false otherwise.
- Parameters
-
service | The desired service. |
Implements ULWorker.
void ULSingularizer::setDissector |
( |
ULDissector * |
newDissector | ) |
|
Sets the ULDissector to be used by this singularizer. This ULSingularizer does not take responsibility for deleting the dissector. That will need to happen elsewhere (typically the ULFactory will take care of it if your application uses ULFactory to instantiate data sources and workers). param[in] newDissector A pointer to the desired dissector.
The documentation for this class was generated from the following files: