LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
LTRTextHandler.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 ***************************************************************************/
10
11#include "LTRTextHandler.h"
13
14using namespace std;
15using namespace Lima::Common::BagOfWords;
16
17namespace Lima {
18namespace LinguisticProcessing {
19
21 : AbstractTextualAnalysisHandler(),m_ltrstream(),m_ltrtext()
22{
23}
24
25
29
34
35
37{
38 // read from completed stream
39 m_ltrtext.binaryReadFrom(m_ltrstream);
40}
41
42
44{
45 m_ltrtext.clear();
46 // reset stringstream
47 m_ltrstream.str("");
48}
49
50void LTRTextHandler::handle(const char* buf, int length)
51{
52 // store in stream
53 m_ltrstream.write(buf,length);
54 //m_writer->handle(buf,length);
55}
56
60
64
65void LTRTextHandler::startNode( const std::string& /*elementName*/, bool /*forIndexing*/ )
66{
67}
68
72
73} // end namespace
74} // end namespace
Defines a Factory to create Object of type Base.
a linear text representation
Definition ltrText.h:41
void binaryReadFrom(std::istream &is)
Definition ltrText.cpp:116
virtual void endAnalysis() override
function called by the LIMA analyzer on the end of a text part that is to be analyzed
void endDocument() override
notify the end of the document
virtual void handle(const char *buf, int length) override
gives content.
Common::BagOfWords::LTR_Text & getLTRText()
void endNode(const Common::Misc::GenericDocumentProperties &props) override
notify the end of a hierarchyNode
void startNode(const std::string &elementName, bool forIndexing) override
notify the start of a new hierarchyNode
void startDocument(const Common::Misc::GenericDocumentProperties &) override
notify the start of a new document, and give its properties
virtual void startAnalysis() override
function called by the LIMA analyzer on start of a new document
NAUTITIA.
STL namespace.