LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
IdiomaticExpressionAnnotation.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 * Copyright (C) 2004-2012 by CEA LIST *
8 * *
9 ***************************************************************************/
11
15
17
18
19namespace Lima
20{
21
22namespace LinguisticProcessing
23{
24
25namespace MorphologicAnalysis
26{
27
29{
30 m_vertices.reserve(entity.size());
31 Automaton::RecognizerMatch::const_iterator it, it_end;
32 it = entity.begin(); it_end = entity.end();
33 for (; it != it_end; it++)
34 {
35 if ( (*it).m_elem.second )
36 {
37 m_vertices.push_back((*it).m_elem.first);
38 }
39 }
40}
41
42
46
48{
49 os << "ie_vertices:";
50
51 //std::vector< const uint64_t >
52 std::vector< LinguisticGraphVertex >::const_iterator it, it_end;
53 it = m_vertices.begin(); it_end = m_vertices.end();
54 if (it != it_end)
55 {
56 os << *it;
57 it++;
58 }
59 for (; it != it_end; it++)
60 {
61 os << "," << *it;
62 }
63}
64
66 std::ostream& os,
68{
70 try
71 {
73 return SUCCESS_ID;
74 }
75 catch (const boost::bad_any_cast& )
76 {
77 LERROR << "This annotation is not a IdiomaticExpressionAnnotation ; nothing dumped";
78 return UNKNOWN_ERROR;
79 }
80}
81
82
83}
84
85}
86
87}
#define LERROR
Definition LimaCommon.h:161
#define MORPHOLOGINIT
This class allows to convert any object into an annotation by inheritance.
virtual int dump(std::ostream &os, Common::AnnotationGraphs::GenericAnnotation &ga) const override
void dump(std::ostream &os)
The functions that dumps an IdiomaticExpressionAnnotation on an output stream.
NAUTITIA.
@ UNKNOWN_ERROR
Definition LimaCommon.h:238
@ SUCCESS_ID
Definition LimaCommon.h:237