This commit is contained in:
rjawor 2019-08-26 09:54:52 +02:00
parent f3c9f68da8
commit 1c2dcf26f2

View File

@ -8,6 +8,7 @@
#include "json_generator.hpp"
#include "full_search_result.hpp"
#include "lemmatizer_result.hpp"
#include "logger.hpp"
@ -25,11 +26,13 @@ void SearcherController::simpleSearch(rapidjson::Writer<rapidjson::StringBuffer>
std::string & pattern,
const int tmId) {
boost::ptr_map<int,Concordia>::iterator it = _concordiasMap->find(tmId);
_tmDAO.getTm
Tm tm = _tmDAO.getTm(tmId);
if (it != _concordiasMap->end()) {
TokenizedSentence tokenizedPattern = it->second->tokenize(pattern, false, false);
pattern = _lemmatizerFacade->lemmatizeIfNeeded(tokenizedPattern.getTokenizedSentence(), tmId);
SimpleSearchResult result = _unitDAO.getSimpleSearchResult(it->second->simpleSearch(pattern, true));
LemmatizerResult lemmatizerResult = _lemmatizerFacade->lemmatizeSentence(tokenizedPattern.getTokenizedSentence());
SimpleSearchResult result = _unitDAO.getSimpleSearchResult(
it->second->simpleSearch(lemmatizerResult.getLemmatizedSentence(), true));
jsonWriter.StartObject();
jsonWriter.String("status");
jsonWriter.String("success");