|
PLearn 0.1
|
#include <VecDictionary.h>


Public Member Functions | |
| VecDictionary () | |
| Default constructor. | |
| VecDictionary (TVec< string > symbols, bool up_mode=NO_UPDATE) | |
| Constructor. | |
| virtual string | classname () const |
| virtual OptionList & | getOptionList () const |
| virtual OptionMap & | getOptionMap () const |
| virtual RemoteMethodMap & | getRemoteMethodMap () const |
| virtual VecDictionary * | deepCopy (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 PPath & | declaringFile () |
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. | |
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.
typedef Dictionary PLearn::VecDictionary::inherited [private] |
Reimplemented from PLearn::Dictionary.
Definition at line 65 of file VecDictionary.h.
| PLearn::VecDictionary::VecDictionary | ( | ) |
Constructor.
| symbols | vector of the symbols of the dictionary |
| up_mode | update mode |
Definition at line 51 of file VecDictionary.cc.
References build_(), PLearn::Dictionary::setUpdateMode(), and vector_dict.
{
setUpdateMode(up_mode);
vector_dict=symbols;
build_();
}

| 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.
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_().
{
inherited::build();
build_();
}

| 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;
}
}


| 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);
}

| 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.
{
inherited::makeDeepCopyFromShallowCopy(copies);
deepCopyField(vector_dict, copies);
}

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