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

Formats a list of SemanticFeatureConceptBase objects with context sensitive semantic features. More...

#include <SemanticConceptList.hpp>

+ Inheritance diagram for inflection::dialog::SemanticConceptList:

Public Member Functions

void putConstraint (const SemanticFeature &feature, ::std::u16string_view featureValue) override
 
void clearConstraint (const SemanticFeature &feature) override
 
void reset () override
 
SpeakableStringgetFeatureValue (const SemanticFeature &feature) const override
 
int32_t getSize () const
 
const SemanticFeatureConceptBaseget (int32_t index) const
 
const SemanticFeatureConceptBaseoperator[] (int32_t index) const
 
bool isExists () const override
 
::std::u16string toString () const override
 
SpeakableStringtoSpeakableString () const override
 
SemanticConceptListclone () const override
 
virtual SemanticConceptListsetBeforeFirst (const SpeakableString &value)
 
virtual SpeakableString getBeforeFirst (const SemanticFeatureConceptBase &first, const SpeakableString &formattedFirst) const
 
virtual SemanticConceptListsetAfterFirst (const SpeakableString &value)
 
virtual SpeakableString getAfterFirst (const SemanticFeatureConceptBase &first, const SpeakableString &formattedFirst, const SemanticFeatureConceptBase &second, const SpeakableString &formattedSecond) const
 
virtual SemanticConceptListsetItemDelimiter (const SpeakableString &value)
 
virtual SpeakableString getItemDelimiter (const SemanticFeatureConceptBase &previous, const SpeakableString &formattedPrevious, const SemanticFeatureConceptBase &next, const SpeakableString &formattedNext) const
 
virtual SemanticConceptListsetBeforeLast (const SpeakableString &value)
 
virtual SpeakableString getBeforeLast (const SemanticFeatureConceptBase &secondToLast, const SpeakableString &formattedSecondToLast, const SemanticFeatureConceptBase &last, const SpeakableString &formattedLast) const
 
virtual SemanticConceptListsetAfterLast (const SpeakableString &value)
 
virtual SpeakableString getAfterLast (const SemanticFeatureConceptBase &last, const SpeakableString &formattedLast) const
 
virtual SemanticConceptListsetItemPrefix (const SpeakableString &value)
 
virtual SpeakableString getItemPrefix (const SemanticFeatureConceptBase &item, const SpeakableString &formattedItem) const
 
virtual SemanticConceptListsetItemSuffix (const SpeakableString &value)
 
virtual SpeakableString getItemSuffix (const SemanticFeatureConceptBase &item, const SpeakableString &formattedItem) const
 
virtual void setAvoidItemAffixRedundancy (bool value)
 
 SemanticConceptList (const SemanticFeatureModel *model, const ::std::vector< const SemanticFeatureConceptBase * > &values)
 
 SemanticConceptList (const SemanticFeatureModel *model, const ::std::vector< SemanticFeatureConceptBase * > &values)
 
 SemanticConceptList (const SemanticConceptList &other)
 
 ~SemanticConceptList () 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 putConstraintByName (::std::u16string_view featureName, ::std::u16string_view featureValue)
 
virtual void clearConstraintByName (::std::u16string_view featureName)
 
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

Formats a list of SemanticFeatureConceptBase objects with context sensitive semantic features.

Definition at line 16 of file SemanticConceptList.hpp.

Constructor & Destructor Documentation

◆ SemanticConceptList() [1/3]

inflection::dialog::SemanticConceptList::SemanticConceptList ( const SemanticFeatureModel model,
const ::std::vector< const SemanticFeatureConceptBase * > &  values 
)

Creates a list of immutable SemanticConcept

◆ SemanticConceptList() [2/3]

inflection::dialog::SemanticConceptList::SemanticConceptList ( const SemanticFeatureModel model,
const ::std::vector< SemanticFeatureConceptBase * > &  values 
)

Creates a list of mutable SemanticConcept

◆ SemanticConceptList() [3/3]

inflection::dialog::SemanticConceptList::SemanticConceptList ( const SemanticConceptList other)

The copy constructor

◆ ~SemanticConceptList()

inflection::dialog::SemanticConceptList::~SemanticConceptList ( )
override

The destructor

Member Function Documentation

◆ clearConstraint()

void inflection::dialog::SemanticConceptList::clearConstraint ( const SemanticFeature feature)
overridevirtual

Clean the constraint feature in the SemanticConceptList.

Parameters
featurethe feature of the constraint to be clearn.

Reimplemented from inflection::dialog::SemanticFeatureConceptBase.

◆ clone()

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

Return a clone of this object with a deep copy of the constraints.

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ get()

const SemanticFeatureConceptBase * inflection::dialog::SemanticConceptList::get ( int32_t  index) const

Retrieves the SemanticFeatureConceptBase object at the requested index.

Returns
returns the SemanticFeatureConceptBase object at the requested index.
Exceptions
Anexception if the index is out of range.

◆ getAfterFirst()

virtual SpeakableString inflection::dialog::SemanticConceptList::getAfterFirst ( const SemanticFeatureConceptBase first,
const SpeakableString formattedFirst,
const SemanticFeatureConceptBase second,
const SpeakableString formattedSecond 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
firstThe first item in the list.
formattedFirstThe formatted form of the first item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.
secondThe second item in the list.
formattedSecondThe formatted form of the second item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.

◆ getAfterLast()

virtual SpeakableString inflection::dialog::SemanticConceptList::getAfterLast ( const SemanticFeatureConceptBase last,
const SpeakableString formattedLast 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
lastThe last item in the list.
formattedLastThe formatted form of the last item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.

◆ getBeforeFirst()

virtual SpeakableString inflection::dialog::SemanticConceptList::getBeforeFirst ( const SemanticFeatureConceptBase first,
const SpeakableString formattedFirst 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
firstThe first item in the list.
formattedFirstThe formatted form of the first item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.

◆ getBeforeLast()

virtual SpeakableString inflection::dialog::SemanticConceptList::getBeforeLast ( const SemanticFeatureConceptBase secondToLast,
const SpeakableString formattedSecondToLast,
const SemanticFeatureConceptBase last,
const SpeakableString formattedLast 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
secondToLastThe second to last item. It is before the last item.
formattedSecondToLastThe formatted form of the second to last item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.
lastThe last item in the list.
formattedLastThe formatted form of the last item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.

◆ getFeatureValue()

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

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

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ getItemDelimiter()

virtual SpeakableString inflection::dialog::SemanticConceptList::getItemDelimiter ( const SemanticFeatureConceptBase previous,
const SpeakableString formattedPrevious,
const SemanticFeatureConceptBase next,
const SpeakableString formattedNext 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
previousThe previous item in the list.
formattedPreviousThe formatted form of the previous item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.
nextThe mext item in the list.
formattedNextThe formatted form of the next item. This should already be formatted with the constraints, item prefix and item suffix as specified in this list.

◆ getItemPrefix()

virtual SpeakableString inflection::dialog::SemanticConceptList::getItemPrefix ( const SemanticFeatureConceptBase item,
const SpeakableString formattedItem 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
itemThe current item to add a prefix.
formattedItemThe formatted form of the item. This should already be formatted with the constraints as specified in this list.

◆ getItemSuffix()

virtual SpeakableString inflection::dialog::SemanticConceptList::getItemSuffix ( const SemanticFeatureConceptBase item,
const SpeakableString formattedItem 
) const
virtual

Without the context of the current list, return the SpeakableString given the parameters.

Parameters
itemThe current item to add a suffix.
formattedItemThe formatted form of the item. This should already be formatted with the constraints as specified in this list.

◆ getSize()

int32_t inflection::dialog::SemanticConceptList::getSize ( ) const

Returns the number of items in the list.

◆ isExists()

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

Returns true if this list is not empty.

Implements inflection::dialog::SemanticFeatureConceptBase.

◆ operator[]()

const SemanticFeatureConceptBase * inflection::dialog::SemanticConceptList::operator[] ( int32_t  index) const

Retrieves the SemanticFeatureConceptBase object at the requested index.

Returns
returns the SemanticFeatureConceptBase object at the requested index.
Exceptions
Anexception if the index is out of range.

◆ putConstraint()

void inflection::dialog::SemanticConceptList::putConstraint ( const SemanticFeature feature,
::std::u16string_view  featureValue 
)
overridevirtual

Put constraint feature and value into the SemanticConceptList.

Parameters
featurethe feature of the constraint to be added.
featureValuethe value of the constraint.

Reimplemented from inflection::dialog::SemanticFeatureConceptBase.

◆ reset()

void inflection::dialog::SemanticConceptList::reset ( )
overridevirtual

Clear all constraints imposed on this SemanticFeatureConcept.

Reimplemented from inflection::dialog::SemanticFeatureConceptBase.

◆ setAfterFirst()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setAfterFirst ( const SpeakableString value)
virtual

If there are at least 2 items, show this value after the first value and before the second value

Returns
A pointer to this object to allow chaining.

◆ setAfterLast()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setAfterLast ( const SpeakableString value)
virtual

If there is at least 1 item, show this value after the entire list.

Returns
A pointer to this object to allow chaining.

◆ setAvoidItemAffixRedundancy()

virtual void inflection::dialog::SemanticConceptList::setAvoidItemAffixRedundancy ( bool  value)
virtual

If the item's prefix or suffix is already a prefix or suffix to an item, should we avoid adding the same affix. The default is true.

◆ setBeforeFirst()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setBeforeFirst ( const SpeakableString value)
virtual

If there is at least 1 item, show this value before the entire list.

Returns
A pointer to this object to allow chaining.

◆ setBeforeLast()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setBeforeLast ( const SpeakableString value)
virtual

If there are at least 2 items, show this value after the second to last value and before the last value

Returns
A pointer to this object to allow chaining.

◆ setItemDelimiter()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setItemDelimiter ( const SpeakableString value)
virtual

The default delimiter between items. Usually it is some form of a comma.

Returns
A pointer to this object to allow chaining.

◆ setItemPrefix()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setItemPrefix ( const SpeakableString value)
virtual

For each item, add the provided prefix.

Returns
A pointer to this object to allow chaining.

◆ setItemSuffix()

virtual SemanticConceptList * inflection::dialog::SemanticConceptList::setItemSuffix ( const SpeakableString value)
virtual

For each item, add the provided suffix.

Returns
A pointer to this object to allow chaining.

◆ toSpeakableString()

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

Returns the concept as a SpeakableString.

Returns
The concept represented as a SpeakableString.

Implements inflection::dialog::SpeakableConcept.

◆ toString()

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

Returns a debuggable representation of this list without the separators.


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