29namespace LinguisticProcessing
31namespace FlatTokenizer
38 TextPrivate(MediaId lang, std::shared_ptr<CharChart> charChart);
65 m_charChart(charChart)
73Text::Text(MediaId lang, std::shared_ptr<CharChart> charChart) :
109 return m_d->
m_text.size();
131 if (adjItr==adjItrEnd)
137 if (++adjItr!=adjItrEnd) {
159 LDEBUG <<
"Trying to move after text end.";
170 LDEBUG <<
"Text::advance : new current=" << m_d->
m_curPtr <<
" from='"
182 LDEBUG <<
"currentClass() at " << m_d->
m_curPtr <<
". No char after text end";
194 if (c.isHighSurrogate())
232 LERROR <<
"Empty token !";
239 LDEBUG <<
" Adding token '" << str <<
"'";
267 if (((
static_cast<int>(m_d->
m_curPtr)+i) < 0) || (
static_cast<int>(m_d->
m_curPtr)+i >= m_d->
m_text.size()))
276 LDEBUG <<
"Text::setAlphaCapital " << alphaCapital;
279 switch (alphaCapital)
308 LDEBUG <<
"Text::setAlphaRoman " << alphaRoman;
330 LDEBUG <<
"Text::setAlphaHyphen " << isAlphaHyphen;
339 LDEBUG <<
"Text::setAlphaPossessive " << isAlphaPossessive;
350 LDEBUG <<
"Text::setAlphaConcatAbbrev " << isConcatAbbreviation;
353 if (isConcatAbbreviation> 0)
361 LDEBUG <<
"Text::setTwitter " << isTwitter;
372 LDEBUG <<
"Text::setNumeric " << numeric;
400 LDEBUG <<
"Text::setStatus " << status;
445 std::string defaultKey;
449 case T_CAPITAL : defaultKey =
"t_capital" ;
break;
450 case T_SMALL : defaultKey =
"t_small" ;
break;
452 case T_ACRONYM : defaultKey =
"t_acronym" ;
break;
454 case T_ABBREV : defaultKey =
"t_abbrev" ;
break;
460 case T_NOT_ROMAN : defaultKey =
"t_not_roman" ;
break;
468 defaultKey =
"t_alpha_possessive";
474 case T_INTEGER : defaultKey =
"t_integer" ;
break;
476 case T_DOT_NUMBER : defaultKey =
"t_dot_number" ;
break;
477 case T_FRACTION : defaultKey =
"t_fraction" ;
break;
484 case T_PATTERN : defaultKey =
"t_pattern" ;
break;
485 case T_WORD_BRK : defaultKey =
"t_word_brk" ;
break;
488 default: defaultKey =
"t_fallback";
492 LDEBUG <<
"Text::computeDefaultKey " << defaultKey;
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
LinguisticGraph::adjacency_iterator LinguisticGraphAdjacencyIt
#define LIMA_LP_EXCEPTION(X)
This macro writes the message X to a previously configured error stream before throwing a LinguisticP...
LinguisticGraphVertex m_currentVx
LinguisticGraph * m_tTokenGraph
TextPrivate & operator=(const Text &)=delete
LinguisticGraphVertex m_lastVx
TextPrivate(MediaId lang, std::shared_ptr< CharChart > charChart)
std::shared_ptr< CharChart > m_charChart
TextPrivate(const Text &)=delete
LinguisticAnalysisStructure::TStatus m_curSettings
FsaStringsPool * m_stringsPool
void setGraph(LinguisticGraphVertex position, LinguisticGraph *graph)
void setAlphaRoman(const LinguisticAnalysisStructure::AlphaRomanType alphaRoman)
void setAlphaConcatAbbrev(const unsigned char isConcatAbbreviation)
void setAlphaHyphen(const unsigned char isAlphaHyphen)
void computeDefaultStatus()
void finalizeAndUnsetGraph()
void setDefaultKey(const Lima::LimaString &defaultKey)
const CharClass * currentClass() const
void setNumeric(const LinguisticAnalysisStructure::NumericType numeric)
void setTwitter(const unsigned char isTwitter)
void setStatus(const LinguisticAnalysisStructure::StatusType status)
Lima::LimaChar currentChar() const
void setAlphaCapital(const LinguisticAnalysisStructure::AlphaCapitalType alphaCapital)
void setAlphaPossessive(const unsigned char isAlphaPossessive)
void setText(const Lima::LimaString &text)
Lima::LimaChar operator[](int i) const
Text(MediaId lang, std::shared_ptr< CharChart > charChart)
Holds morphosyntactic informations.
NumericType getNumeric() const
StatusType getStatus() const
void setAlphaConcatAbbrev(bool concatAbbrev)
AlphaCapitalType getAlphaCapital() const
void setAlphaRoman(const AlphaRomanType alphaRoman)
bool isAlphaPossessive() const
void setStatus(const StatusType other)
void setDefaultKey(const Lima::LimaString &defaultKey)
void setTwitter(bool isTwitter)
void setAlphaHyphen(bool isAlphaHyphen)
void setAlphaPossessive(bool isAlphaPossessive)
bool isAlphaHyphen() const
void setNumeric(const NumericType numeric)
AlphaRomanType getAlphaRoman() const
std::string toString() const
void setAlphaCapital(const AlphaCapitalType alphaCapital)
holds surface data of a token
const TStatus & status() const
void setStatus(const TStatus &status)
Set the TStatus of a token.
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
LimaString utf8stdstring2limastring(const std::string &src)