refactor repetition remover

This commit is contained in:
Akash Mozumdar 2018-11-27 16:54:19 -05:00
parent bb86bde8a5
commit 026912ca9c

View File

@ -23,17 +23,13 @@ void RemoveRepeatedChars(std::wstring& sentence)
void RemoveCyclicRepeats(std::wstring& sentence)
{
remove:
std::wstring junk = sentence;
while (junk.size() > 4)
{
junk.pop_back();
for (std::wstring junk = sentence; junk.size() > 4; junk.pop_back())
if (sentence.rfind(junk) > 0)
{
sentence.erase(0, junk.size());
goto remove;
}
}
}
bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo)
{