diff options
author | George Marques <george@gmarqu.es> | 2016-06-13 14:06:03 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2016-06-19 11:39:01 -0300 |
commit | 1b8d0a16b7df53aa0f43f046fe8fcc4b446df69e (patch) | |
tree | 22cf5f193062ec1a7e89441219a07beaebe98e71 /core/ustring.h | |
parent | f47d7b27cb70c8f454fd5a6461f817a2928d52e5 (diff) | |
download | redot-engine-1b8d0a16b7df53aa0f43f046fe8fcc4b446df69e.tar.gz |
Add similarity comparison to String
Uses the Sorensen-Dice coefficient to calculate similarity. This also adds
String.bigrams() as a convenience function needed by the comparison.
Diffstat (limited to 'core/ustring.h')
-rw-r--r-- | core/ustring.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/ustring.h b/core/ustring.h index 8aceb0748c..692cb4e37d 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -123,6 +123,8 @@ public: bool ends_with(const String& p_string) const; bool is_subsequence_of(const String& p_string) const; bool is_subsequence_ofi(const String& p_string) const; + Vector<String> bigrams() const; + float similarity(const String& p_string) const; String replace_first(String p_key,String p_with) const; String replace(String p_key,String p_with) const; String replacen(String p_key,String p_with) const; |