Skip to content

Commit

Permalink
Доработка токенизатора
Browse files Browse the repository at this point in the history
  • Loading branch information
anyks committed Sep 20, 2020
1 parent b1359f4 commit 5ff2295
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.md
@@ -1,5 +1,7 @@
# [Change Log](https://github.com/anyks/alm/archive/release.tar.gz)

## [3.4.9](https://github.com/anyks/alm/archive/v3.4.9.tar.gz) Bug fixes

## [3.4.8](https://github.com/anyks/alm/archive/v3.4.8.tar.gz) Bug fixes

## [3.4.7](https://github.com/anyks/alm/archive/v3.4.7.tar.gz) Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion app/alm.hpp
Expand Up @@ -9,7 +9,7 @@
// Название языковой модели
#define ANYKS_LM_NAME "alm"
// Версия приложения
#define ANYKS_LM_VERSION "3.4.8"
#define ANYKS_LM_VERSION "3.4.9"
// Автор приложения
#define ANYKS_LM_AUTHOR "Yuriy Lobarev"
// Телефон автора
Expand Down
3 changes: 3 additions & 0 deletions src/tokenizer.cpp
Expand Up @@ -1157,6 +1157,9 @@ void anyks::Tokenizer::run(const string & text, function <const bool (const wstr
void anyks::Tokenizer::run(const wstring & text, function <const bool (const wstring &, const vector <string> &, const bool, const bool)> callback) const noexcept {
// Если текст передан, и текст не больше 100Mb в одну строку
if(!text.empty() && (text.size() <= MAX_STRING_BYTES) && (this->alphabet != nullptr)){
// Если последний символ равен переносу строки или возврату каретки, удаляем его
if(text.back() == L'\n') const_cast <wstring *> (&text)->pop_back();
if(text.back() == L'\r') const_cast <wstring *> (&text)->pop_back();
// Если внешняя функция существует, выполняем её
if(this->extFn != nullptr) this->extFn(text, callback);
// Иначе выполняем обработк собственными методами
Expand Down

0 comments on commit 5ff2295

Please sign in to comment.