MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_EditDistanceHelper

Function BM_EditDistanceHelper

tensorflow/core/lib/gtl/edit_distance_test.cc:112–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static void BM_EditDistanceHelper(int n, int len, bool completely_different) {
113 string a =
114 "The quick brown fox jumped over the lazy dog and on and on and on"
115 " Every good boy deserves fudge. In fact, this is a very long sentence "
116 " w/many bytes..";
117 while (a.size() < static_cast<size_t>(len)) {
118 a = a + a;
119 }
120 string b = a;
121 if (completely_different) {
122 for (size_t i = 0; i < b.size(); i++) {
123 b[i]++;
124 }
125 }
126 while (n-- > 0) {
127 LevenshteinDistance(gtl::ArraySlice<char>(a.data(), len),
128 gtl::ArraySlice<char>(b.data(), len),
129 std::equal_to<char>());
130 }
131}
132
133static void BM_EditDistanceSame(int n, int len) {
134 BM_EditDistanceHelper(n, len, false);

Callers 2

BM_EditDistanceSameFunction · 0.85
BM_EditDistanceDiffFunction · 0.85

Calls 3

LevenshteinDistanceFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected