LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
BowDocumentHandler.h
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 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSINGBOWDOCUMENTHANDLER_H
11#define LIMA_LINGUISTICPROCESSINGBOWDOCUMENTHANDLER_H
12
14#include "SBowDocumentWriter.h"
16
17#include <sstream>
18
19namespace Lima
20{
21
22namespace LinguisticProcessing
23{
24
29{
30 Q_OBJECT
31public:
33
34 virtual ~BowDocumentHandler();
35
37 void startDocument(const Common::Misc::GenericDocumentProperties& props) override;
38
40 void endDocument() override;
41
43 void startAnalysis() override;
44
46 void endAnalysis() override;
47
49 void handle(const char* buf,int length) override;
50
51 std::string getSBoWContent() const;
52
53 const std::vector<Common::BagOfWords::BoWDocument>& getBoWDocuments() const
54 { return m_bowdocs; }
55
57 void startNode( const std::string& elementName, bool forIndexing ) override;
58
60 void endNode( const Common::Misc::GenericDocumentProperties& props ) override;
61
63 // TODO a implémenter (car hérite de AbstractTextualAnalysisHandler)
64 virtual void setOut( std::ostream* out ) override
65 {
66 LIMA_UNUSED(out);
67 std::cerr << "BowDocumentHandler::setOut NOT IMPLEMENTED!!!"<<std::endl;
68 };
69
70
71private:
72
73
74 std::vector<Common::BagOfWords::BoWDocument> m_bowdocs;
75 std::ostringstream* m_bowstream;
76 SBowDocumentWriter* m_writer;
77
78};
79
80
81}
82
83}
84
85#endif
#define LIMA_ANALYSISHANDLERS_EXPORT
#define LIMA_UNUSED(x)
Definition LimaCommon.h:224
const std::vector< Common::BagOfWords::BoWDocument > & getBoWDocuments() const
virtual void setOut(std::ostream *out) override
set the output stream.
NAUTITIA.