|
PLearn 0.1
|
The first sentence should be a BRIEF DESCRIPTION of what the class does. More...
#include <VMatDictionaryCommand.h>


Public Member Functions | |
| VMatDictionaryCommand () | |
| virtual void | run (const std::vector< std::string > &args) |
| The actual implementation of the 'VMatDictionaryCommand' command. | |
Static Protected Attributes | |
| static PLearnCommandRegistry | reg_ |
| This allows to register the 'VMatDictionaryCommand' command in the command registry. | |
Private Types | |
| typedef PLearnCommand | inherited |
The first sentence should be a BRIEF DESCRIPTION of what the class does.
Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html
Definition at line 58 of file VMatDictionaryCommand.h.
typedef PLearnCommand PLearn::VMatDictionaryCommand::inherited [private] |
Definition at line 60 of file VMatDictionaryCommand.h.
| PLearn::VMatDictionaryCommand::VMatDictionaryCommand | ( | ) |
Definition at line 52 of file VMatDictionaryCommand.cc.
: PLearnCommand( "vmat_dictionary", "Create Dictionary objects for each field of a vmat", "Will create <dataset>.field#.dict, where # is the\n" "field (column) number, starting at 0. Those files contain the plearn\n" "scripts of the Dictionary objets for each field.\n" ) {}
| void PLearn::VMatDictionaryCommand::run | ( | const std::vector< std::string > & | args | ) | [virtual] |
The actual implementation of the 'VMatDictionaryCommand' command.
Implements PLearn::PLearnCommand.
Definition at line 63 of file VMatDictionaryCommand.cc.
References PLearn::DictionaryVMatrix::build(), PLearn::DictionaryVMatrix::delimiters, PLearn::extract_extension(), PLearn::DictionaryVMatrix::file_names, PLearn::getDataSet(), i, PLearn::save(), PLearn::tostring(), and PLearn::VMat::width().
{
PPath indexf= "";
string vmat_file = args[0];
string ext = extract_extension(vmat_file);
VMat vmat;
if(ext == ".txt")
{
DictionaryVMatrix* dvmat = new DictionaryVMatrix();
TVec<PPath> file_names(1);
file_names[0] = vmat_file;
dvmat->file_names = file_names;
dvmat->delimiters = "";
dvmat->build();
vmat = dvmat;
}
else
vmat = getDataSet(vmat_file);
for(int i=0; i<vmat->width(); i++)
{
if(vmat->getDictionary(i))
{
string dico_name = vmat_file + ".col" + tostring(i) + ".dict";
save(dico_name,*(vmat->getDictionary(i)));
}
}
}

PLearnCommandRegistry PLearn::VMatDictionaryCommand::reg_ [static, protected] |
This allows to register the 'VMatDictionaryCommand' command in the command registry.
Definition at line 67 of file VMatDictionaryCommand.h.
1.7.4