Inflection
Morphology Inflection
Loading...
Searching...
No Matches
inflection::dialog::SemanticFeature Class Reference

Represents a single semantic feature. More...

#include <SemanticFeature.hpp>

Inheritance diagram for inflection::dialog::SemanticFeature:

Public Types

enum  Type { NoValue , BoundedValue , UnboundedValue }

Public Member Functions

virtual Type getType () const
virtual const ::std::u16string & getName () const
virtual const ::std::set<::std::u16string > & getBoundedValues () const
virtual bool isAliased () const
bool operator== (const SemanticFeature &other) const
std::weak_ordering operator<=> (const SemanticFeature &other) const
 SemanticFeature (const ::std::u16string &name, Type type, const ::std::set<::std::u16string > &boundedValues, bool aliased)
 SemanticFeature (const SemanticFeature &other)
 ~SemanticFeature () override
Public Member Functions inherited from inflection::Object
virtual::std::u16string toString () const
virtual ~Object ()

Static Public Member Functions

static SemanticFeature * noValue (const ::std::u16string &name)
static SemanticFeature * boundedValue (const ::std::u16string &name, const ::std::set<::std::u16string > &values)
static SemanticFeature * unboundedValue (const ::std::u16string &name)

Detailed Description

Represents a single semantic feature.

Definition at line 14 of file SemanticFeature.hpp.

Member Enumeration Documentation

◆ Type

Metadata about how a SemanticFeature is bounded.

Definition at line 26 of file SemanticFeature.hpp.

Constructor & Destructor Documentation

◆ SemanticFeature() [1/2]

inflection::dialog::SemanticFeature::SemanticFeature ( const ::std::u16string & name,
Type type,
const ::std::set<::std::u16string > & boundedValues,
bool aliased )

Construct the SemanticFeature from the name, type, bounded values.

Parameters
nameThe name of the SemanticFeature.
typeThe type of the SemanticFeature.
boundedValuesThe set of values bounded to the feature.
aliasedTo indicate the feature is an alias.

◆ SemanticFeature() [2/2]

inflection::dialog::SemanticFeature::SemanticFeature ( const SemanticFeature & other)

The copy constructor

◆ ~SemanticFeature()

inflection::dialog::SemanticFeature::~SemanticFeature ( )
override

The destructor

Member Function Documentation

◆ boundedValue()

SemanticFeature * inflection::dialog::SemanticFeature::boundedValue ( const ::std::u16string & name,
const ::std::set<::std::u16string > & values )
static

Constructs a bounded SemanticFeature that has the provided values.

Parameters
nameThe name of the SemanticFeature.
valuesThe possible values of the new SemanticFeature.

◆ getBoundedValues()

virtual const ::std::set<::std::u16string > & inflection::dialog::SemanticFeature::getBoundedValues ( ) const
virtual

Returns the possible values of this SemanticFeature. Only bounded SemanticFeatures can have a non-empty set of bounded values.

◆ getName()

virtual const ::std::u16string & inflection::dialog::SemanticFeature::getName ( ) const
virtual

Returns the name of this SemanticFeature

◆ getType()

virtual Type inflection::dialog::SemanticFeature::getType ( ) const
virtual

Returns the type of this SemanticFeature

◆ isAliased()

virtual bool inflection::dialog::SemanticFeature::isAliased ( ) const
virtual

True if this semantic feature can be referenced by the bounded values directly or aliased without specifying the name.

◆ noValue()

SemanticFeature * inflection::dialog::SemanticFeature::noValue ( const ::std::u16string & name)
static

Constructs a SemanticFeature that has no values.

Parameters
nameThe name of the SemanticFeature.

◆ operator<=>()

std::weak_ordering inflection::dialog::SemanticFeature::operator<=> ( const SemanticFeature & other) const
Parameters
otherThe semantic feature object to be compared with this.

◆ operator==()

bool inflection::dialog::SemanticFeature::operator== ( const SemanticFeature & other) const

Returns true when both objects refer to the same semantic feature, with the same name.

Parameters
otherThe semantic feature object to be compared with this.
Returns
True if the two semantic feature are the same, false otherwise.

◆ unboundedValue()

SemanticFeature * inflection::dialog::SemanticFeature::unboundedValue ( const ::std::u16string & name)
static

Constructs an unbounded SemanticFeature that has no restrictions on the possible values.

Parameters
nameThe name of the SemanticFeature.

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