#include <opentrep/bom/WordCombinationHolder.hpp>
Public Types | |
typedef std::list< std::string > | StringList_T |
Public Member Functions | |
void | push_back (const std::string &) |
size_t | size () const |
void | clear () |
void | toStream (std::ostream &) const |
void | fromStream (std::istream &) |
std::string | describeKey () const |
std::string | describe () const |
WordCombinationHolder (const std::string &) | |
~WordCombinationHolder () | |
Public Attributes | |
StringList_T | _list |
Class holding a list of some specific word combinations within a string.
The list contains all the ways to combine all the words of a given string, while respecting the initial order.
A way to derive that list is simply by:
For instance, "san francisco international airport" will give:
Definition at line 51 of file WordCombinationHolder.hpp.
typedef std::list<std::string> OPENTREP::WordCombinationHolder::StringList_T |
List of strings.
Definition at line 56 of file WordCombinationHolder.hpp.
OPENTREP::WordCombinationHolder::WordCombinationHolder | ( | const std::string & | iString | ) |
Constructor.
Definition at line 18 of file WordCombinationHolder.cpp.
OPENTREP::WordCombinationHolder::~WordCombinationHolder | ( | ) |
Default destructor.
Definition at line 23 of file WordCombinationHolder.cpp.
void OPENTREP::WordCombinationHolder::push_back | ( | const std::string & | iString | ) |
Add an item (string) into the list.
Definition at line 27 of file WordCombinationHolder.cpp.
References _list.
size_t OPENTREP::WordCombinationHolder::size | ( | ) | const |
Return the size of the list.
Definition at line 32 of file WordCombinationHolder.cpp.
References _list.
void OPENTREP::WordCombinationHolder::clear | ( | ) |
void OPENTREP::WordCombinationHolder::toStream | ( | std::ostream & | ioOut | ) | const |
Dump the structure into an output stream.
ostream& | the output stream. |
Definition at line 78 of file WordCombinationHolder.cpp.
References describe().
|
virtual |
Read a structure from an input stream.
istream& | the input stream. |
Reimplemented from OPENTREP::StructAbstract.
Definition at line 83 of file WordCombinationHolder.cpp.
std::string OPENTREP::WordCombinationHolder::describeKey | ( | ) | const |
Get a string describing the whole key (differentiating two objects at any level).
Definition at line 42 of file WordCombinationHolder.cpp.
Referenced by describe().
|
virtual |
Get the serialised version of the structure.
Implements OPENTREP::StructAbstract.
Definition at line 49 of file WordCombinationHolder.cpp.
References _list, and describeKey().
Referenced by toStream().
StringList_T OPENTREP::WordCombinationHolder::_list |
List of word combinations (strings).
Definition at line 132 of file WordCombinationHolder.hpp.
Referenced by OPENTREP::Place::buildIndexSets(), clear(), describe(), push_back(), and size().