From ac5ea38c9f8f4a42278385597fae398db133ba33 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Sat, 29 Nov 2014 00:52:15 +0000 Subject: [PATCH] fixing bug --- rudict/rudict/noun.cpp | 8 ++++---- rudict/rudict/noun.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rudict/rudict/noun.cpp b/rudict/rudict/noun.cpp index 2e1d11f..9b77811 100644 --- a/rudict/rudict/noun.cpp +++ b/rudict/rudict/noun.cpp @@ -351,9 +351,9 @@ bool charIsVowel(wchar_t c) } -std::vector> getPossibleNounEndingDivisionArr(std::wstring noun) +std::set> getPossibleNounEndingDivisionSet(std::wstring noun) { - std::vector> result; + std::set> result; auto allNounEndingArr = GetAllNounEndingArr(); @@ -365,7 +365,7 @@ std::vector> getPossibleNounEndingDivision if (charIsConsolant(nounBase[nounBase.size() - 1]) || nounBase[nounBase.size() - 1] == L'ь' || nounBase[nounBase.size() - 1] == L'ъ') { - result.push_back({ nounBase, ending}); + result.insert({ nounBase, ending}); } } } @@ -790,7 +790,7 @@ std::vector RecognizeNoun(std::wstring noun) std::vector result; - auto nounEndingDivisionArr = getPossibleNounEndingDivisionArr(noun); + auto nounEndingDivisionArr = getPossibleNounEndingDivisionSet(noun); for (auto nounEndingDivision : nounEndingDivisionArr) { diff --git a/rudict/rudict/noun.h b/rudict/rudict/noun.h index 238c090..972307f 100644 --- a/rudict/rudict/noun.h +++ b/rudict/rudict/noun.h @@ -121,7 +121,7 @@ struct NounStruct }; -std::vector> getPossibleNounEndingDivisionArr(std::wstring noun); +std::set> getPossibleNounEndingDivisionSet(std::wstring noun); std::vector GetPossibleNounTupleArr(std::wstring nounEnding);