mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 08:54:12 +08:00
destroy garbage sentences
This commit is contained in:
parent
b09783d111
commit
dad036083a
@ -188,7 +188,7 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo)
|
||||
Trim(sentence);
|
||||
sentence.erase(std::remove_if(sentence.begin(), sentence.end(), [](wchar_t ch) { return ch < ' ' && ch != '\n'; }), sentence.end());
|
||||
}
|
||||
if (!std::regex_replace(sentence, std::wregex(L"\\s|\x200b"), L"").size()) return false;
|
||||
if (sentence.empty()) return true;
|
||||
if (useCache)
|
||||
{
|
||||
auto translationCache = ::translationCache.Acquire();
|
||||
|
Loading…
x
Reference in New Issue
Block a user