Inflection
Morphology Inflection
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
inflection::dialog::SemanticFeatureConceptBase Class Referenceabstract

Abstract base class of SpeakableConcept with inflectable constraints. More...

#include <SemanticFeatureConceptBase.hpp>

+ Inheritance diagram for inflection::dialog::SemanticFeatureConceptBase:

Public Member Functions

virtual const SemanticFeatureModelgetModel () const
 
virtual const ::std::u16string * getConstraint (const SemanticFeature &feature) const
 
virtual bool hasConstraint (const SemanticFeature &feature) const
 
virtual void putConstraint (const SemanticFeature &feature, ::std::u16string_view featureValue)
 
virtual void putConstraintByName (::std::u16string_view featureName, ::std::u16string_view featureValue)
 
virtual void clearConstraint (const SemanticFeature &feature)
 
virtual void clearConstraintByName (::std::u16string_view featureName)
 
virtual bool isExists () const =0
 
virtual void reset ()
 
virtual SpeakableStringgetFeatureValue (const SemanticFeature &feature) const =0
 
virtual SpeakableStringgetFeatureValueByName (::std::u16string_view featureName) const
 
virtual SemanticFeatureConceptBaseclone () const =0
 
 SemanticFeatureConceptBase (const SemanticFeatureModel *model)
 
 SemanticFeatureConceptBase (const SemanticFeatureConceptBase &other)
 
 ~SemanticFeatureConceptBase () override
 
- Public Member Functions inherited from inflection::dialog::SpeakableConcept
virtual SpeakableStringtoSpeakableString () const =0
 
 ~SpeakableConcept () override
 
- Public Member Functions inherited from inflection::Object
virtual ::std::u16string toString () const
 
virtual ~Object ()
 

Protected Member Functions

virtual const SemanticFeaturegetSpeakFeature () const
 

Protected Attributes

::std::map< SemanticFeature, ::std::u16string > constraints { }
 

Detailed Description

Abstract base class of SpeakableConcept with inflectable constraints.

This abstract base class allows a SemanticFeatureConcept to be constrained with the possible semantic features and format to a value to display/speak. A SemanticFeature could be grammatical gender, grammatical number, grammatical number or other relevant semantic feature.

Definition at line 19 of file SemanticFeatureConceptBase.hpp.

Constructor & Destructor Documentation

◆ SemanticFeatureConceptBase() [1/2]

inflection::dialog::SemanticFeatureConceptBase::SemanticFeatureConceptBase ( const SemanticFeatureModel model)
explicit

This constructor for the abstract class should be called by the subclasses.

Parameters
modelThe SemanticFeatureModel that provides all of the features, valid constraints, default functions and other relevant information for a given language.

◆ SemanticFeatureConceptBase() [2/2]

inflection::dialog::SemanticFeatureConceptBase::SemanticFeatureConceptBase ( const SemanticFeatureConceptBase other)

Copy constructor

◆ ~SemanticFeatureConceptBase()

inflection::dialog::SemanticFeatureConceptBase::~SemanticFeatureConceptBase ( )
override

Destructor

Member Function Documentation

◆ clearConstraint()

virtual void inflection::dialog::SemanticFeatureConceptBase::clearConstraint ( const SemanticFeature feature)
virtual

Clear the specified semantic constraint feature.

Parameters
featureThe semantic feature of the constraint to be cleared.

Reimplemented in inflection::dialog::SemanticConceptList.

◆ clearConstraintByName()

virtual void inflection::dialog::SemanticFeatureConceptBase::clearConstraintByName ( ::std::u16string_view  featureName)
virtual

Clear the specified semantic constraint feature by the given feature name.

Parameters
featureNameThe name of the constraint to be cleared.

◆ clone()

virtual SemanticFeatureConceptBase * inflection::dialog::SemanticFeatureConceptBase::clone ( ) const
pure virtual

◆ getConstraint()

virtual const ::std::u16string * inflection::dialog::SemanticFeatureConceptBase::getConstraint ( const SemanticFeature feature) const
virtual

Get the value of the semantic feature.

Parameters
featureThe semantic feature object.
Returns
The value of the constraint feature.

◆ getFeatureValue()

virtual SpeakableString * inflection::dialog::SemanticFeatureConceptBase::getFeatureValue ( const SemanticFeature feature) const
pure virtual

Returns the String value of the specified feature for this concept, given its current constraints

Implemented in inflection::dialog::InflectableStringConcept, inflection::dialog::PronounConcept, inflection::dialog::SemanticConcept, and inflection::dialog::SemanticConceptList.

◆ getFeatureValueByName()

virtual SpeakableString * inflection::dialog::SemanticFeatureConceptBase::getFeatureValueByName ( ::std::u16string_view  featureName) const
virtual

Returns the String value of the specified feature for this concept, given its current constraints. The featureName will be automatically converted to a SemanticFeature for lookup.

◆ getModel()

virtual const SemanticFeatureModel * inflection::dialog::SemanticFeatureConceptBase::getModel ( ) const
virtual

Returns the SemanticFeatureModel used to create this string.

◆ getSpeakFeature()

virtual const SemanticFeature * inflection::dialog::SemanticFeatureConceptBase::getSpeakFeature ( ) const
protectedvirtual

The semantic feature for the spoken form of a string.

◆ hasConstraint()

virtual bool inflection::dialog::SemanticFeatureConceptBase::hasConstraint ( const SemanticFeature feature) const
virtual

Check if the semantic feature has been added as a constraint.

Parameters
featureThe semantic feature object.
Returns
True if the semantic feature is in this, false otherwise.

◆ isExists()

virtual bool inflection::dialog::SemanticFeatureConceptBase::isExists ( ) const
pure virtual

◆ putConstraint()

virtual void inflection::dialog::SemanticFeatureConceptBase::putConstraint ( const SemanticFeature feature,
::std::u16string_view  featureValue 
)
virtual

Add a semantic feature with a value as a constraint.

Parameters
featureThe semantic feature object of the constraint to be added.
featureValueThe value of the feature.

Reimplemented in inflection::dialog::SemanticConceptList.

◆ putConstraintByName()

virtual void inflection::dialog::SemanticFeatureConceptBase::putConstraintByName ( ::std::u16string_view  featureName,
::std::u16string_view  featureValue 
)
virtual

Add a semantic feature with a value as a constraint by the name of the SemanticFeature.

Parameters
featureNameThe name of the feature.
featureValueThe value of the feature.

◆ reset()

virtual void inflection::dialog::SemanticFeatureConceptBase::reset ( )
virtual

Clear all constraints imposed on this SemanticFeatureConcept.

Reimplemented in inflection::dialog::SemanticConceptList.

Member Data Documentation

◆ constraints

::std::map<SemanticFeature, ::std::u16string> inflection::dialog::SemanticFeatureConceptBase::constraints { }
protected

All the constraints

Definition at line 33 of file SemanticFeatureConceptBase.hpp.


The documentation for this class was generated from the following file: