PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Private Types | Private Member Functions
PLearn::VecDictionary Class Reference

#include <VecDictionary.h>

Inheritance diagram for PLearn::VecDictionary:
Inheritance graph
[legend]
Collaboration diagram for PLearn::VecDictionary:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VecDictionary ()
 Default constructor.
 VecDictionary (TVec< string > symbols, bool up_mode=NO_UPDATE)
 Constructor.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual VecDictionarydeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.

Static Public Member Functions

static string _classname_ ()
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

TVec< string > vector_dict
 Vector of dictionary.

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares this class' options.

Private Types

typedef Dictionary inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

This class implements a Dictionary instantiated from a TVec<string>. Each element of the TVec<string> is a symbol to be inserted in the Dictionary.

Definition at line 60 of file VecDictionary.h.


Member Typedef Documentation

Reimplemented from PLearn::Dictionary.

Definition at line 65 of file VecDictionary.h.


Constructor & Destructor Documentation

PLearn::VecDictionary::VecDictionary ( )

Default constructor.

Definition at line 49 of file VecDictionary.cc.

:inherited(){}
PLearn::VecDictionary::VecDictionary ( TVec< string >  symbols,
bool  up_mode = NO_UPDATE 
)

Constructor.

Parameters:
symbolsvector of the symbols of the dictionary
up_modeupdate mode

Definition at line 51 of file VecDictionary.cc.

References build_(), PLearn::Dictionary::setUpdateMode(), and vector_dict.

{
    setUpdateMode(up_mode);
    vector_dict=symbols;
    build_();
}

Here is the call graph for this function:


Member Function Documentation

string PLearn::VecDictionary::_classname_ ( ) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

OptionList & PLearn::VecDictionary::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

RemoteMethodMap & PLearn::VecDictionary::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

bool PLearn::VecDictionary::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

Object * PLearn::VecDictionary::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

StaticInitializer VecDictionary::_static_initializer_ & PLearn::VecDictionary::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

void PLearn::VecDictionary::build ( ) [virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::Dictionary.

Definition at line 91 of file VecDictionary.cc.

References PLearn::Dictionary::build(), and build_().

Here is the call graph for this function:

void PLearn::VecDictionary::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::Dictionary.

Definition at line 72 of file VecDictionary.cc.

References PLearn::Dictionary::getId(), i, PLearn::TVec< T >::size(), PLearn::Dictionary::size(), UPDATE, PLearn::Dictionary::update_mode, and vector_dict.

Referenced by build(), and VecDictionary().

{
    //initial building
    if(size() == 0)
    {
        // save update mode for later
        int saved_up_mode=update_mode;
        // set the dictionary in update mode to insert the words
        update_mode =  UPDATE;
    
        for(int i=0; i<vector_dict.size(); i++){
            getId(vector_dict[i]);
        }
        // restore update mode;
        update_mode=saved_up_mode;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

string PLearn::VecDictionary::classname ( ) const [virtual]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

void PLearn::VecDictionary::declareOptions ( OptionList ol) [static, protected]

Declares this class' options.

Reimplemented from PLearn::Dictionary.

Definition at line 63 of file VecDictionary.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Dictionary::declareOptions(), and vector_dict.

{
    declareOption(ol, "vector_dict", 
                  &VecDictionary::vector_dict, 
                  OptionBase::buildoption, 
                  "TVec<string> containing the symbols of the dictionary");
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::VecDictionary::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Dictionary.

Definition at line 111 of file VecDictionary.h.

VecDictionary * PLearn::VecDictionary::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

OptionList & PLearn::VecDictionary::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

OptionMap & PLearn::VecDictionary::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

RemoteMethodMap & PLearn::VecDictionary::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Dictionary.

Definition at line 61 of file VecDictionary.cc.

void PLearn::VecDictionary::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Dictionary.

Definition at line 97 of file VecDictionary.cc.

References PLearn::deepCopyField(), PLearn::Dictionary::makeDeepCopyFromShallowCopy(), and vector_dict.

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::Dictionary.

Definition at line 111 of file VecDictionary.h.

Vector of dictionary.

Definition at line 78 of file VecDictionary.h.

Referenced by build_(), declareOptions(), makeDeepCopyFromShallowCopy(), and VecDictionary().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines