OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP::WordCombinationHolder Struct Reference

#include <opentrep/bom/WordCombinationHolder.hpp>

+ Inheritance diagram for OPENTREP::WordCombinationHolder:

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
 

Detailed Description

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.

Note
The 2- and 3-letter words (such as 'de' and 'san') are usually not to be indexed by Xapian. Idem with the 'airport' word.

A way to derive that list is simply by:

  1. Calculating all the partitions of the initial (full) string
  2. Extract from those partitions all the unique word combinations
  3. Add all the word combinations, obtained from removing any group of words in the middle of the initial (full) string

For instance, "san francisco international airport" will give:

  • Derived from the partitions of the initial string:
    1. "san francisco international airport"
    2. "san francisco international"
    3. "san francisco"
    4. "francisco international airport"
    5. "international airport"
  • Added word combinations:
    1. "san international airport"
    2. "san francisco airport"
    3. "san airport"

Definition at line 51 of file WordCombinationHolder.hpp.

Member Typedef Documentation

typedef std::list<std::string> OPENTREP::WordCombinationHolder::StringList_T

List of strings.

Definition at line 56 of file WordCombinationHolder.hpp.

Constructor & Destructor Documentation

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.

Member Function Documentation

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 ( )

Empty the list.

Definition at line 37 of file WordCombinationHolder.cpp.

References _list.

void OPENTREP::WordCombinationHolder::toStream ( std::ostream &  ioOut) const

Dump the structure into an output stream.

Parameters
ostream&the output stream.

Definition at line 78 of file WordCombinationHolder.cpp.

References describe().

void OPENTREP::WordCombinationHolder::fromStream ( std::istream &  ioIn)
virtual

Read a structure from an input stream.

Parameters
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().

std::string OPENTREP::WordCombinationHolder::describe ( ) const
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().

Member Data Documentation

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().


The documentation for this struct was generated from the following files: