LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
lima.h
Go to the documentation of this file.
1// Copyright 2019-2022 CEA LIST
2// SPDX-FileCopyrightText: 2019-2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/****************************************************************************
7**
8** Copyright (C) 2018 The Qt Company Ltd.
9** Contact: https://www.qt.io/licensing/
10**
11** This file is part of the Qt for Python examples of the Qt Toolkit.
12**
13** $QT_BEGIN_LICENSE:BSD$
14** Commercial License Usage
15** Licensees holding valid commercial Qt licenses may use this file in
16** accordance with the commercial license agreement provided with the
17** Software or, alternatively, in accordance with the terms contained in
18** a written agreement between you and The Qt Company. For licensing terms
19** and conditions see https://www.qt.io/terms-conditions. For further
20** information use the contact form at https://www.qt.io/contact-us.
21**
22** BSD License Usage
23** Alternatively, you may use this file under the terms of the BSD license
24** as follows:
25**
26** "Redistribution and use in source and binary forms, with or without
27** modification, are permitted provided that the following conditions are
28** met:
29** * Redistributions of source code must retain the above copyright
30** notice, this list of conditions and the following disclaimer.
31** * Redistributions in binary form must reproduce the above copyright
32** notice, this list of conditions and the following disclaimer in
33** the documentation and/or other materials provided with the
34** distribution.
35** * Neither the name of The Qt Company Ltd nor the names of its
36** contributors may be used to endorse or promote products derived
37** from this software without specific prior written permission.
38**
39**
40** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
51**
52** $QT_END_LICENSE$
53**
54****************************************************************************/
55
56#ifndef LIMAANALYZER_H
57#define LIMAANALYZER_H
58
59
60#include <memory>
61#include <string>
62#include <vector>
63
64// Self-contained (this header deliberately includes no LIMA/Qt header):
65// lima-lp-analyzer is built with LIMA_LINGUISTICPROCESSIONGCLIENT_EXPORTING.
66#if defined(_WIN32)
67# ifdef LIMA_LINGUISTICPROCESSIONGCLIENT_EXPORTING
68# define LIMA_ANALYZER_EXPORT __declspec(dllexport)
69# else
70# define LIMA_ANALYZER_EXPORT __declspec(dllimport)
71# endif
72#else
73# define LIMA_ANALYZER_EXPORT
74#endif
75
78{
79 friend class LimaAnalyzerPrivate;
80public:
81 LimaAnalyzer(const std::string& langs,
82 const std::string& pipelines,
83 const std::string& modulePath,
84 const std::string& user_config_path="",
85 const std::string& user_resources_path="",
86 const std::string& meta="");
87
89 LimaAnalyzer(const LimaAnalyzer& a) ;
91
92 std::string analyzeText(const std::string& text,
93 const std::string& lang="",
94 const std::string& pipeline="",
95 const std::string& meta="");
96
97 bool addPipelineUnit(const std::string& pipeline,
98 const std::string& media,
99 const std::string& jsonGroupString);
100
101 bool error = false;
102 std::string errorMessage = "";
103
104private:
106};
107
108#endif // LIMAANALYZER_H
std::string errorMessage
Definition lima.h:102
LimaAnalyzer & operator=(const LimaAnalyzer &a)
Definition lima.cpp:515
LimaAnalyzer(const std::string &langs, const std::string &pipelines, const std::string &modulePath, const std::string &user_config_path="", const std::string &user_resources_path="", const std::string &meta="")
Definition lima.cpp:464
friend class LimaAnalyzerPrivate
Definition lima.h:79
std::string analyzeText(const std::string &text, const std::string &lang="", const std::string &pipeline="", const std::string &meta="")
Definition lima.cpp:642
bool addPipelineUnit(const std::string &pipeline, const std::string &media, const std::string &jsonGroupString)
Definition lima.cpp:576
bool error
Definition lima.h:101
#define LIMA_ANALYZER_EXPORT
Definition lima.h:73