From fbbcd047ce3add89d8227b23f15c58c5993366b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20de=20Chalendar?= Date: Wed, 8 May 2024 00:19:41 +0200 Subject: [PATCH] Add pipeline forging --- lima_common/conf/lima-analysis.xml | 80 ++++++++++++++++-- .../ProcessUnitPipeline.h | 1 + .../ProcessUnitPipeline.tcc | 6 ++ .../conf/lima-lp-ud-eng.xml | 2 +- lima_linguisticprocessing/conf/lima-lp-ud.xml | 2 +- .../client/CMakeLists.txt | 74 ++++++++++++++++ .../linguisticProcessing/client}/lima.cpp | 75 ++++++++++++++++- .../linguisticProcessing/client}/lima.h | 4 + .../core/CoreLinguisticProcessingClient.h | 10 ++- .../test/analyzeText.cpp | 84 ++++++++++++++++++- .../tests/CMakeLists.txt | 71 +--------------- .../tests/LimaAnalyzerTest0.cpp | 51 ++++++++++- .../tests/LimaAnalyzerTest0.h | 5 +- lima_linguisticprocessing/tests/test_lima.cpp | 67 --------------- 14 files changed, 377 insertions(+), 155 deletions(-) rename lima_linguisticprocessing/{tests => src/linguisticProcessing/client}/lima.cpp (93%) rename lima_linguisticprocessing/{tests => src/linguisticProcessing/client}/lima.h (95%) delete mode 100644 lima_linguisticprocessing/tests/test_lima.cpp diff --git a/lima_common/conf/lima-analysis.xml b/lima_common/conf/lima-analysis.xml index d762c45bc..1a05953ec 100644 --- a/lima_common/conf/lima-analysis.xml +++ b/lima_common/conf/lima-analysis.xml @@ -511,11 +511,81 @@ SPDX-License-Identifier: MIT - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.h b/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.h index 13345f573..8cea4436e 100644 --- a/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.h +++ b/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.h @@ -63,6 +63,7 @@ class ProcessUnitPipeline : public ProcessUnit const std::string& unitId, typename ProcessUnit::Manager* manager); + void push_back(std::shared_ptr pu); private: void debugPrintInactiveUnits() const; diff --git a/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.tcc b/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.tcc index dca4fbfc8..7731641b1 100644 --- a/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.tcc +++ b/lima_common/src/common/ProcessUnitFramework/ProcessUnitPipeline.tcc @@ -55,6 +55,12 @@ void ProcessUnitPipeline::push_back( m_processUnitSequence.push_back(pu); } +template +void ProcessUnitPipeline::push_back(std::shared_ptr pu) +{ + m_processUnitSequence.push_back(pu); +} + template LimaStatusCode ProcessUnitPipeline::process( AnalysisContent& analysis) const diff --git a/lima_linguisticprocessing/conf/lima-lp-ud-eng.xml b/lima_linguisticprocessing/conf/lima-lp-ud-eng.xml index 3ca21a826..5d33cc52d 100644 --- a/lima_linguisticprocessing/conf/lima-lp-ud-eng.xml +++ b/lima_linguisticprocessing/conf/lima-lp-ud-eng.xml @@ -80,7 +80,7 @@ SPDX-License-Identifier: MIT - +