#include <FeatureVector.h>
Public Types | |
typedef boost::unordered_map < std::string, size_t > | Name2Id |
typedef boost::unordered_map < size_t, size_t > | Id2Count |
Public Member Functions | |
FName (const StringPiece &root, const StringPiece &name) | |
FName (const StringPiece &name) | |
const std::string & | name () const |
size_t | hash () const |
bool | operator== (const FName &rhs) const |
bool | operator!= (const FName &rhs) const |
Static Public Member Functions | |
static size_t | getId (const std::string &name) |
static size_t | getHopeIdCount (const std::string &name) |
static size_t | getFearIdCount (const std::string &name) |
static void | incrementHopeId (const std::string &name) |
static void | incrementFearId (const std::string &name) |
static void | eraseId (size_t id) |
Static Public Attributes | |
static const std::string | SEP = "_" |
static Name2Id | name2id |
static std::vector< std::string > | id2name |
static Id2Count | id2hopeCount |
static Id2Count | id2fearCount |
Definition at line 58 of file FeatureVector.h.
typedef boost::unordered_map<size_t,size_t> Moses::FName::Id2Count |
Definition at line 63 of file FeatureVector.h.
typedef boost::unordered_map<std::string,size_t> Moses::FName::Name2Id |
Definition at line 62 of file FeatureVector.h.
Moses::FName::FName | ( | const StringPiece & | root, | |
const StringPiece & | name | |||
) | [inline] |
Definition at line 73 of file FeatureVector.h.
References StringPiece::data(), SEP, and StringPiece::size().
Moses::FName::FName | ( | const StringPiece & | name | ) | [inline, explicit] |
Definition at line 79 of file FeatureVector.h.
void Moses::FName::eraseId | ( | size_t | id | ) | [static] |
Definition at line 127 of file FeatureVector.cpp.
References id2fearCount, and id2hopeCount.
Referenced by Moses::FVector::l1regularize(), Moses::FVector::pruneSparseFeatures(), Moses::FVector::pruneZeroWeightFeatures(), and Moses::FVector::sparseL1regularize().
static size_t Moses::FName::getFearIdCount | ( | const std::string & | name | ) | [static] |
Referenced by Moses::FVector::printSparseFearFeatureCounts(), and Moses::FVector::pruneSparseFeatures().
static size_t Moses::FName::getHopeIdCount | ( | const std::string & | name | ) | [static] |
Referenced by Moses::FVector::printSparseHopeFeatureCounts(), and Moses::FVector::pruneSparseFeatures().
static size_t Moses::FName::getId | ( | const std::string & | name | ) | [static] |
Referenced by Moses::FVector::l1regularize(), Moses::FVector::pruneSparseFeatures(), Moses::FVector::pruneZeroWeightFeatures(), and Moses::FVector::sparseL1regularize().
size_t Moses::FName::hash | ( | ) | const |
Definition at line 144 of file FeatureVector.cpp.
References Moses::hash_value().
Referenced by Moses::FNameHash::operator()().
static void Moses::FName::incrementFearId | ( | const std::string & | name | ) | [static] |
Referenced by Moses::FVector::incrementSparseFearFeatures().
static void Moses::FName::incrementHopeId | ( | const std::string & | name | ) | [static] |
Referenced by Moses::FVector::incrementSparseHopeFeatures().
const std::string & Moses::FName::name | ( | ) | const |
Definition at line 149 of file FeatureVector.cpp.
References id2name.
Referenced by Moses::operator<<().
bool Moses::FName::operator!= | ( | const FName & | rhs | ) | const |
Definition at line 160 of file FeatureVector.cpp.
bool Moses::FName::operator== | ( | const FName & | rhs | ) | const |
Definition at line 155 of file FeatureVector.cpp.
vector< string > Moses::FName::id2name [static] |
FName::Name2Id Moses::FName::name2id [static] |
Definition at line 65 of file FeatureVector.h.
const string Moses::FName::SEP = "_" [static] |
Definition at line 60 of file FeatureVector.h.
Referenced by FName(), Moses::ScoreComponentCollection::GetNumberWeights(), Moses::ScoreComponentCollection::GetVectorForProducer(), and Moses::ScoreComponentCollection::MultiplyEquals().