diff --git a/concordia-server/concordia_server.cpp b/concordia-server/concordia_server.cpp index 3a9a2f1..b11eac9 100644 --- a/concordia-server/concordia_server.cpp +++ b/concordia-server/concordia_server.cpp @@ -47,7 +47,7 @@ std::string ConcordiaServer::handleRequest(std::string & requestString) { outputString << "Content-type: application/json\r\n\r\n"; try { rapidjson::Document d; - Logger::logString("concordia request string", requestString); + // Logger::logString("concordia request string", requestString); bool hasError = d.Parse(requestString.c_str()).HasParseError(); if (hasError) { diff --git a/concordia-server/searcher_controller.cpp b/concordia-server/searcher_controller.cpp index 99c311c..a077f64 100644 --- a/concordia-server/searcher_controller.cpp +++ b/concordia-server/searcher_controller.cpp @@ -46,17 +46,11 @@ void SearcherController::fullSearch(rapidjson::Writer & const int tmId, const int limit, const int offset) { - Logger::logString("full search for pattern", pattern); - boost::ptr_map::iterator it = _concordiasMap->find(tmId); if (it != _concordiasMap->end()) { - Logger::log("Concordia got"); TokenizedSentence tokenizedPattern = it->second->tokenize(pattern, false, false); - Logger::log("sentence tokenized"); pattern = _lemmatizerFacade->lemmatizeIfNeeded(tokenizedPattern.getTokenizedSentence(), tmId); - Logger::log("sentence lemmatized"); FullSearchResult result = _unitDAO.getFullSearchResult(it->second->fullSearch(pattern, limit, offset, true), tokenizedPattern.getTokens().size()); - Logger::log("full search result acquired"); jsonWriter.StartObject(); jsonWriter.String("status"); jsonWriter.String("success"); diff --git a/concordia-server/unit_dao.cpp b/concordia-server/unit_dao.cpp index 609aa4d..8600e63 100644 --- a/concordia-server/unit_dao.cpp +++ b/concordia-server/unit_dao.cpp @@ -167,19 +167,15 @@ SimpleSearchResult UnitDAO::_getResultFromFragment( } ExampleOccurrence UnitDAO::_getExampleOccurrence(DBconnection & connection, const SubstringOccurrence sOccurrence, const int matchedLength) { - Logger::log("_getExampleOccurrence"); std::string query = "SELECT unit.id, unit.source_segment, unit.target_segment, unit.source_tokens[$1::integer], unit.source_tokens[$2::integer], unit.target_tokens, unit.alignments, source.name, source.link FROM unit left join source on unit.source_id = source.external_id where unit.id = $3::integer;"; std::vector params; int sourceTokenStart = 2*sOccurrence.getOffset()+1; int sourceTokenEnd = 2*(sOccurrence.getOffset()+matchedLength); - int sourceId = sOccurrence.getId(); - Logger::logInt("sourceTokenStart", sourceTokenStart); - Logger::logInt("sourceTokenEnd", sourceTokenEnd); - Logger::logInt("sourceId", sourceId); + int exampleId = sOccurrence.getId(); params.push_back(new IntParam(sourceTokenStart)); params.push_back(new IntParam(sourceTokenEnd)); - params.push_back(new IntParam(sourceId)); + params.push_back(new IntParam(exampleId)); PGresult * result = connection.execute(query, params); ExampleOccurrence occurrence(connection.getIntValue(result,0,0), // example id connection.getIntValue(result,0,3), // matched example start @@ -188,32 +184,23 @@ ExampleOccurrence UnitDAO::_getExampleOccurrence(DBconnection & connection, cons connection.getStringValue(result,0,2), // target segment connection.getStringValue(result,0,7), // source name connection.getStringValue(result,0,8)); // source link - Logger::logInt("occurence got. Example id", occurrence.getId()); - std::string targetTokensRaw = connection.getStringValue(result,0,5); - Logger::log("target tokens got"); std::string alignmentsRaw = connection.getStringValue(result,0,6); - Logger::log("alignments got"); connection.clearResult(result); BOOST_FOREACH (QueryParam * param, params) { delete param; } - Logger::log("params deleted"); std::vector targetTokens = _getArray(targetTokensRaw); std::vector > alignments = _get2DArray(alignmentsRaw); - Logger::log("arrays got"); - std::set matchedTargetTokens; for(int sourceTokenIndex = sOccurrence.getOffset(); sourceTokenIndex < sOccurrence.getOffset()+matchedLength; sourceTokenIndex++) { BOOST_FOREACH(int & targetTokenIndex, alignments.at(sourceTokenIndex)) { matchedTargetTokens.insert(targetTokenIndex); - Logger::logInt("targetTokenIndex", targetTokenIndex); } } - Logger::log("matched target tokens computed"); int prevPos = -2; int currStart = -1; @@ -237,15 +224,11 @@ ExampleOccurrence UnitDAO::_getExampleOccurrence(DBconnection & connection, cons prevPos = targetPos; } - Logger::log("matched target tokens added"); - // check if there are remaining fragments if (currStart >= 0) { occurrence.addMatchedTargetFragment(std::pair(currStart,currEnd)); } - Logger::log("getFullSearchResult done"); - return occurrence; }