Skip to content

Commit

Permalink
fix assert leading to compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Mar 3, 2024
1 parent 03e2dfe commit f046c36
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

## [3.0.2] - 2023-03-
### Fixed
- fix assert leading to compilation failures

## [3.0.1] - 2023-03-03
### Fixed
- fix doxygen warnings
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()

project(rapidfuzz LANGUAGES CXX VERSION 3.0.1)
project(rapidfuzz LANGUAGES CXX VERSION 3.0.2)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(GNUInstallDirs)
Expand Down
64 changes: 32 additions & 32 deletions extras/rapidfuzz_amalgamated.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// RapidFuzz v1.0.2
// Generated: 2023-12-25 16:10:46.428949
// Generated: 2024-03-04 00:51:20.496561
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
Expand Down Expand Up @@ -6820,7 +6820,7 @@ size_t levenshtein_mbleven2018(const Range<InputIt1>& s1, const Range<InputIt2>&
assert(len1 > 0);
assert(len2 > 0);
assert(*s1.begin() != *s2.begin());
assert(*(--s1.end()) != *(--s2.end()));
assert(*(s1.end() - 1) != *(s2.end() - 1));

if (len1 < len2) return levenshtein_mbleven2018(s2, s1, max);

Expand Down Expand Up @@ -9326,12 +9326,12 @@ namespace rapidfuzz::fuzz {
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename InputIt1, typename InputIt2>
double ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0);

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

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

#ifdef RAPIDFUZZ_SIMD
namespace experimental {
template <int MaxLen>
Expand Down Expand Up @@ -9441,13 +9441,13 @@ ScoreAlignment<double> partial_ratio_alignment(const Sentence1& s1, const Senten
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double partial_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

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

// todo add real implementation
template <typename CharT1>
struct CachedPartialRatio {
Expand Down Expand Up @@ -9507,13 +9507,13 @@ CachedPartialRatio(InputIt1 first1, InputIt1 last1) -> CachedPartialRatio<iter_v
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

template <typename Sentence1, typename Sentence2>
double token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

#ifdef RAPIDFUZZ_SIMD
namespace experimental {
template <int MaxLen>
Expand Down Expand Up @@ -9610,13 +9610,13 @@ CachedTokenSortRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenSortRatio<it
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double partial_token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

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

// TODO documentation
template <typename CharT1>
struct CachedPartialTokenSortRatio {
Expand Down Expand Up @@ -9678,13 +9678,13 @@ CachedPartialTokenSortRatio(InputIt1 first1, InputIt1 last1)
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

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

// TODO documentation
template <typename CharT1>
struct CachedTokenSetRatio {
Expand Down Expand Up @@ -9735,13 +9735,13 @@ CachedTokenSetRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenSetRatio<iter
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double partial_token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

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

// TODO documentation
template <typename CharT1>
struct CachedPartialTokenSetRatio {
Expand Down Expand Up @@ -9793,12 +9793,12 @@ CachedPartialTokenSetRatio(InputIt1 first1, InputIt1 last1)
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename InputIt1, typename InputIt2>
double token_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0);

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

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

// todo add real implementation
template <typename CharT1>
struct CachedTokenRatio {
Expand Down Expand Up @@ -9855,13 +9855,13 @@ CachedTokenRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenRatio<iter_value
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename Sentence1, typename Sentence2>
double partial_token_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0);

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

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

// todo add real implementation
template <typename CharT1>
struct CachedPartialTokenRatio {
Expand Down Expand Up @@ -9917,12 +9917,12 @@ CachedPartialTokenRatio(InputIt1 first1, InputIt1 last1) -> CachedPartialTokenRa
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename InputIt1, typename InputIt2>
double WRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0);

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

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

// todo add real implementation
template <typename CharT1>
struct CachedWRatio {
Expand Down Expand Up @@ -9977,12 +9977,12 @@ CachedWRatio(InputIt1 first1, InputIt1 last1) -> CachedWRatio<iter_value_t<Input
*
* @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff
*/
template <typename InputIt1, typename InputIt2>
double QRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0);

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

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

#ifdef RAPIDFUZZ_SIMD
namespace experimental {
template <int MaxLen>
Expand Down
2 changes: 1 addition & 1 deletion rapidfuzz/distance/Levenshtein_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ size_t levenshtein_mbleven2018(const Range<InputIt1>& s1, const Range<InputIt2>&
assert(len1 > 0);
assert(len2 > 0);
assert(*s1.begin() != *s2.begin());
assert(*(--s1.end()) != *(--s2.end()));
assert(*(s1.end() - 1) != *(s2.end() - 1));

if (len1 < len2) return levenshtein_mbleven2018(s2, s1, max);

Expand Down

0 comments on commit f046c36

Please sign in to comment.