Inflection
Morphology Inflection
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
inflection::dictionary::DictionaryMetaData Class Reference

Provides an interface to read Inflection's lexical dictionaries. More...

#include <DictionaryMetaData.hpp>

+ Inheritance diagram for inflection::dictionary::DictionaryMetaData:

Public Member Functions

int64_t * getCombinedBinaryType (int64_t *result, std::u16string_view word) const
 
::std::vector<::std::u16string > getPropertyNames (int64_t binaryProperties) const
 
::std::u16string getPropertyName (int64_t singleProperty) const
 
bool isKnownWord (std::u16string_view word) const
 
bool hasProperty (std::u16string_view word, std::u16string_view partOfSpeech) const
 
bool hasAllProperties (std::u16string_view word, int64_t partOfSpeech) const
 
bool hasAnyProperty (std::u16string_view word, int64_t partOfSpeech) const
 
int64_t * getBinaryProperties (int64_t *result, const ::std::vector<::std::u16string > &properties) const
 
int64_t getBinaryProperties (const ::std::vector<::std::u16string > &properties) const
 
::std::vector<::std::u16string > getProperties (std::u16string_view word) const
 
::std::vector<::std::u16string > getPropertyValues (std::u16string_view word, std::u16string_view partOfSpeech) const
 
bool getPropertyValues (::std::vector<::std::u16string > *result, std::u16string_view word, std::u16string_view partOfSpeech) const
 
::inflection::dictionary::DictionaryKeyIterator getKnownWords () const
 
int32_t getKnownWordsSize () const
 
- Public Member Functions inherited from inflection::Object
virtual ::std::u16string toString () const
 
virtual ~Object ()
 

Static Public Member Functions

static const DictionaryMetaDatacreateDictionary (const ::inflection::util::ULocale &locale)
 

Friends

class Inflector
 
class Inflector_MMappedDictionary
 

Detailed Description

Provides an interface to read Inflection's lexical dictionaries.

Definition at line 19 of file DictionaryMetaData.hpp.

Member Function Documentation

◆ createDictionary()

static const DictionaryMetaData * inflection::dictionary::DictionaryMetaData::createDictionary ( const ::inflection::util::ULocale locale)
static

Factory method to return a DictionaryMetaData singleton for each locale.

Parameters
localeThe locale to get the lexical dictionary.
Returns
A singleton. Do not delete this object.

◆ getBinaryProperties() [1/2]

int64_t inflection::dictionary::DictionaryMetaData::getBinaryProperties ( const ::std::vector<::std::u16string > &  properties) const

Retrieve all of the property names and return set the provided return value.

Returns
The binary value representing the requested properties.

◆ getBinaryProperties() [2/2]

int64_t * inflection::dictionary::DictionaryMetaData::getBinaryProperties ( int64_t *  result,
const ::std::vector<::std::u16string > &  properties 
) const

Given the string form of the property names, return a bit field representing each requested property

Parameters
resultIf the properties are known, the result value is set with the binary value representing the requested properties.
propertiesThese are the string form of the word properties
Returns
null if no properties are found.

◆ getCombinedBinaryType()

int64_t * inflection::dictionary::DictionaryMetaData::getCombinedBinaryType ( int64_t *  result,
std::u16string_view  word 
) const

Get all of the binary types of a word or phrase. The name for each bit can be retrieved by getPropertyName().

◆ getKnownWords()

::inflection::dictionary::DictionaryKeyIterator inflection::dictionary::DictionaryMetaData::getKnownWords ( ) const

Returns an iterator to iterate over all known words in this dictionary.

◆ getKnownWordsSize()

int32_t inflection::dictionary::DictionaryMetaData::getKnownWordsSize ( ) const

Returns the number of known words in this dictionary.

◆ getProperties()

::std::vector<::std::u16string > inflection::dictionary::DictionaryMetaData::getProperties ( std::u16string_view  word) const

Returns the string form of all of the binary property values.

◆ getPropertyName()

::std::u16string inflection::dictionary::DictionaryMetaData::getPropertyName ( int64_t  singleProperty) const

Given a single bit turned on, return the name of the property.

◆ getPropertyNames()

::std::vector<::std::u16string > inflection::dictionary::DictionaryMetaData::getPropertyNames ( int64_t  binaryProperties) const

Turns all of the bits in the binary properties into string based property names.

◆ getPropertyValues() [1/2]

bool inflection::dictionary::DictionaryMetaData::getPropertyValues ( ::std::vector<::std::u16string > *  result,
std::u16string_view  word,
std::u16string_view  partOfSpeech 
) const

Returns the all of the values for the given property key.

◆ getPropertyValues() [2/2]

::std::vector<::std::u16string > inflection::dictionary::DictionaryMetaData::getPropertyValues ( std::u16string_view  word,
std::u16string_view  partOfSpeech 
) const

Returns the all of the values for the given property key.

◆ hasAllProperties()

bool inflection::dictionary::DictionaryMetaData::hasAllProperties ( std::u16string_view  word,
int64_t  partOfSpeech 
) const

Does the given word or phrase have all of the specified properties.

◆ hasAnyProperty()

bool inflection::dictionary::DictionaryMetaData::hasAnyProperty ( std::u16string_view  word,
int64_t  partOfSpeech 
) const

Does the given word or phrase have at least one of the specified properties.

◆ hasProperty()

bool inflection::dictionary::DictionaryMetaData::hasProperty ( std::u16string_view  word,
std::u16string_view  partOfSpeech 
) const

Does the given word or phrase have the specified property. If you plan to do a lot of these operations, it's faster to turn the property name into a binary representation with getBinaryProperties(), and then compare the binary properties with the result from getCombinedBinaryType() for the word or phrase.

◆ isKnownWord()

bool inflection::dictionary::DictionaryMetaData::isKnownWord ( std::u16string_view  word) const

Is the provided word a known word in the dictionary.

Friends And Related Symbol Documentation

◆ Inflector

friend class Inflector
friend

Definition at line 114 of file DictionaryMetaData.hpp.

◆ Inflector_MMappedDictionary

friend class Inflector_MMappedDictionary
friend

Definition at line 115 of file DictionaryMetaData.hpp.


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