본문으로 바로가기

https://github.com/rapidfuzz/rapidfuzz-cpp

 

두 개의 스트링이 얼마나 유사한지 비교하는 라이브러리..

#include <rapidfuzz/fuzz.hpp>

int main(void)
{
	// 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")
    
    return 0;
}

 

 


Korea Tcl/Tk Community
블로그 이미지 ihmin 님의 블로그
VISITOR 오늘 / 전체