Inflection
Morphology Inflection
Loading...
Searching...
No Matches
SemanticConcept.hpp
1/*
2 * Copyright 2018-2024 Apple Inc. All rights reserved.
3 */
4#pragma once
5
6#include <inflection/dialog/fwd.hpp>
7#include <inflection/dialog/SemanticFeatureConceptBase.hpp>
8#include <inflection/dialog/DisplayValue.hpp>
9#include <inflection/dialog/SemanticValue.hpp>
10#include <memory>
11#include <string>
12#include <vector>
13
17class INFLECTION_CLASS_API inflection::dialog::SemanticConcept
19{
20public:
22 typedef SemanticFeatureConceptBase super;
24
25private:
26 SemanticValue semantic;
27 DisplayValue defaultToSemanticValue;
28 const SemanticFeatureModel_DisplayData *displayData { };
29 bool defaultToSemantic { };
30
31public:
36 virtual const ::std::u16string& getSemanticValue();
37
38private: /* protected */
39 const DisplayValue* getFirstPossibleValue(std::unique_ptr<DisplayValue>& generatedDisplayValue) const;
40 const DisplayValue* getCurrentValue(std::unique_ptr<DisplayValue>& generatedDisplayValue) const;
41
42public:
47
51 bool isExists() const override;
52
58
63 virtual ::inflection::dialog::SpeakableString* toSpeakableStringDefault(bool defaultToSemantic) const;
64
68 ::std::u16string toString() const override;
69
70private:
71 ::std::u16string toString(bool defaultToSemantic) const;
72public:
76 SemanticConcept* clone() const override;
77
78public:
82 bool operator==(const SemanticConcept& o) const;
83
87 SemanticConcept(const SemanticFeatureModel* model, const SemanticValue& semantic, bool defaultToSemantic = false);
88
93
97 ~SemanticConcept() override;
98private:
99 SemanticConcept& operator=(const SemanticConcept&) = delete;
100};
Represents a display value with constraint values.
Provides a way to format a semantic value with specific display values for a given language.
virtual ::inflection::dialog::SpeakableString * toSpeakableStringDefault(bool defaultToSemantic) const
SemanticConcept(const SemanticFeatureModel *model, const SemanticValue &semantic, bool defaultToSemantic=false)
bool operator==(const SemanticConcept &o) const
SemanticConcept(const SemanticConcept &other)
virtual const ::std::u16string & getSemanticValue()
::inflection::dialog::SpeakableString * getFeatureValue(const SemanticFeature &feature) const override
SemanticConcept * clone() const override
bool isExists() const override
::inflection::dialog::SpeakableString * toSpeakableString() const override
::std::u16string toString() const override
Abstract base class of SpeakableConcept with inflectable constraints.
Provides a mapping between constraints and their corresponding SemanticValue.
A semantic model that contains display data for semantic values and provides feature functions for de...
Represents a single semantic feature.
Represents an ontological label with a value.
Represents a string with both a spoken and written representation.
The C++ namespace for Inflection.
Definition fwd.hpp:11