A simplified interface to the noun pluralization services provided by ULInflector.
More...
#include <ulpluralizer.h>
A simplified interface to the noun pluralization services provided by ULInflector.
ULPluralizer::ULPluralizer |
( |
| ) |
|
ULPluralizer::~ULPluralizer |
( |
| ) |
|
|
virtual |
void ULPluralizer::clear |
( |
| ) |
|
Sets this pluralizer to its default state.
Computes all plural forms for the specified noun.
If you know for sure that your word is a singular noun, you might prefer the method getAllPluralsFromSingular, which is somewhat faster that getAllPlurals. getAllPlurals first stems the submitted word to determine whether it is a noun at all, and if so, whether it is already a plural. getAllPluralsFromSingular saves time by not performing this check. For example, getAllPluralsFromSingular applied to "buses" will return "buseses", while getPlural will return "buses" and "busses". Both, however, will produce "buses" and "busses" when given "bus".
- Returns
- ULError::NoError if the operation was successful, or another ULError value if not.
- Parameters
-
[in] | word | The word for which plurals are requested. |
[out] | pluralList | The list of plural forms for the given singular noun. |
Computes all plural forms for the specified noun.
This method assumes that you are giving it a singular form, and makes its best effort to pluralize that form. Thus, if you hand it a noun that is already plural (or even a non-noun), you may get strange results (e.g. "fruits" will result in "fruitses"). If you want your word to be analyzed first to make sure it is not already a plural (and to determine whether it is a noun at all), you should use getPlural or getAllPlurals method. Those methods are slower, but they will allow you to submit any word and get the word's plural form if one exists.
- Returns
- ULError::NoError if the operation was successful, or another ULError value if not.
- Parameters
-
[in] | singular | The singular of the noun for which plurals are requested. |
[out] | pluralList | The list of plural forms for the given singular noun. |
- 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 pluralizer to determine the singular of a specified word before trying to compute its plural forms.
- Returns
- a pointer to the ULInflector used by this pluralizer to compute plurals.
const ULLanguage & ULPluralizer::getLanguage |
( |
| ) |
const |
- Returns
- the language for which this pluralizer is able to compute plurals.
Computes a plural for the specified word, if one exists. This interface is more convenient than that of getAllPlurals, and gives you complete plural information for all nouns that have only one plural. But for nouns that have multiple plurals (e.g. buses/busses, octopuses/octopi), getPlural only returns one of the available plurals.
If you know for sure that your word is a singular noun, you might prefer the method getPluralFromSingular, which is somewhat faster that getPlural. getPlural first stems the submitted word to determine whether it is a noun at all, and if so, whether it is already a plural. getPluralFromSingular saves time by not performing such a check. For example, getPluralFromSingular applied to "cats" will return "catses", while getPlural will return "cats".
- Returns
- ULError::NoError if the operation was successful, or another ULError value if not.
- Parameters
-
[in] | singular | The singular of the noun for which a plural is requested. |
[out] | plural | One of the plural forms for the given singular noun. |
Computes a plural for the specified noun. This interface is more convenient than that of getAllPlurals, and gives you complete plural information for all nouns that have only one plural. But for nouns that have multiple plurals (e.g. buses/busses, octopuses/octopi), getPlural only returns one of the available plurals.
This method assumes that you are giving it a singular form, and makes its best effort to pluralize that form. Thus, if you hand it a noun that is already plural (or even a non-noun), you may get strange results (e.g. "fruits" will result in "fruitses"). If you want your word to be analyzed first to make sure it is not already a plural (and to determine whether it is a noun at all), you should use getPlural or getAllPlurals method. Those methods are slower, but they will allow you to submit any word and get the word's plural form if one exists.
- Returns
- ULError::NoError if the operation was successful, or another ULError value if not.
- Parameters
-
[in] | singular | The singular of the noun for which a plural is requested. |
[out] | plural | One of the plural forms for the given singular noun. |
- Returns
- true if the specified service can be performed by this ULWorker, and false otherwise.
- Parameters
-
service | The desired service. |
Implements ULWorker.
void ULPluralizer::setDissector |
( |
ULDissector * |
newDissector | ) |
|
- Parameters
-
[in] | newDissector | A pointer to the ULDissector to be used by this pluralizer to determine the singular of a specified word before trying to compute its plural forms. |
void ULPluralizer::setInflector |
( |
ULInflector * |
newInflector | ) |
|
- Parameters
-
[in] | newInflector | A pointer to the ULInflector to be used by this pluralizer to compute plurals. |
The documentation for this class was generated from the following files: