ArcdpsExtension
 
Loading...
Searching...
No Matches
Fuzz

Classes

struct  rapidfuzz::fuzz::CachedRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedPartialRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedTokenSortRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedPartialTokenSortRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedTokenSetRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedPartialTokenSetRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedTokenRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedPartialTokenRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedWRatio< CharT1 >
 
struct  rapidfuzz::fuzz::CachedQRatio< CharT1 >
 

Functions

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 calculates a simple ratio between two strings
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 calculates the fuzz::ratio of the optimal string alignment
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_sort_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Sorts the words in the strings and calculates the fuzz::ratio between them.
 
template<typename Sentence1 , typename Sentence2 , typename CharT1 = char_type<Sentence1>, typename CharT2 = char_type<Sentence2>>
double rapidfuzz::fuzz::token_sort_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_sort_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Sorts the words in the strings and calculates the fuzz::partial_ratio between them.
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_sort_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_set_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Compares the words in the strings based on unique and common words between them using fuzz::ratio.
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::token_set_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_set_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Compares the words in the strings based on unique and common words between them using fuzz::partial_ratio.
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_set_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Helper method that returns the maximum of fuzz::token_set_ratio and fuzz::token_sort_ratio (faster than manually executing the two functions)
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::token_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_ratio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Helper method that returns the maximum of fuzz::partial_token_set_ratio and fuzz::partial_token_sort_ratio (faster than manually executing the two functions)
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_ratio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::WRatio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Calculates a weighted ratio based on the other ratio algorithms.
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::WRatio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 
template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::QRatio (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
 Calculates a quick ratio between two strings using fuzz.ratio.
 
template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::QRatio (const Sentence1 &s1, const Sentence2 &s2, double score_cutoff=0)
 

Detailed Description

A collection of string matching algorithms from FuzzyWuzzy

Function Documentation

◆ partial_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ partial_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

calculates the fuzz::ratio of the optimal string alignment

test [hyrro_2004] [wagner_fischer_1974]

// score is 100
double score = partial_ratio("this is a test", "this is a test!")
double partial_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
calculates the fuzz::ratio of the optimal string alignment
Definition rapidfuzz_amalgamated.hpp:4535
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ partial_token_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ partial_token_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Helper method that returns the maximum of fuzz::partial_token_set_ratio and fuzz::partial_token_sort_ratio (faster than manually executing the two functions)

Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ partial_token_set_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_set_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ partial_token_set_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_set_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Compares the words in the strings based on unique and common words between them using fuzz::partial_ratio.

Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ partial_token_sort_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::partial_token_sort_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ partial_token_sort_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::partial_token_sort_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Sorts the words in the strings and calculates the fuzz::partial_ratio between them.

Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ QRatio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::QRatio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ QRatio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::QRatio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Calculates a quick ratio between two strings using fuzz.ratio.

Todo:
add a detailed description
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

calculates a simple ratio between two strings

// score is 96.55
double score = ratio("this is a test", "this is a test!")
double ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
calculates a simple ratio between two strings
Definition rapidfuzz_amalgamated.hpp:4383
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ token_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::token_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ token_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Helper method that returns the maximum of fuzz::token_set_ratio and fuzz::token_sort_ratio (faster than manually executing the two functions)

Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ token_set_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::token_set_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ token_set_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_set_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Compares the words in the strings based on unique and common words between them using fuzz::ratio.

// score1 is 83.87
double score1 = token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a
bear")
// score2 is 100
double score2 = token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
double token_sort_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
Sorts the words in the strings and calculates the fuzz::ratio between them.
Definition rapidfuzz_amalgamated.hpp:4603
double token_set_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff=0)
Compares the words in the strings based on unique and common words between them using fuzz::ratio.
Definition rapidfuzz_amalgamated.hpp:4721
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ token_sort_ratio() [1/2]

template<typename Sentence1 , typename Sentence2 , typename CharT1 = char_type<Sentence1>, typename CharT2 = char_type<Sentence2>>
double rapidfuzz::fuzz::token_sort_ratio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ token_sort_ratio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::token_sort_ratio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Sorts the words in the strings and calculates the fuzz::ratio between them.

// score is 100
double score = token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a
bear")
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff

◆ WRatio() [1/2]

template<typename Sentence1 , typename Sentence2 >
double rapidfuzz::fuzz::WRatio ( const Sentence1 &  s1,
const Sentence2 &  s2,
double  score_cutoff = 0 
)

◆ WRatio() [2/2]

template<typename InputIt1 , typename InputIt2 >
double rapidfuzz::fuzz::WRatio ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2,
double  score_cutoff = 0 
)

Calculates a weighted ratio based on the other ratio algorithms.

Todo:
add a detailed description
Template Parameters
Sentence1This is a string that can be converted to basic_string_view<char_type>
Sentence2This is a string that can be converted to basic_string_view<char_type>
Parameters
s1string to compare with s2 (for type info check Template parameters above)
s2string to compare with s1 (for type info check Template parameters above)
score_cutoffOptional argument for a score threshold between 0% and 100%. Matches with a lower score than this number will not be returned. Defaults to 0.
Returns
returns the ratio between s1 and s2 or 0 when ratio < score_cutoff