21namespace LinguisticProcessing {
49 if (m_graph != m.m_graph) {
52 if (size() != m.size()) {
55 std::vector<MatchElement>::const_iterator
59 for (; it1!=it1_end; it1++,it2++) {
60 if ((*it1).m_elem!=(*it2).m_elem) {
64 if (! EntityProperties::operator==(m)) {
75 std::vector<MatchElement>::clear();
88 front().getVertex())->position();
110 for (RecognizerMatch::const_iterator it=begin(),it_end=end();
112 if ((*it).isKept()) {
120 for (RecognizerMatch::const_iterator it=begin(),it_end=end();
122 if (! (*it).isKept()) {
130 std::set<LinguisticGraphVertex> vertices;
131 for (RecognizerMatch::const_iterator it=begin(),it_end=end();
134 if (vertices.find(v) != vertices.end())
143 uint64_t currentPosition(0);
147 RecognizerMatch::const_iterator i(begin());
149 bool firstHyphenPassed =
false;
150 bool prevTokenIsSynthetic =
false;
156 firstHyphenPassed =
true;
163 prevTokenIsSynthetic =
true;
177 if (t->
position() > currentPosition) {
179 if (firstHyphenPassed) {
184 firstHyphenPassed =
true;
189 if (firstHyphenPassed) {
190 firstHyphenPassed =
false;
193 }
else if (prevTokenIsSynthetic)
199 prevTokenIsSynthetic =
true;
211 uint64_t currentPosition(0);
215 bool firstHyphenPassed =
false;
216 RecognizerMatch::const_iterator i(begin());
224 firstHyphenPassed =
true;
228 if (data==0 || data->empty()) {
233 str += sp[data->front().normalizedForm];
249 if (t->
position() > currentPosition) {
251 if (firstHyphenPassed) {
256 firstHyphenPassed =
true;
261 if (firstHyphenPassed) {
262 firstHyphenPassed =
false;
267 if (data == 0 || data->empty()) {
272 str += sp[data->front().normalizedForm];
301 bool isKept,
const LimaString& ruleElementId ) {
322 bool isKept,
const LimaString& ruleElementId) {
325 LDEBUG <<
"RecognizerMatch:addFrontVertex(v:" << v <<
", isKept:" << isKept <<
", ruleElmtId:" << ruleElementId <<
")";
341 insert(end(),l.begin(),l.end());
348 insert(begin(),l.begin(),l.end());
353 RecognizerMatch::iterator it=begin();
354 while (it != end() && ! (*it).isKept() ) {
363 RecognizerMatch::iterator next=it;
365 while (next != end()) {
368 while (! (*it).isKept() ) {
381 for (RecognizerMatch::const_iterator i(m.begin()); i != m.end(); i++) {
383 os << (*i).getRuleElemtId().toUtf8().constData() <<
"." << (*i).getVertex() <<
"-";
386 os <<
"(" << (*i).getRuleElemtId().toUtf8().constData() <<
"." << (*i).getVertex() <<
")" <<
"-";
396 for (RecognizerMatch::const_iterator i(m.begin()); i != m.end(); i++) {
398 os << (*i).getRuleElemtId().toUtf8().constData() <<
"." << (*i).getVertex() <<
"-";
401 os <<
"(" << (*i).getRuleElemtId().toUtf8().constData() <<
"." << (*i).getVertex() <<
")" <<
"-";
#define LIMA_AUTOMATON_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
void setHead(const LinguisticGraphVertex &v)
LinguisticGraphVertex m_head
indicates which token (in the original text) is the head of the recognized entity
Common::MediaticData::EntityType m_type
the type of the recognized entity
LinguisticCode m_linguisticProperties
associated ling prop
LinguisticGraphVertex getHead() const
LimaString getString() const
bool isOverlapping(const RecognizerMatch &otherMatch) const
void addBackVertex(const LinguisticGraphVertex &, bool isKept=true, const LimaString &ruleElementId="")
uint64_t positionEnd() const
uint64_t positionBegin() const
void removeUnkeptAtExtremity()
void addBack(const RecognizerMatch &l)
RecognizerMatch(const LinguisticAnalysisStructure::AnalysisGraph *graph)
LimaString getNormalizedString(const FsaStringsPool &sp) const
void addFront(const RecognizerMatch &l)
bool operator==(const RecognizerMatch &)
uint64_t numberOfElements() const
bool isContiguous() const
void addFrontVertex(const LinguisticGraphVertex &, bool isKept=true, const LimaString &ruleElementId="")
bool hasDuplicateElements() const
An AnalysisData containing a LinguisticGraph with a language and an id.
const LinguisticGraphVertex & lastVertex(void) const
Returns the last vertex of the graph.
const LinguisticGraph * getGraph(void) const
Returns the underlying graph structure.
const LinguisticGraphVertex & firstVertex(void) const
Returns the first vertex of the graph.
Holds morphosyntactic informations.
bool isAlphaHyphen() const
holds surface data of a token
uint64_t position() const
const TStatus & status() const
const LimaString & stringForm() const
std::ostream & operator<<(std::ostream &os, const DFFSPos &x)