ULAPI  8.0
Public Member Functions | List of all members
ULSingularizer Class Reference

A simplified interface to the noun singularization services provided by ULStemmer. More...

#include <ulsingularizer.h>

Public Member Functions

 ULSingularizer ()
 
 ULSingularizer (const ULSingularizer &other)
 
virtual ~ULSingularizer ()
 
ULSingularizeroperator= (const ULSingularizer &other)
 
void clear ()
 
ULDissectorgetDissector ()
 
void setDissector (ULDissector *newDissector)
 
const ULLanguagegetLanguage () const
 
virtual bool isServiceAvailable (const ULServiceDescriptor &service)
 
virtual void getAvailableServices (ULList< ULServiceDescriptor > &services)
 
ULError getSingular (const ULString &word, ULString &singular)
 
ULError getAllSingulars (const ULString &word, ULList< ULString > &singularList)
 
- Public Member Functions inherited from ULWorker
 ULWorker ()
 
virtual ~ULWorker ()
 
virtual void setCancelOperation (bool shouldCancel)
 
virtual bool shouldCancelOperation () const
 

Detailed Description

A simplified interface to the noun singularization services provided by ULStemmer.

Constructor & Destructor Documentation

ULSingularizer::ULSingularizer ( )

Default constructor.

ULSingularizer::ULSingularizer ( const ULSingularizer other)

Copy constructor.

ULSingularizer::~ULSingularizer ( )
virtual

Destructor.

Member Function Documentation

void ULSingularizer::clear ( )

Sets this singularizer to its default state.

ULError ULSingularizer::getAllSingulars ( const ULString word,
ULList< ULString > &  singularList 
)

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]wordThe word for which the singular forms are desired.
[out]singularListThe list of singular forms corresponding to the given word.
void ULSingularizer::getAvailableServices ( ULList< ULServiceDescriptor > &  serviceList)
virtual
Parameters
[out]serviceListUsed to return a list of all the services this ULWorker can provide.

Implements ULWorker.

ULDissector * ULSingularizer::getDissector ( )
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.
ULError ULSingularizer::getSingular ( const ULString word,
ULString singular 
)

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]wordThe word for which a singular form is desired.
[out]singularThe singular form for the given word.
bool ULSingularizer::isServiceAvailable ( const ULServiceDescriptor service)
virtual
Returns
true if the specified service can be performed by this ULWorker, and false otherwise.
Parameters
serviceThe desired service.

Implements ULWorker.

ULSingularizer & ULSingularizer::operator= ( const ULSingularizer other)

Assignment operator.

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: