MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / bigrams

Method bigrams

core/string/ustring.cpp:3740–3752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3738}
3739
3740Vector<String> String::bigrams() const {
3741 int n_pairs = length() - 1;
3742 Vector<String> b;
3743 if (n_pairs <= 0) {
3744 return b;
3745 }
3746 b.resize_initialized(n_pairs);
3747 String *b_ptrw = b.ptrw();
3748 for (int i = 0; i < n_pairs; i++) {
3749 b_ptrw[i] = substr(i, 2);
3750 }
3751 return b;
3752}
3753
3754// Similarity according to Sorensen-Dice coefficient
3755float String::similarity(const String &p_string) const {

Callers 1

test_string.hFile · 0.80

Calls 2

resize_initializedMethod · 0.45
ptrwMethod · 0.45

Tested by

no test coverage detected