Colibri Core
|
Abstract class for map-like pattern stores, do not instantiate directly. More...
#include <patternstore.h>
Public Types | |
typedef ContainerType::iterator | iterator |
typedef ContainerType::const_iterator | const_iterator |
Public Types inherited from PatternStore< ContainerType, ReadWriteSizeType, PatternType > | |
typedef ContainerType::iterator | iterator |
typedef ContainerType::const_iterator | const_iterator |
Public Member Functions | |
PatternMapStore () | |
virtual | ~PatternMapStore () |
virtual void | insert (const PatternType &pattern, ValueType &value)=0 |
virtual bool | has (const Pattern &) const =0 |
virtual bool | has (const PatternPointer &) const =0 |
virtual bool | erase (const PatternType &)=0 |
virtual size_t | size () const =0 |
virtual void | reserve (size_t)=0 |
virtual ValueType & | operator[] (const Pattern &pattern)=0 |
virtual ValueType & | operator[] (const PatternPointer &pattern)=0 |
virtual ContainerType::iterator | begin ()=0 |
virtual ContainerType::iterator | end ()=0 |
virtual ContainerType::iterator | find (const Pattern &pattern)=0 |
virtual ContainerType::iterator | find (const PatternPointer &pattern)=0 |
virtual void | write (std::ostream *out) |
virtual void | write (std::string filename) |
template<class ReadValueType = ValueType, class ReadValueHandler = ValueHandler, class ReadPatternType = PatternType> | |
void | read (std::istream *in, int MINTOKENS=0, int MINLENGTH=0, int MAXLENGTH=999999, PatternStoreInterface *constrainstore=NULL, bool DONGRAMS=true, bool DOSKIPGRAMS=true, bool DOFLEXGRAMS=true, bool DORESET=false, bool DEBUG=false) |
void | read (std::string filename, int MINTOKENS=0, int MINLENGTH=0, int MAXLENGTH=999999, PatternStoreInterface *constrainstore=NULL, bool DONGRAMS=true, bool DOSKIPGRAMS=true, bool DOFLEXGRAMS=true, bool DORESET=false, bool DEBUG=false) |
Public Member Functions inherited from PatternStore< ContainerType, ReadWriteSizeType, PatternType > | |
PatternStore () | |
virtual | ~PatternStore () |
virtual void | attachcorpus (unsigned char *corpusstart, unsigned int corpussize) |
virtual void | attachcorpus (const IndexedCorpus &corpus) |
virtual void | detachcorpus () |
unsigned char * | getcorpus () const |
unsigned int | getcorpussize () const |
virtual void | use_v1_format () |
virtual void | insert (const PatternType &pattern)=0 |
virtual PatternStoreInterface * | getstoreinterface () |
Protected Attributes | |
ValueHandler | valuehandler |
Protected Attributes inherited from PatternStore< ContainerType, ReadWriteSizeType, PatternType > | |
unsigned char * | corpusstart |
unsigned int | corpussize |
unsigned char | classencodingversion |
int | patterntype |
Abstract class for map-like pattern stores, do not instantiate directly.
ContainerType | The low-level container type used (an STL container such as set/map). |
ValueType | The type of Value this container stores |
ValueHandler | A handler class for this type of value |
ReadWriteSizeType | Data type for addressing, influences only the maximum number of items that can be stored (2**64) in the container, as this will be represented in the very beginning of the binary file. No reason to change this unless the container is very deeply nested in others and contains only few items. |
typedef ContainerType::const_iterator PatternMapStore< ContainerType, ValueType, ValueHandler, ReadWriteSizeType, PatternType >::const_iterator |
typedef ContainerType::iterator PatternMapStore< ContainerType, ValueType, ValueHandler, ReadWriteSizeType, PatternType >::iterator |
|
inline |
|
inlinevirtual |
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Does the pattern occur in the pattern store?
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >, and PatternAlignmentModel< FeatureType >.
|
pure virtual |
Does the pattern occur in the pattern store?
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >, and PatternAlignmentModel< FeatureType >.
|
pure virtual |
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
inline |
Read a map from input stream (in binary format)
|
inline |
Read a map from file (in binary format)
|
pure virtual |
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, and PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >.
|
pure virtual |
How many patterns are in the pattern store?
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Implemented in HashOrderedPatternMap< ValueType, ValueHandler, ReadWriteSizeType >, OrderedPatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternPointerMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< ValueType, ValueHandler, ReadWriteSizeType >, PatternMap< PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternStoreValueHandler< PatternMap< ValueType, ValueHandler, NestedSizeType > >, uint64_t >, PatternMap< ValueType, ValueHandler, NestedSizeType >, PatternMap< PatternFeatureVectorMap< FeatureType >, PatternFeatureVectorMapHandler< FeatureType > >, and PatternAlignmentModel< FeatureType >.
|
inlinevirtual |
Write the map to stream output (in binary format)
Implements PatternStore< ContainerType, ReadWriteSizeType, PatternType >.
Reimplemented in PatternAlignmentModel< FeatureType >.
|
inlinevirtual |
Write the map to file (in binary format)
Reimplemented in PatternAlignmentModel< FeatureType >.
|
protected |