zorba::Thesaurus

#include <zorba/thesaurus.h>

A Thesaurus provides a way to look up related phrases for a given phrase.

Public Types

std::unique_ptr< Thesaurus const, internal::ztd::destroy_delete< Thesaurus const > >

ptr

unsigned

range_type

The integral type for "at least" and "at most" values.

Public Functions

void

destroy() const =0

Destroys this Thesaurus.

iterator::ptr

lookup(String const &phrase, String const &relationship, range_type at_least, range_type at_most) const =0

Looks-up the given phrase.

Protected Functions

~Thesaurus()

Public Types

range_type

unsigned range_type

The integral type for "at least" and "at most" values.

Public Functions

destroy

void destroy() const =0

Destroys this Thesaurus.

This function is called by Zorba when the Thesaurus is no longer needed.If your implementation dynamically allocates Thesaurus objects, then your implementation can simply be (and usually is) delete this.If your implementation returns a pointer to a static Thesaurus object, then your implementation should do nothing.

lookup

iterator::ptr lookup(String const &phrase, String const &relationship, range_type at_least, range_type at_most) const =0

Looks-up the given phrase.

Parameters

phrase The phrase to look up.
relationship The relationship the synonyms are to have to the given phrase.
at_least The minimum number of levels within the thesaurus to be traversed.
at_most The maximum number of levels within the thesaurus to be traversed.

Returns

Returns a pointer to an iterator for the results or NULL if the phrase was not found.

Protected Functions

~Thesaurus

 ~Thesaurus()