diff options
author | myltsev <myltsev@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | 9166d66c30c23c9e85a7c88185a068987148d23f (patch) | |
tree | 421bdcec5755d9e441c485560aab5ab8d74c7475 /library/cpp/string_utils | |
parent | 8d3a5ed3a188a34167eaee54f1691ce5c9edf2f3 (diff) | |
download | ydb-9166d66c30c23c9e85a7c88185a068987148d23f.tar.gz |
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils')
-rw-r--r-- | library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h | 20 | ||||
-rw-r--r-- | library/cpp/string_utils/levenshtein_diff/levenshtein_diff_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/string_utils/levenshtein_diff/ut/ya.make | 8 | ||||
-rw-r--r-- | library/cpp/string_utils/ya.make | 6 | ||||
-rw-r--r-- | library/cpp/string_utils/ztstrbuf/ya.make | 18 | ||||
-rw-r--r-- | library/cpp/string_utils/ztstrbuf/ztstrbuf.cpp | 16 | ||||
-rw-r--r-- | library/cpp/string_utils/ztstrbuf/ztstrbuf.h | 70 |
7 files changed, 73 insertions, 73 deletions
diff --git a/library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h b/library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h index 8a240bfed8..5c8e4adb14 100644 --- a/library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h +++ b/library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h @@ -141,16 +141,16 @@ namespace NLevenshtein { template <class TStringType> size_t Distance(const TStringType& str1, const TStringType& str2) { - TEditChain editChain; - GetEditChain(str1, str2, editChain); - size_t result = 0; - for (auto edit : editChain) { - if (IsImportantEditMove(edit)) - result++; - } - return result; - } - + TEditChain editChain; + GetEditChain(str1, str2, editChain); + size_t result = 0; + for (auto edit : editChain) { + if (IsImportantEditMove(edit)) + result++; + } + return result; + } + /// Calculates substrings to be replaced for str1->str2 transformation struct TReplacement { int CorrectOffset, CorrectLength, MisspelledOffset, MisspelledLength; diff --git a/library/cpp/string_utils/levenshtein_diff/levenshtein_diff_ut.cpp b/library/cpp/string_utils/levenshtein_diff/levenshtein_diff_ut.cpp index cf0f78637f..c5f2165854 100644 --- a/library/cpp/string_utils/levenshtein_diff/levenshtein_diff_ut.cpp +++ b/library/cpp/string_utils/levenshtein_diff/levenshtein_diff_ut.cpp @@ -1,7 +1,7 @@ #include "levenshtein_diff.h" - + #include <library/cpp/testing/unittest/registar.h> - + #include <util/generic/string.h> namespace { @@ -28,8 +28,8 @@ Y_UNIT_TEST_SUITE(Levenstein) { Y_UNIT_TEST(Distance) { UNIT_ASSERT_VALUES_EQUAL(NLevenshtein::Distance(TStringBuf("hello"), TStringBuf("hulloah")), 3); UNIT_ASSERT_VALUES_EQUAL(NLevenshtein::Distance(TStringBuf("yeoman"), TStringBuf("yo man")), 2); - } -} + } +} Y_UNIT_TEST_SUITE(WeightedLevenstein) { Y_UNIT_TEST(EqualStrings) { diff --git a/library/cpp/string_utils/levenshtein_diff/ut/ya.make b/library/cpp/string_utils/levenshtein_diff/ut/ya.make index a3b9b8fea5..79130d6264 100644 --- a/library/cpp/string_utils/levenshtein_diff/ut/ya.make +++ b/library/cpp/string_utils/levenshtein_diff/ut/ya.make @@ -1,9 +1,9 @@ UNITTEST_FOR(library/cpp/string_utils/levenshtein_diff) -OWNER(myltsev) - +OWNER(myltsev) + SRCS( levenshtein_diff_ut.cpp ) - -END() + +END() diff --git a/library/cpp/string_utils/ya.make b/library/cpp/string_utils/ya.make index cd731bda95..c802c438dc 100644 --- a/library/cpp/string_utils/ya.make +++ b/library/cpp/string_utils/ya.make @@ -1,4 +1,4 @@ -RECURSE( +RECURSE( ascii_encode ascii_encode/ut base64 @@ -33,5 +33,5 @@ RECURSE( tskv_format/fuzz url url/ut - ztstrbuf -) + ztstrbuf +) diff --git a/library/cpp/string_utils/ztstrbuf/ya.make b/library/cpp/string_utils/ztstrbuf/ya.make index 28b3f32f58..10bdad091f 100644 --- a/library/cpp/string_utils/ztstrbuf/ya.make +++ b/library/cpp/string_utils/ztstrbuf/ya.make @@ -1,9 +1,9 @@ -LIBRARY() - -OWNER(myltsev) - -SRCS( - ztstrbuf.cpp -) - -END() +LIBRARY() + +OWNER(myltsev) + +SRCS( + ztstrbuf.cpp +) + +END() diff --git a/library/cpp/string_utils/ztstrbuf/ztstrbuf.cpp b/library/cpp/string_utils/ztstrbuf/ztstrbuf.cpp index 4a7269ff4a..98f6cead1c 100644 --- a/library/cpp/string_utils/ztstrbuf/ztstrbuf.cpp +++ b/library/cpp/string_utils/ztstrbuf/ztstrbuf.cpp @@ -1,8 +1,8 @@ -#include "ztstrbuf.h" - -#include <util/stream/output.h> - -template <> -void Out<TZtStringBuf>(IOutputStream& os, const TZtStringBuf& sb) { - os << static_cast<const TStringBuf&>(sb); -} +#include "ztstrbuf.h" + +#include <util/stream/output.h> + +template <> +void Out<TZtStringBuf>(IOutputStream& os, const TZtStringBuf& sb) { + os << static_cast<const TStringBuf&>(sb); +} diff --git a/library/cpp/string_utils/ztstrbuf/ztstrbuf.h b/library/cpp/string_utils/ztstrbuf/ztstrbuf.h index 5fab768d8c..04c509bcc5 100644 --- a/library/cpp/string_utils/ztstrbuf/ztstrbuf.h +++ b/library/cpp/string_utils/ztstrbuf/ztstrbuf.h @@ -1,36 +1,36 @@ -#pragma once - -#include <util/generic/strbuf.h> +#pragma once + +#include <util/generic/strbuf.h> #include <util/generic/string.h> - -/* - * Zero-terminated string view. - * - * Has a c_str() for use with system/cstdlib calls (like TString) - * but can be constructed from a string literal or command-line arg - * without memory allocation (like TStringBuf). - * - * Use it to reference filenames, thread names, string formats etc. - */ - -class TZtStringBuf: public TStringBuf { -public: - TZtStringBuf(const char* s) - : TStringBuf(s) - { - } - - TZtStringBuf(const TString& s) - : TStringBuf(s) - { - } - - TZtStringBuf() - : TZtStringBuf(TString{}) - { - } - - const char* c_str() const { - return data(); - } -}; + +/* + * Zero-terminated string view. + * + * Has a c_str() for use with system/cstdlib calls (like TString) + * but can be constructed from a string literal or command-line arg + * without memory allocation (like TStringBuf). + * + * Use it to reference filenames, thread names, string formats etc. + */ + +class TZtStringBuf: public TStringBuf { +public: + TZtStringBuf(const char* s) + : TStringBuf(s) + { + } + + TZtStringBuf(const TString& s) + : TStringBuf(s) + { + } + + TZtStringBuf() + : TZtStringBuf(TString{}) + { + } + + const char* c_str() const { + return data(); + } +}; |