28namespace LinguisticProcessing {
65 for (BoWFeatures::iterator it=begin(),it_end=end(); it!=it_end; it++) {
76 for (deque<std::string>::const_iterator it=featureNames.begin(),
77 it_end=featureNames.end();it!=it_end;it++)
79 string featureName=(*it);
81 string::size_type i=featureName.find(
":");
82 if (i!=string::npos) {
83 complement=string(featureName,i+1);
84 featureName=string(featureName,0,i);
87 LDEBUG <<
"BoWFeatures: initialize feature" << featureName;
89 back()->setName(featureName);
92 LERROR <<
"BoWFeatures: feature" << featureName <<
"is not defined";
108 if (
dynamic_cast<const BoWToken*
>(token) != 0)
109 oss << dynamic_cast<const BoWToken*>(token)->getPosition();
121 if (
dynamic_cast<const BoWToken*
>(token) != 0)
138 if (
dynamic_cast<const BoWToken*
>(token) != 0)
154 if (
dynamic_cast<const BoWToken*
>(token) != 0)
163m_propertyName(complement),
164m_propertyAccessor(0),
178 if (
dynamic_cast<const BoWToken*
>(token) != 0)
179 oss << dynamic_cast<const BoWToken*>(token)->getCategory();
This class is the abstract base class of all elements that can be stored in a BoWText.
virtual std::string getIdUTF8String() const =0
function used to identify a bowtoken in a text (used in BowDumper)
This class contains the representation of an element of the bag of words.
Provide tools to parse a property file, and deal with the property coding system.
const PropertyManager & getPropertyManager(const std::string &propertyName) const
Get the PropertyManager associated to a property.
const PropertyAccessor & getPropertyAccessor(const std::string &propertyName) const
Get the PropertyAccessor associated to a property.
The main LIMA exception class.
std::string getValue(const Common::BagOfWords::AbstractBoWElement *token) const override
BoWFeatureLemma(MediaId language, const std::string &complement="")
std::string getValue(const Common::BagOfWords::AbstractBoWElement *token) const override
BoWFeaturePosition(MediaId language, const std::string &complement="")
std::string getValue(const Common::BagOfWords::AbstractBoWElement *token) const override
BoWFeatureProperty(MediaId language, const std::string &complement="")
std::string getValue(const Common::BagOfWords::AbstractBoWElement *token) const override
BoWFeatureToken(MediaId language, const std::string &complement="")
BoWFeatureTstatus(MediaId language, const std::string &complement="")
std::string getValue(const Common::BagOfWords::AbstractBoWElement *token) const override
void initialize(const std::deque< std::string > &featureNames)
Defines a Factory that automatically register to a MainFactory singleton.
static const MediaticData & single()
const singleton accessor
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
BoWFeatureExtractorFactory< BoWFeatureProperty > BoWFeaturePropertyFactory(BoWFeatureProperty_ID)
BoWFeatureExtractorFactory< BoWFeatureInflectedForm > BoWFeatureInflectedormFactory(BoWFeatureInflectedForm_ID)
BoWFeatureExtractorFactory< BoWFeatureTstatus > BoWFeatureTstatusFactory(BoWFeatureTstatus_ID)
BoWFeatureExtractorFactory< BoWFeatureLemma > BoWFeatureLemmaFactory(BoWFeatureLemma_ID)
BoWFeatureExtractorFactory< BoWFeaturePosition > BoWFeaturePositionFactory(BoWFeaturePosition_ID)
BoWFeatureExtractorFactory< BoWFeatureToken > BoWFeatureTokenFactory(BoWFeatureToken_ID)