https://github.com/rapidfuzz/rapidfuzz-cpp
두 개의 스트링이 얼마나 유사한지 비교하는 라이브러리.. 요놈은 참 응용할 때가 많음.
#include <rapidfuzz/fuzz.hpp>
...
// score is 96.55171966552734
double score = rapidfuzz::fuzz::ratio("this is a test", "this is a test!");
// score is 100
double score = rapidfuzz::fuzz::partial_ratio("this is a test", "this is a test!");
// score is 90.90908813476562
double score = rapidfuzz::fuzz::ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear");
// score is 100
double score = rapidfuzz::fuzz::token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear");
// score is 83.8709716796875
double score = rapidfuzz::fuzz::token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear");
// score is 100
double score = rapidfuzz::fuzz::token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear");
'블로그 (Blog) > 개발로그 (Devlogs)' 카테고리의 다른 글
Qt용 스프레드쉬트 예제 코드 (0) | 2024.05.23 |
---|---|
Mesh Deformation (0) | 2024.05.20 |
math expression parser (0) | 2024.03.28 |
PPT의 shape 이름 지정하기 (0) | 2024.03.19 |
LibTomCrypt를 이용한 AES – CFB 모드 복호화 테스트 (0) | 2024.03.19 |