Inflection
Morphology Inflection
Loading...
Searching...
No Matches
Public Member Functions | List of all members
inflection::dialog::SemanticConcept Class Reference

Provides a way to format a semantic value with specific display values for a given language. More...

#include <SemanticConcept.hpp>

+ Inheritance diagram for inflection::dialog::SemanticConcept:

Public Member Functions

virtual const ::std::u16string & getSemanticValue ()
 
::inflection::dialog::SpeakableStringgetFeatureValue (const SemanticFeature &feature) const override
 
bool isExists () const override
 
::inflection::dialog::SpeakableStringtoSpeakableString () const override
 
virtual ::inflection::dialog::SpeakableStringtoSpeakableStringDefault (bool defaultToSemantic) const
 
::std::u16string toString () const override
 
SemanticConceptclone () const override
 
bool operator== (const SemanticConcept &o) const
 
 SemanticConcept (const SemanticFeatureModel *model, const SemanticValue &semantic, bool defaultToSemantic=false)
 
 SemanticConcept (const SemanticConcept &other)
 
 ~SemanticConcept () override
 
- Public Member Functions inherited from inflection::dialog::SemanticFeatureConceptBase
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 void reset ()
 
virtual SpeakableStringgetFeatureValueByName (::std::u16string_view featureName) const
 
 SemanticFeatureConceptBase (const SemanticFeatureModel *model)
 
 SemanticFeatureConceptBase (const SemanticFeatureConceptBase &other)
 
 ~SemanticFeatureConceptBase () override
 
- Public Member Functions inherited from inflection::dialog::SpeakableConcept
 ~SpeakableConcept () override
 
- Public Member Functions inherited from inflection::Object
virtual ::std::u16string toString () const
 
virtual ~Object ()
 

Additional Inherited Members

- Protected Member Functions inherited from inflection::dialog::SemanticFeatureConceptBase
virtual const SemanticFeaturegetSpeakFeature () const
 
- Protected Attributes inherited from inflection::dialog::SemanticFeatureConceptBase
::std::map< SemanticFeature, ::std::u16string > constraints { }
 

Detailed Description

Provides a way to format a semantic value with specific display values for a given language.

Definition at line 17 of file SemanticConcept.hpp.

Constructor & Destructor Documentation

◆ SemanticConcept() [1/2]

inflection::dialog::SemanticConcept::SemanticConcept ( const SemanticFeatureModel model,
const SemanticValue semantic,
bool  defaultToSemantic = false 
)

Constructs a new SemanticConcept. A SemanticFeatureModel is required, as it will enforce the locale and store display data.

◆ SemanticConcept() [2/2]

inflection::dialog::SemanticConcept::SemanticConcept ( const SemanticConcept other)

The copy constructor

◆ ~SemanticConcept()

inflection::dialog::SemanticConcept::~SemanticConcept ( )
override

The destructor

Member Function Documentation

◆ clone()

SemanticConcept * inflection::dialog::SemanticConcept::clone ( ) const
overridevirtual

Create a clone of this object. This is helpful if you need to preserve the constraints of the current object.

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ getFeatureValue()

::inflection::dialog::SpeakableString * inflection::dialog::SemanticConcept::getFeatureValue ( const SemanticFeature feature) const
overridevirtual

Returns the requested semantic feature. For example, you can request the definite article semantic feature in some languages.

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ getSemanticValue()

virtual const ::std::u16string & inflection::dialog::SemanticConcept::getSemanticValue ( )
virtual

Return the semantic value used to create this object. This value is used when defaulting to the semantic.

See also
SemanticValue::getValue

◆ isExists()

bool inflection::dialog::SemanticConcept::isExists ( ) const
overridevirtual

Returns true if a value exists for the given constraints

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ operator==()

bool inflection::dialog::SemanticConcept::operator== ( const SemanticConcept o) const

Returns true when both objects refer to the same model, have the same semantic value, have the same constraints and the same defaultToSemantic value.

◆ toSpeakableString()

::inflection::dialog::SpeakableString * inflection::dialog::SemanticConcept::toSpeakableString ( ) const
overridevirtual

Returns the requested value for the provided constraints.

Returns
null when the constrained values is an empty set.

Implements inflection::dialog::SpeakableConcept.

◆ toSpeakableStringDefault()

virtual ::inflection::dialog::SpeakableString * inflection::dialog::SemanticConcept::toSpeakableStringDefault ( bool  defaultToSemantic) const

Returns the requested value for the provided constraints.

Parameters
defaultToSemanticWhen this is true and the constrained values is an empty set, use the semantic value instead.

◆ toString()

::std::u16string inflection::dialog::SemanticConcept::toString ( ) const
override

Return a debuggable formatted string of this SemanticConcept.


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