41 this->reserve(text.size());
42 for (LTR_Text::const_iterator itTok = text.begin();
43 itTok != text.end(); ++ itTok) {
44 this->push_back( *itTok );
46 for (SENTENCE_BOUNDS_T::const_iterator itSentBd = text.m_sentenceBounds.begin();
47 itSentBd != text.m_sentenceBounds.end(); ++ itSentBd) {
48 m_sentenceBounds.push_back(*itSentBd);
88 uint64_t tokenCounter = 0;
90 if (this->size()==0) {
93 SENTENCE_BOUNDS_T:: const_iterator itSb = m_sentenceBounds.begin();
95 for (LTR_Text::const_iterator itTok = this->begin();
96 itTok != this->end(); itTok ++) {
97 (*itTok)->binaryWriteOn(os);
99 if (tokenCounter == *itSb) {
101 if (itSb != m_sentenceBounds.end()) {
138 uint64_t tokenCounter = 1;
139 LTR_Text::SENTENCE_BOUNDS_T::const_iterator itSb = text.m_sentenceBounds.begin();
140 for (LTR_Text::const_iterator itTok = text.begin();
141 itTok != text.end(); itTok ++) {
142 if (*itTok==
nullptr) { os <<
"NULL" << std::endl; }
143 else if ((*itTok)->size()==0) { os <<
"EMPTY" << std::endl; }
144 else { os << **itTok << std::endl; }
146 if (itSb != text.m_sentenceBounds.end()) {
147 if (tokenCounter == *itSb) {
148 os <<
"==SB==========" << std::endl;
159 uint64_t tokenCounter = 1;
160 LTR_Text::SENTENCE_BOUNDS_T::const_iterator itSb = text.m_sentenceBounds.begin();
161 for (LTR_Text::const_iterator itTok = text.begin();
162 itTok != text.end(); itTok ++) {
163 if (*itTok==
nullptr) { os <<
"NULL"; }
164 else if ((*itTok)->size()==0) { os <<
"EMPTY"; }
165 else { os << **itTok; }
167 if (itSb != text.m_sentenceBounds.end()) {
168 if (tokenCounter == *itSb) {
169 os <<
"==SB==========";
a linear text representation
SENTS_CONST_ITER_T endSentenceBounds() const
SENTS_CONST_ITER_T beginSentenceBounds() const
void addSentenceBound(const uint64_t &sb)
void appendLTR_Text(const LTR_Text <r)
void addToken(boost::shared_ptr< LTR_Token > &token)
void binaryReadFrom(std::istream &is)
void binaryWriteOn(std::ostream &os) const
SENTENCE_BOUNDS_T::const_iterator SENTS_CONST_ITER_T
=======================================================================