Inflection
Morphology Inflection
Loading...
Searching...
No Matches
SemanticFeatureConceptBase.hpp
1/*
2 * Copyright 2017-2024 Apple Inc. All rights reserved.
3 */
4#pragma once
5
6#include <inflection/dialog/fwd.hpp>
7#include <inflection/Object.hpp>
8#include <inflection/dialog/SemanticFeature.hpp>
9#include <inflection/dialog/SpeakableConcept.hpp>
10#include <map>
11
20 : public virtual SpeakableConcept
21{
22public:
24 typedef SpeakableConcept super;
26
27private: /* package */
28 const SemanticFeatureModel* model { };
29protected: /* package */
33 ::std::map<SemanticFeature, ::std::u16string> constraints { };
34
35public: /* protected */
39 virtual const SemanticFeatureModel* getModel() const;
45 virtual const ::std::u16string* getConstraint(const SemanticFeature& feature) const;
51 virtual bool hasConstraint(const SemanticFeature& feature) const;
57 virtual void putConstraint(const SemanticFeature& feature, ::std::u16string_view featureValue);
63 virtual void putConstraintByName(::std::u16string_view featureName, ::std::u16string_view featureValue);
68 virtual void clearConstraint(const SemanticFeature& feature);
73 virtual void clearConstraintByName(::std::u16string_view featureName);
77 virtual bool isExists() const = 0;
81 virtual void reset();
85 virtual SpeakableString* getFeatureValue(const SemanticFeature& feature) const = 0;
91 virtual SpeakableString* getFeatureValueByName(::std::u16string_view featureName) const;
92protected: /* protected */
96 virtual const SemanticFeature* getSpeakFeature() const;
97
98public:
102 virtual SemanticFeatureConceptBase* clone() const = 0;
103
119private:
120 SemanticFeatureConceptBase& operator=(const SemanticFeatureConceptBase&) = delete;
121};
Abstract base class of SpeakableConcept with inflectable constraints.
virtual void clearConstraintByName(::std::u16string_view featureName)
virtual bool hasConstraint(const SemanticFeature &feature) const
virtual SpeakableString * getFeatureValue(const SemanticFeature &feature) const =0
virtual void putConstraintByName(::std::u16string_view featureName, ::std::u16string_view featureValue)
virtual SemanticFeatureConceptBase * clone() const =0
virtual const ::std::u16string * getConstraint(const SemanticFeature &feature) const
SemanticFeatureConceptBase(const SemanticFeatureModel *model)
virtual void clearConstraint(const SemanticFeature &feature)
virtual void putConstraint(const SemanticFeature &feature, ::std::u16string_view featureValue)
SemanticFeatureConceptBase(const SemanticFeatureConceptBase &other)
virtual const SemanticFeatureModel * getModel() const
virtual SpeakableString * getFeatureValueByName(::std::u16string_view featureName) const
virtual const SemanticFeature * getSpeakFeature() const
A semantic model that contains display data for semantic values and provides feature functions for de...
Represents a single semantic feature.
The base interface for all concepts that can be formatted to a SpeakableString.
Represents a string with both a spoken and written representation.
The C++ namespace for Inflection.
Definition fwd.hpp:11