Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
91b039e
Update InflectableStringConcept.hpp
FrankYFTang Jul 8, 2025
ab0c792
Update SemanticConceptList.hpp
FrankYFTang Jul 8, 2025
7cad535
Update SemanticFeature.hpp
FrankYFTang Jul 8, 2025
a3eb6ce
Update SemanticFeature.hpp
FrankYFTang Jul 8, 2025
da47bf0
Update SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
2321ce3
Update SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
ed59c59
Update SemanticValue.hpp
FrankYFTang Jul 8, 2025
4234e8a
Update SpeakableString.hpp
FrankYFTang Jul 8, 2025
b128656
Update XMLParseException.hpp
FrankYFTang Jul 8, 2025
6697207
Update LanguageGrammarFeatures_Feature.hpp
FrankYFTang Jul 8, 2025
121ddc7
Update LanguageGrammarFeatures_GrammarCategory.hpp
FrankYFTang Jul 8, 2025
d6d14a6
Update LanguageGrammarFeatures_GrammarFeatures.hpp
FrankYFTang Jul 8, 2025
896453b
Update LanguageGrammarFeatures_GrammarFeatures.hpp
FrankYFTang Jul 8, 2025
d7cae40
Update LanguageGrammarFeatures_GrammarFeatures.hpp
FrankYFTang Jul 8, 2025
0ebf900
Update inflection/src/inflection/dialog/InflectableStringConcept.hpp
FrankYFTang Jul 8, 2025
451acaf
Update inflection/src/inflection/dialog/SemanticFeature.hpp
FrankYFTang Jul 8, 2025
b448768
Update inflection/src/inflection/dialog/SemanticFeature.hpp
FrankYFTang Jul 8, 2025
640cf30
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
02bad56
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
da289b4
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
cb740d0
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
8333ac1
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
46792d4
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
a30bbbd
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
3ff30ce
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
90f16ca
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
eb79d88
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
9d88cd7
Update inflection/src/inflection/dialog/SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
3e5e284
Update inflection/src/inflection/dialog/SemanticValue.hpp
FrankYFTang Jul 8, 2025
298b09a
Update inflection/src/inflection/dialog/SpeakableString.hpp
FrankYFTang Jul 8, 2025
fe6aa27
Update inflection/src/inflection/exception/XMLParseException.hpp
FrankYFTang Jul 8, 2025
60ae5b0
Update inflection/src/inflection/lang/features/LanguageGrammarFeature…
FrankYFTang Jul 8, 2025
b5c328c
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
6330893
Update SemanticFeature.hpp
FrankYFTang Jul 8, 2025
f392092
Update inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
fd4ccc8
Update SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
62c5f6d
Update SemanticFeatureModel.hpp
FrankYFTang Jul 8, 2025
12c0cf8
Update LanguageGrammarFeatures_Feature.hpp
FrankYFTang Jul 8, 2025
0b8d345
Update SemanticFeature.hpp
FrankYFTang Jul 8, 2025
c477eeb
Update LanguageGrammarFeatures_GrammarCategory.hpp
FrankYFTang Jul 8, 2025
204e833
Update LanguageGrammarFeatures_GrammarFeatures.hpp
FrankYFTang Jul 8, 2025
cd23300
Update SemanticFeatureConceptBase.hpp
FrankYFTang Jul 8, 2025
9db99ab
Update SemanticFeature.hpp
FrankYFTang Jul 8, 2025
d5721eb
Update LanguageGrammarFeatures_GrammarFeatures.hpp
FrankYFTang Jul 8, 2025
dfc4681
Update LanguageGrammarFeatures_GrammarCategory.hpp
FrankYFTang Jul 8, 2025
02b92ec
Update LanguageGrammarFeatures_GrammarCategory.hpp
FrankYFTang Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions inflection/src/inflection/dialog/InflectableStringConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class INFLECTION_CLASS_API inflection::dialog::InflectableStringConcept
* @return true when the value is empty.
*/
bool isExists() const override;
/**
* @return TBW
*/
::std::u16string toString() const override;

private:
Expand Down
11 changes: 10 additions & 1 deletion inflection/src/inflection/dialog/SemanticConceptList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticConceptList
bool avoidAffixRedundancy { true };

public:
/**
* Put constraint feature and value into the SemanticConceptList.
* @param feature the feature of the constraint to be added.
* @param featureValue the value of the constraint.
*/
void putConstraint(const SemanticFeature& feature, ::std::u16string_view featureValue) override;
void clearConstraint(const SemanticFeature& feature) override;
/**
* Clean the constraint feature in the SemanticConceptList.
* @param feature the feature of the constraint to be clearn.
*/
void clearConstraint(const SemanticFeature& feature) override;
void reset() override;

public: /* protected */
Expand Down
23 changes: 23 additions & 0 deletions inflection/src/inflection/dialog/SemanticFeature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeature
/// @endcond

public:
/**
* TBW
*/
enum Type {
NoValue,
BoundedValue,
Expand Down Expand Up @@ -63,10 +66,30 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeature
* Returns the possible values of this SemanticFeature. Only bounded SemanticFeatures can have a non-empty set of bounded values.
*/
virtual const ::std::set<::std::u16string>& getBoundedValues() const;
/**
@return True if this semantic feature is aliased.
*/
virtual bool isAliased() const;
/**
* Checks if the name of this semantic feature is less than the other..
* @param other The semantic feature object to be compared with this.
* @return True if the name of this semantic feature is less than the other, false otherwise.
*/
bool operator<(const SemanticFeature& other) const;
/**
* Returns true when both objects refer to the same semantic feature, with the same name.
* @param other The semantic feature object to be compared with this.
* @return True if the two semantic feature are the same, false otherwise.
*/
bool operator==(const SemanticFeature& other) const;

/**
* Construct the SemanticFeature from the name, type, bounded values.
* @param name The name of the SemanticFeature.
* @param type The type of the SemanticFeature.
* @param boundedValues The set of values bounded to the feature.
* @para aliased To indicate the feature is an alias.
*/
SemanticFeature(const ::std::u16string& name, Type type, const ::std::set<::std::u16string>& boundedValues, bool aliased);
/**
* The copy constructor
Expand Down
31 changes: 31 additions & 0 deletions inflection/src/inflection/dialog/SemanticFeatureConceptBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,39 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeatureConceptBase
* Returns the SemanticFeatureModel used to create this string.
*/
virtual const SemanticFeatureModel* getModel() const;
/**
* Get the value of the semantic feature is in this.
* @param feature The semantic feature object.
* @return The value of the constraint feature.
*/
virtual const ::std::u16string* getConstraint(const SemanticFeature& feature) const;
/**
* Check if the semantic feature is in this.
* @param feature The semantic feature object.
* @return True if the semantic feature is in this, false otherwise.
*/
virtual bool hasConstraint(const SemanticFeature& feature) const;
/**
* Put the feature value into this by the given semantic feature.
* @param feature The semantic feature object of the constraint to be added.
* @param featureValue The value of the feature.
*/
virtual void putConstraint(const SemanticFeature& feature, ::std::u16string_view featureValue);
/**
* Put the feature value into this by the given feature name.
* @param featureName The name of the constraint to be cleared.
* @param featureValue The value of the feature.
*/
virtual void putConstraintByName(::std::u16string_view featureName, ::std::u16string_view featureValue);
/**
* Clear the feature by the given semantic feature object.
* @param feature The semantic feature of the constraint to be cleared.
*/
virtual void clearConstraint(const SemanticFeature& feature);
/**
* Clear the feature by the given feature name.
* @param featureName The name of the constraint to be cleared.
*/
virtual void clearConstraintByName(::std::u16string_view featureName);
/**
* Returns {@code true} if a value exists for the given constraints
Expand All @@ -58,6 +86,9 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeatureConceptBase
*/
virtual SpeakableString* getFeatureValueByName(::std::u16string_view featureName) const;
protected: /* protected */
/**
* TBW
*/
virtual const SemanticFeature* getSpeakFeature() const;

public:
Expand Down
28 changes: 28 additions & 0 deletions inflection/src/inflection/dialog/SemanticFeatureModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeatureModel final
std::unique_ptr<DefaultDisplayFunction> defaultDisplayFunction;

public:
/**
* TBW.
*/
static constexpr auto SPEAK = u"speak";

/**
Expand All @@ -47,13 +50,33 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeatureModel final
* Returns the SemanticFeatureModel_DisplayData associated with the semantic value in this SemanticFeatureModel
*/
const SemanticFeatureModel_DisplayData* getDisplayData(const SemanticValue& semantic) const;
/**
* TBW
* @param name TBW.
* @return TBW.
*/
const SemanticFeature* getFeature(::std::u16string_view name) const;
/**
* TBW
* @param name TBW.
* @return TBW.
*/
::std::pair<::inflection::dialog::SemanticFeature*, ::std::u16string> getFeatureAlias(::std::u16string_view name) const;
/**
* Returns the locale created with this SemanticFeatureModel.
*/
const util::ULocale& getLocale() const;
/**
* TBW
* @param feature TBW.
* @return TBW.
*/
const DefaultFeatureFunction* getDefaultFeatureFunction(const SemanticFeature& feature) const;
/**
* TBW
* @param feature TBW.
* @param function TBW.
*/
void putDefaultFeatureFunction(const SemanticFeature& feature, DefaultFeatureFunction* function);
/**
* This function works the same way as putDefaultFeatureFunction, but an exception is thrown if the feature is unknown.
Expand Down Expand Up @@ -82,6 +105,11 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticFeatureModel final
* Creates a default SemanticFeatureModel for a given locale without any display data.
*/
explicit SemanticFeatureModel(const ::inflection::util::ULocale& locale);
/**
* Creates a SemanticFeatureModel for a given locale with a mapping of display data.
* @param locale The locale.
* @param semanticValueMap The mapping of a semantic value to display data.
*/
SemanticFeatureModel(const ::inflection::util::ULocale& locale, const ::std::map<SemanticValue, SemanticFeatureModel_DisplayData>& semanticValueMap);
/**
* Destructor
Expand Down
3 changes: 3 additions & 0 deletions inflection/src/inflection/dialog/SemanticValue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class INFLECTION_CLASS_API inflection::dialog::SemanticValue
*/
std::strong_ordering operator<=>(const SemanticValue&) const;

/**
* Construct a SemanticValue by a lable and a string value.
*/
SemanticValue(const ::std::u16string& label, const ::std::u16string& string);
/**
* Destructor
Expand Down
29 changes: 29 additions & 0 deletions inflection/src/inflection/dialog/SpeakableString.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,40 @@ class INFLECTION_CLASS_API inflection::dialog::SpeakableString
*/
virtual bool speakEqualsPrint() const;

/**
* TBW
* @return TBW.
*/
::std::u16string toString() const override;
/**
* Returns true when both objects refer to the speakable string, with the same print and speak string.
* @param o The speakable string object to be compared with this.
* @return True if the two speakable string are the same, false otherwise.
*/
bool operator==(const ::inflection::dialog::SpeakableString& o) const;
/**
* Equivalent to the inverse of operator==.
* @param o The speakable string object to be compared with this.
* @return True if the two display value are not the same, false otherwise.
*/
bool operator!=(const ::inflection::dialog::SpeakableString& o) const;
/**
* Create a new speakable string by appened other to this.
* @param o the speakable string to be appened with this.
* @return the result speakable string object.
*/
SpeakableString operator+(const ::inflection::dialog::SpeakableString& o) const;
/**
* Assigns a speakable string to this.
* @param o the speakable string to be assigned to this.
* @return the result speakable string object.
*/
SpeakableString& operator=(const ::inflection::dialog::SpeakableString& o);
/**
* Appends a speakable string to this.
* @param o the speakable string to be appended to this.
* @return the result speakable string object.
*/
SpeakableString& operator+=(const ::inflection::dialog::SpeakableString& o);

/**
Expand Down
4 changes: 4 additions & 0 deletions inflection/src/inflection/exception/XMLParseException.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class INFLECTION_CLASS_API inflection::exception::XMLParseException

public:
XMLParseException();
/**
* Construct a XMLParseException with a message.
* @param message The debugging message of this XML parse exception.
*/
explicit XMLParseException(const std::u16string& message);
~XMLParseException() override;
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class INFLECTION_CLASS_API inflection::lang::features::LanguageGrammarFeatures_F
virtual std::map<std::u16string, std::u16string> getConstraints() const;

public: /* package */
/**
* Construct a feature by value and a mapping of constraints.
* @param value the name of the feature.
* @param constraints The mapping of constraints.
*/
LanguageGrammarFeatures_Feature(const std::u16string& value, const std::map<std::u16string, std::u16string>& constraints);
/**
* Destructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,18 @@ class INFLECTION_CLASS_API inflection::lang::features::LanguageGrammarFeatures_G
* @param grammemeValue Use <code>getValues()</code> to get the list of values that can be used as an argument.
*/
std::multimap<std::u16string, std::u16string> getGrammemeDependenciesForValue(std::u16string_view grammemeValue) const;

/**
* Compares the name of this grammar category with the other..
* @param other The grammar category object to be compared with this.
* @return TBW
*/
virtual int32_t compareTo(const LanguageGrammarFeatures_GrammarCategory& o) const;
/**
* Checks if the name of this grammar category is less than the other..
* @param other The grammar category object to be compared with this.
* @return True if the name of this grammar category is less than the other, false otherwise.
*/
bool operator<(const LanguageGrammarFeatures_GrammarCategory& other) const;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,25 @@ class INFLECTION_CLASS_API inflection::lang::features::LanguageGrammarFeatures_G
* If this feature is bounded, these are the valid values.
*/
std::vector<::inflection::lang::features::LanguageGrammarFeatures_Feature> getValues() const;
virtual int32_t compareTo(const LanguageGrammarFeatures_GrammarFeatures& o) const;
/**
* Compares the name of this grammar features with the other..
* @param other The grammar features object to be compared with this.
* @return TBW
*/
virtual int32_t compareTo(const LanguageGrammarFeatures_GrammarFeatures& other) const;
/**
* Checks if the name of this grammar features is less than the other..
* @param other The grammar features object to be compared with this.
* @return True if the name of this grammar features is less than the other, false otherwise.
*/
bool operator<(const LanguageGrammarFeatures_GrammarFeatures& other) const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be replaced by 3 way operator.


protected: /* package */
/**
* Construct a grammar features with name, and values.
* @param name The name of the grammar features.
* @param values The list of features.
*/
LanguageGrammarFeatures_GrammarFeatures(const std::u16string& name, const std::vector<::inflection::lang::features::LanguageGrammarFeatures_Feature>& values);
public:
/**
Expand Down
Loading