LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
wordTransition.cpp
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/*************************************************************************
7*
8* File : wordTransition.cpp
9* Author : Romaric Besancon (besanconr@zoe.cea.fr)
10* Created on : Mon Oct 14 2002
11* Copyright : (c) 2002 by CEA
12* Version : $Id$
13*
14*************************************************************************/
15
16
17#include "wordTransition.h"
19#include <iostream>
20
21using namespace std;
23using namespace Lima::Common::MediaticData;
24
25
26namespace Lima {
27namespace LinguisticProcessing {
28namespace Automaton {
29
30/***********************************************************************/
31// constructors
32/***********************************************************************/
38
40TransitionUnit(keep),
41m_word(s)
42{
43}
44
47m_word(t.word())
48{
49// copyProperties(t);
50}
51
53
55 if (this != &t) {
56 m_word = t.word();
58 }
59 return *this;
60}
61
62
63std::string WordTransition::printValue() const {
64 ostringstream oss;
65// const FsaStringsPool& sp=Common::MediaticData::MediaticData::single().stringsPool(0);
66// LimaString s = sp[(StringsPoolIndex)m_word];
67// oss << Common::Misc::limastring2utf8stdstring(s);
68 oss << "wordT:'" << m_word << "'";
69 return oss.str();
70}
71
73 return sp[m_word];
74}
75
76/***********************************************************************/
77// operators ==
78/***********************************************************************/
80 if ( (type() == tright.type())
81 && (m_word == static_cast<const WordTransition&>(tright).word())
82 ) {
83 return compareProperties(tright);
84 }
85 else {
86 return false;
87 }
88}
89
92 const LinguisticGraphVertex& /*vertex*/,
93 AnalysisContent& /*analysis*/,
96{
97 //AULOGINIT;
98// LDEBUG << "WordTransition compare " << Common::MediaticData::MediaticData::changeable().stringsPool()[token->form()] << " and " << Common::MediaticData::MediaticData::changeable().stringsPool()[m_word];
99 if (token->form() == m_word) {
100// LDEBUG << "true";
101 return true;
102 }
103/* std::vector<StringsPoolIndex>::const_iterator
104 it=token->orthographicAlternatives().begin(),
105 it_end=token->orthographicAlternatives().end();
106 for (; it!=it_end; it++) {
107 if (*it == m_word) {
108 return true;
109 }
110 }*/
111 for (MorphoSyntacticData::const_iterator it=data->begin();
112 it!=data->end();
113 it++)
114 {
115 if (it->inflectedForm == m_word) {
116 return true;
117 }
118 }
119// LDEBUG << "false";
120 return false;
121}
122
123} // namespace end
124} // namespace end
125} // namespace end
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
bool compareProperties(const TransitionUnit &t) const
bool compare(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &vertex, AnalysisContent &analysis, const LinguisticAnalysisStructure::Token *token, const LinguisticAnalysisStructure::MorphoSyntacticData *data) const override
comparison of the transition with a token : can use the graph and vertex info, associated with genera...
LimaString wordString(const FsaStringsPool &sp) const
bool operator==(const TransitionUnit &) const override
WordTransition & operator=(const WordTransition &)
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.
QString LimaString
Definition LimaString.h:33
STL namespace.