52 for (LTR_Token::const_iterator itBow = tok.begin();
53 itBow != tok.end(); itBow ++) {
55 make_pair( boost::shared_ptr< BoWToken >(
new BoWToken(*(itBow->first))),
70 for (LTR_Token::const_iterator itTok = this->begin();
71 itTok != this->end(); itTok ++) {
86 for (uint64_t i = 1; i <= tokenNb; i ++) {
87 boost::shared_ptr< BoWToken > bowTok(
new BoWToken());
90 this->push_back(make_pair(bowTok, selectionFlag != 0));
102 for (
const auto& t: tok) {
103 if (first) { first=
false; }
else { os <<
" | "; }
104 if (t.first==
nullptr) { os <<
"NULL"; }
else { os << *(t.first); }
105 if (t.second) os <<
"*";
113 for (
const auto& t: tok) {
114 if (first) { first=
false; }
else { os <<
" | "; }
115 if (t.first==
nullptr) { os <<
"NULL"; }
else { os << *(t.first); }
116 if (t.second) os <<
"*";
void readSimpleToken(std::istream &file, boost::shared_ptr< BoWToken > token)
void writeSimpleToken(std::ostream &file, const boost::shared_ptr< BoWToken > token) const
This class contains the representation of an element of the bag of words.
a token of a linear text representation Each LTR_Token represents the set of words that start at a po...
void binaryReadFrom(std::istream &is)
void binaryWriteOn(std::ostream &os) const
=======================================================================
T & operator<<(T &qd, const BoWType &bt)
uint64_t readCodedInt(std::istream &file)
read a integer coded in variable-byte format in a file
void writeCodedInt(std::ostream &file, const uint64_t number)
write a integer coded in variable-byte format in a file