Inflection
Morphology Inflection
|
Facilitates the creation of Concepts More...
#include <CommonConceptFactory.hpp>
Facilitates the creation of Concepts
Concepts can generally be defined as a way to lexically represent real-world or linguistic ideas. These ideas can vary greatly in scope, and range from the representation of a mathematical number by a language, to rules on how to properly affix a suffix to a token in order to represent plurality.
You should never instantiate this interface yourself. Instead use CommonConceptFactoryProvider to get an instance of this class for any supported locale.
To use this class, it is recommended to use LocalizedCommonConceptFactoryProvider::getDefaultCommonConceptFactoryProvider() to get a LocalizedCommonConceptFactoryProvider singleton, then use CommonConceptFactoryProvider::getCommonConceptFactory() to get a CommonConceptFactory in any supported locale:
Definition at line 31 of file CommonConceptFactory.hpp.
|
override |
Destructor
This destructor does NOT delete created concepts. Created concepts must be manually deleted.
|
pure virtual |
Returns a new SemanticConceptList based on an input std::vector
of concepts. The returned list is created using the semantically inclusive specifier (i.e. "and" in English).
An example of using this function would be creating an array of concepts using the input strings ["chocolate", "vanilla", "caramel"]
and the resulting output would be "chocolate, vanilla, and caramel"
.
The returned pointer is unmanaged and must be manually deleted.
concepts | std::vector of semantic feature concepts. These should be subclasses of SemanticFeatureConceptBase. |
|
pure virtual |
Returns a new SemanticConceptList based on an input std::vector
of concepts. The returned list is created using the semantically inclusive specifier (i.e. "and" in English).
An example of using this function would be creating an array of concepts using the input strings ["chocolate", "vanilla", "caramel"]
and the resulting output would be "chocolate, vanilla, and caramel"
.
The returned pointer is unmanaged and must be manually deleted.
concepts | std::vector of semantic feature concepts. These should be subclasses of SemanticFeatureConceptBase. |
|
pure virtual |
Returns a new InflectableStringConcept based on an input SpeakableString.
The returned pointer is unmanaged and must be manually deleted.
string | SpeakableString used to initialize the concept with a value to inflect upon. |
|
pure virtual |
Returns a new SemanticConceptList based on an input std::vector
of concepts. The returned list is created using the semantically optional specifier (i.e. "or" in English).
An example of using this function would be creating an array of concepts using the input strings ["chocolate", "vanilla", "caramel"]
and the resulting output would be "chocolate, vanilla, or caramel"
.
The returned pointer is unmanaged and must be manually deleted.
concepts | std::vector of semantic feature concepts. These should be subclasses of SemanticFeatureConceptBase. |
|
pure virtual |
Returns a new SemanticConceptList based on an input std::vector
of concepts. The returned list is created using the semantically optional specifier (i.e. "or" in English).
An example of using this function would be creating an array of concepts using the input strings ["chocolate", "vanilla", "caramel"]
and the resulting output would be "chocolate, vanilla, or caramel"
.
The returned pointer is unmanaged and must be manually deleted.
concepts | std::vector of semantic feature concepts. These should be subclasses of SemanticFeatureConceptBase. |
|
pure virtual |
Returns this ConceptFactory's underlying language.
|
pure virtual |
Returns a pointer to the inheriting ConceptFactory's SemanticFeatureModel.
|
pure virtual |
Returns a new NumberConcept based on this concept factory's language, the region format for printing and double
number. Returns a new NumberConcept based on a specified RequestContext and double
number.
The returned object is owned by the caller and must be deleted by the caller.
regionFormatLocale | The locale for printing the number. The language will be used for the speak value. |
number | The input number. |
|
pure virtual |
Returns a new NumberConcept based on this concept factory's language, the region format for printing and int64_t
number.
The returned object is owned by the caller and must be deleted by the caller.
regionFormatLocale | The locale for printing the number. The language will be used for the speak value. |
number | The input number. |
|
pure virtual |
Returns a new SpeakableString based on a NumberConcept and SemanticConcept.
Usage for this would be to automatically determine plurality rules for words. This is especially useful for words that have multiple rules based on amounts, such as Slavic languages, in which the genetive plural form has a different inflection.
For example in Russian:
0 years → 0 лет
1 year → 1 год
4 years → 4 года
5 years → 5 лет
100 years → 100 лет
The returned pointer is unmanaged and must be manually deleted.
number | An input NumberConcept to represent the amount. |
semanticConcept | An input SemanticConcept to represent the word to be inflected based on the amount. |
|
pure virtual |
Returns a new SpeakableString based on a NumberConcept, format number, and SemanticConcept.
The returned pointer is unmanaged and must be manually deleted.
number | An input NumberConcept to represent the amount. |
formattedNumber | If the default chosen cardinal number is wrong for the context of the noun, you can format a specific form of the number. |
semanticConcept | An input SemanticConcept to represent the word to be inflected based on the amount. |
|
pure virtual |
Returns a SpeakableString based on an input SpeakableString and with the print component surrounded with the locale's quotation punctuation, in English this is represented with quotation marks: ""
. Another example is in Swiss German dialects this is represented with «»
.
str | The input SpeakableString to add quotation punctuation to. |