View | Details | Raw Unified | Return to bug 281534
Collapse All | Expand All

(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_details_SplittedSentenceView.hpp (+36 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/details/SplittedSentenceView.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/details/SplittedSentenceView.hpp
3
@@ -34,7 +34,7 @@ class SplittedSentenceView { (public)
4
         return m_sentence.size();
5
     }
6
 
7
-    std::basic_string<CharT> join() const;
8
+    std::vector<CharT> join() const;
9
 
10
     const RangeVec<InputIt>& words() const
11
     {
12
@@ -68,19 +68,19 @@ template <typename InputIt>
13
 }
14
 
15
 template <typename InputIt>
16
-auto SplittedSentenceView<InputIt>::join() const -> std::basic_string<CharT>
17
+auto SplittedSentenceView<InputIt>::join() const -> std::vector<CharT>
18
 {
19
     if (m_sentence.empty()) {
20
-        return std::basic_string<CharT>();
21
+        return std::vector<CharT>();
22
     }
23
 
24
     auto sentence_iter = m_sentence.begin();
25
-    std::basic_string<CharT> joined(sentence_iter->begin(), sentence_iter->end());
26
-    const std::basic_string<CharT> whitespace{0x20};
27
+    std::vector<CharT> joined(sentence_iter->begin(), sentence_iter->end());
28
+    const std::vector<CharT> whitespace{0x20};
29
     ++sentence_iter;
30
     for (; sentence_iter != m_sentence.end(); ++sentence_iter) {
31
         joined.append(whitespace)
32
-            .append(std::basic_string<CharT>(sentence_iter->begin(), sentence_iter->end()));
33
+            .append(std::vector<CharT>(sentence_iter->begin(), sentence_iter->end()));
34
     }
35
     return joined;
36
 }
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance.hpp (+53 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance.hpp
3
@@ -16,13 +16,13 @@ template <typename CharT, typename InputIt1, typename 
4
 namespace rapidfuzz {
5
 
6
 template <typename CharT, typename InputIt1, typename InputIt2>
7
-std::basic_string<CharT> editops_apply(const Editops& ops, InputIt1 first1, InputIt1 last1, InputIt2 first2,
8
-                                       InputIt2 last2)
9
+std::vector<CharT> editops_apply(const Editops& ops, InputIt1 first1, InputIt1 last1, InputIt2 first2,
10
+                                 InputIt2 last2)
11
 {
12
     auto len1 = static_cast<size_t>(std::distance(first1, last1));
13
     auto len2 = static_cast<size_t>(std::distance(first2, last2));
14
 
15
-    std::basic_string<CharT> res_str;
16
+    std::vector<CharT> res_str;
17
     res_str.resize(len1 + len2);
18
     size_t src_pos = 0;
19
     size_t dest_pos = 0;
20
@@ -62,20 +62,20 @@ template <typename CharT, typename Sentence1, typename
21
 }
22
 
23
 template <typename CharT, typename Sentence1, typename Sentence2>
24
-std::basic_string<CharT> editops_apply(const Editops& ops, const Sentence1& s1, const Sentence2& s2)
25
+std::vector<CharT> editops_apply(const Editops& ops, const Sentence1& s1, const Sentence2& s2)
26
 {
27
     return editops_apply<CharT>(ops, detail::to_begin(s1), detail::to_end(s1), detail::to_begin(s2),
28
                                 detail::to_end(s2));
29
 }
30
 
31
 template <typename CharT, typename InputIt1, typename InputIt2>
32
-std::basic_string<CharT> opcodes_apply(const Opcodes& ops, InputIt1 first1, InputIt1 last1, InputIt2 first2,
33
-                                       InputIt2 last2)
34
+std::vector<CharT> opcodes_apply(const Opcodes& ops, InputIt1 first1, InputIt1 last1, InputIt2 first2,
35
+                                 InputIt2 last2)
36
 {
37
     auto len1 = static_cast<size_t>(std::distance(first1, last1));
38
     auto len2 = static_cast<size_t>(std::distance(first2, last2));
39
 
40
-    std::basic_string<CharT> res_str;
41
+    std::vector<CharT> res_str;
42
     res_str.resize(len1 + len2);
43
     size_t dest_pos = 0;
44
 
45
@@ -101,7 +101,7 @@ template <typename CharT, typename Sentence1, typename
46
 }
47
 
48
 template <typename CharT, typename Sentence1, typename Sentence2>
49
-std::basic_string<CharT> opcodes_apply(const Opcodes& ops, const Sentence1& s1, const Sentence2& s2)
50
+std::vector<CharT> opcodes_apply(const Opcodes& ops, const Sentence1& s1, const Sentence2& s2)
51
 {
52
     return opcodes_apply<CharT>(ops, detail::to_begin(s1), detail::to_end(s1), detail::to_begin(s2),
53
                                 detail::to_end(s2));
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_DamerauLevenshtein.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/DamerauLevenshtein.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/DamerauLevenshtein.hpp
3
@@ -140,7 +140,7 @@ struct CachedDamerauLevenshtein : public detail::Cache
4
         return damerau_levenshtein_distance(s1, s2, score_cutoff);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
 };
10
 
11
 template <typename Sentence1>
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_Hamming.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/Hamming.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/Hamming.hpp
3
@@ -159,7 +159,7 @@ struct CachedHamming : public detail::CachedDistanceBa
4
         return detail::Hamming::distance(s1, s2, pad, score_cutoff, score_hint);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     bool pad;
10
 };
11
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_Jaro.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/Jaro.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/Jaro.hpp
3
@@ -88,7 +88,7 @@ struct CachedJaro : public detail::CachedSimilarityBas
4
         return detail::jaro_similarity(PM, detail::Range(s1), s2, score_cutoff);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     detail::BlockPatternMatchVector PM;
10
 };
11
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_JaroWinkler.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/JaroWinkler.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/JaroWinkler.hpp
3
@@ -103,7 +103,7 @@ struct CachedJaroWinkler : public detail::CachedSimila
4
     }
5
 
6
     double prefix_weight;
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     detail::BlockPatternMatchVector PM;
10
 };
11
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_LCSseq.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/LCSseq.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/LCSseq.hpp
3
@@ -224,7 +224,7 @@ struct CachedLCSseq (private)
4
         return detail::lcs_seq_similarity(PM, detail::Range(s1), s2, score_cutoff);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     detail::BlockPatternMatchVector PM;
10
 };
11
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_Levenshtein.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/Levenshtein.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/Levenshtein.hpp
3
@@ -476,7 +476,7 @@ struct CachedLevenshtein : public detail::CachedDistan
4
         return detail::generalized_levenshtein_distance(detail::Range(s1), s2, weights, score_cutoff);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     detail::BlockPatternMatchVector PM;
10
     LevenshteinWeightTable weights;
11
 };
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_OSA.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/OSA.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/OSA.hpp
3
@@ -267,7 +267,7 @@ struct CachedOSA (private)
4
         return (res <= score_cutoff) ? res : score_cutoff + 1;
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     detail::BlockPatternMatchVector PM;
10
 };
11
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_Postfix.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/Postfix.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/Postfix.hpp
3
@@ -91,7 +91,7 @@ struct CachedPostfix : public detail::CachedSimilarity
4
         return detail::Postfix::similarity(s1, s2, score_cutoff, score_hint);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
 };
10
 
11
 template <typename Sentence1>
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_distance_Prefix.hpp (+11 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/distance/Prefix.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/distance/Prefix.hpp
3
@@ -91,7 +91,7 @@ struct CachedPrefix : public detail::CachedSimilarityB
4
         return detail::Prefix::similarity(s1, s2, score_cutoff, score_cutoff);
5
     }
6
 
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
 };
10
 
11
 template <typename Sentence1>
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_fuzz.hpp (+100 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/fuzz.hpp.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/fuzz.hpp
3
@@ -186,7 +186,7 @@ struct CachedPartialRatio { (private)
4
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
5
 
6
 private:
7
-    std::basic_string<CharT1> s1;
8
+    std::vector<CharT1> s1;
9
     rapidfuzz::detail::CharSet<CharT1> s1_char_set;
10
     CachedRatio<CharT1> cached_ratio;
11
 };
12
@@ -296,7 +296,7 @@ struct CachedTokenSortRatio { (private)
13
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
14
 
15
 private:
16
-    std::basic_string<CharT1> s1_sorted;
17
+    std::vector<CharT1> s1_sorted;
18
     CachedRatio<CharT1> cached_ratio;
19
 };
20
 
21
@@ -354,7 +354,7 @@ struct CachedPartialTokenSortRatio { (private)
22
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
23
 
24
 private:
25
-    std::basic_string<CharT1> s1_sorted;
26
+    std::vector<CharT1> s1_sorted;
27
     CachedPartialRatio<CharT1> cached_partial_ratio;
28
 };
29
 
30
@@ -422,8 +422,8 @@ struct CachedTokenSetRatio { (private)
31
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
32
 
33
 private:
34
-    std::basic_string<CharT1> s1;
35
-    detail::SplittedSentenceView<typename std::basic_string<CharT1>::iterator> tokens_s1;
36
+    std::vector<CharT1> s1;
37
+    detail::SplittedSentenceView<typename std::vector<CharT1>::iterator> tokens_s1;
38
 };
39
 
40
 template <typename Sentence1>
41
@@ -479,8 +479,8 @@ struct CachedPartialTokenSetRatio { (private)
42
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
43
 
44
 private:
45
-    std::basic_string<CharT1> s1;
46
-    detail::SplittedSentenceView<typename std::basic_string<CharT1>::iterator> tokens_s1;
47
+    std::vector<CharT1> s1;
48
+    detail::SplittedSentenceView<typename std::vector<CharT1>::iterator> tokens_s1;
49
 };
50
 
51
 template <typename Sentence1>
52
@@ -539,9 +539,9 @@ struct CachedTokenRatio { (private)
53
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
54
 
55
 private:
56
-    std::basic_string<CharT1> s1;
57
-    detail::SplittedSentenceView<typename std::basic_string<CharT1>::iterator> s1_tokens;
58
-    std::basic_string<CharT1> s1_sorted;
59
+    std::vector<CharT1> s1;
60
+    detail::SplittedSentenceView<typename std::vector<CharT1>::iterator> s1_tokens;
61
+    std::vector<CharT1> s1_sorted;
62
     CachedRatio<CharT1> cached_ratio_s1_sorted;
63
 };
64
 
65
@@ -601,9 +601,9 @@ struct CachedPartialTokenRatio { (private)
66
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
67
 
68
 private:
69
-    std::basic_string<CharT1> s1;
70
-    detail::SplittedSentenceView<typename std::basic_string<CharT1>::iterator> tokens_s1;
71
-    std::basic_string<CharT1> s1_sorted;
72
+    std::vector<CharT1> s1;
73
+    detail::SplittedSentenceView<typename std::vector<CharT1>::iterator> tokens_s1;
74
+    std::vector<CharT1> s1_sorted;
75
 };
76
 
77
 template <typename Sentence1>
78
@@ -659,10 +659,10 @@ struct CachedWRatio { (private)
79
 private:
80
     // todo somehow implement this using other ratios with creating PatternMatchVector
81
     // multiple times
82
-    std::basic_string<CharT1> s1;
83
+    std::vector<CharT1> s1;
84
     CachedPartialRatio<CharT1> cached_partial_ratio;
85
-    detail::SplittedSentenceView<typename std::basic_string<CharT1>::iterator> tokens_s1;
86
-    std::basic_string<CharT1> s1_sorted;
87
+    detail::SplittedSentenceView<typename std::vector<CharT1>::iterator> tokens_s1;
88
+    std::vector<CharT1> s1_sorted;
89
     rapidfuzz::detail::BlockPatternMatchVector blockmap_s1_sorted;
90
 };
91
 
92
@@ -774,7 +774,7 @@ struct CachedQRatio { (private)
93
     double similarity(const Sentence2& s2, double score_cutoff = 0.0, double score_hint = 0.0) const;
94
 
95
 private:
96
-    std::basic_string<CharT1> s1;
97
+    std::vector<CharT1> s1;
98
     CachedRatio<CharT1> cached_ratio;
99
 };
100
 
(-)b/devel/py-Levenshtein/files/patch-extern_rapidfuzz-cpp_rapidfuzz_fuzz.impl (+20 lines)
Added Link Here
1
--- extern/rapidfuzz-cpp/rapidfuzz/fuzz.impl.orig	2023-09-26 11:15:29 UTC
2
+++ extern/rapidfuzz-cpp/rapidfuzz/fuzz.impl
3
@@ -613,7 +613,7 @@ template <typename CharT1, typename InputIt1, typename
4
 
5
 // todo this is a temporary solution until WRatio is properly implemented using other scorers
6
 template <typename CharT1, typename InputIt1, typename InputIt2>
7
-double token_ratio(const std::basic_string<CharT1>& s1_sorted,
8
+double token_ratio(const std::vector<CharT1>& s1_sorted,
9
                    const rapidfuzz::detail::SplittedSentenceView<InputIt1>& tokens_s1,
10
                    const detail::BlockPatternMatchVector& blockmap_s1_sorted, InputIt2 first2, InputIt2 last2,
11
                    double score_cutoff)
12
@@ -729,7 +729,7 @@ template <typename CharT1, typename InputIt1, typename
13
 
14
 namespace fuzz_detail {
15
 template <typename CharT1, typename InputIt1, typename InputIt2>
16
-double partial_token_ratio(const std::basic_string<CharT1>& s1_sorted,
17
+double partial_token_ratio(const std::vector<CharT1>& s1_sorted,
18
                            const rapidfuzz::detail::SplittedSentenceView<InputIt1>& tokens_s1,
19
                            InputIt2 first2, InputIt2 last2, double score_cutoff)
20
 {
(-)b/devel/py-Levenshtein/files/patch-src_Levenshtein_Levenshtein-c___levenshtein.cpp (+16 lines)
Added Link Here
1
--- src/Levenshtein/Levenshtein-c/_levenshtein.cpp.orig	2023-09-26 11:15:28 UTC
2
+++ src/Levenshtein/Levenshtein-c/_levenshtein.cpp
3
@@ -119,10 +119,10 @@ class SymMap { (public)
4
     }
5
 };
6
 
7
-std::basic_string<uint32_t> lev_quick_median(const std::vector<RF_String>& strings,
8
-                                             const std::vector<double>& weights)
9
+std::vector<uint32_t> lev_quick_median(const std::vector<RF_String>& strings,
10
+                                       const std::vector<double>& weights)
11
 {
12
-    std::basic_string<uint32_t> median; /* the resulting string */
13
+    std::vector<uint32_t> median; /* the resulting string */
14
 
15
     /* first check whether the result would be an empty string
16
      * and compute resulting string length */
(-)b/devel/py-Levenshtein/files/patch-src_Levenshtein_Levenshtein-c___levenshtein.hpp (+69 lines)
Added Link Here
1
--- src/Levenshtein/Levenshtein-c/_levenshtein.hpp.orig	2023-09-26 11:15:28 UTC
2
+++ src/Levenshtein/Levenshtein-c/_levenshtein.hpp
3
@@ -141,10 +141,10 @@ static inline std::vector<uint32_t> make_symlist(const
4
  * Returns: The generalized median, as a newly allocated string; its length
5
  *          is stored in @medlength.
6
  **/
7
-static inline std::basic_string<uint32_t> lev_greedy_median(const std::vector<RF_String>& strings,
8
-                                                            const std::vector<double>& weights)
9
+static inline std::vector<uint32_t> lev_greedy_median(const std::vector<RF_String>& strings,
10
+                                                      const std::vector<double>& weights)
11
 {
12
-    std::basic_string<uint32_t> result_median;
13
+    std::vector<uint32_t> result_median;
14
 
15
     /* find all symbols */
16
     std::vector<uint32_t> symlist = make_symlist(strings);
17
@@ -335,13 +335,13 @@ static inline double finish_distance_computations(cons
18
  *
19
  * Returns: The improved generalized median
20
  **/
21
-static inline std::basic_string<uint32_t> lev_median_improve(const RF_String& string,
22
-                                                             const std::vector<RF_String>& strings,
23
-                                                             const std::vector<double>& weights)
24
+static inline std::vector<uint32_t> lev_median_improve(const RF_String& string,
25
+                                                       const std::vector<RF_String>& strings,
26
+                                                       const std::vector<double>& weights)
27
 {
28
     /* find all symbols */
29
     std::vector<uint32_t> symlist = make_symlist(strings);
30
-    if (symlist.empty()) return std::basic_string<uint32_t>();
31
+    if (symlist.empty()) return std::vector<uint32_t>();
32
 
33
     /* allocate and initialize per-string matrix rows and a common work buffer */
34
     std::vector<std::unique_ptr<size_t[]>> rows(strings.size());
35
@@ -459,11 +459,11 @@ static inline std::basic_string<uint32_t> lev_median_i
36
         }
37
     }
38
 
39
-    return std::basic_string<uint32_t>(median, medlen);
40
+    return std::vector<uint32_t>(median, median + medlen);
41
 }
42
 
43
-std::basic_string<uint32_t> lev_quick_median(const std::vector<RF_String>& strings,
44
-                                             const std::vector<double>& weights);
45
+std::vector<uint32_t> lev_quick_median(const std::vector<RF_String>& strings,
46
+                                       const std::vector<double>& weights);
47
 
48
 /**
49
  * lev_set_median:
50
@@ -477,8 +477,8 @@ std::basic_string<uint32_t> lev_quick_median(const std
51
  *
52
  * Returns: The set median
53
  **/
54
-static inline std::basic_string<uint32_t> lev_set_median(const std::vector<RF_String>& strings,
55
-                                                         const std::vector<double>& weights)
56
+static inline std::vector<uint32_t> lev_set_median(const std::vector<RF_String>& strings,
57
+                                                   const std::vector<double>& weights)
58
 {
59
     size_t minidx = 0;
60
     double mindist = std::numeric_limits<double>::max();
61
@@ -521,7 +521,7 @@ static inline std::basic_string<uint32_t> lev_set_medi
62
     }
63
 
64
     return visit(strings[minidx], [&](auto s1) {
65
-        return std::basic_string<uint32_t>(std::begin(s1), std::end(s1));
66
+        return std::vector<uint32_t>(std::begin(s1), std::end(s1));
67
     });
68
 }
69
 
(-)b/devel/py-Levenshtein/files/patch-src_Levenshtein_levenshtein__cpp.cxx (+74 lines)
Added Link Here
1
--- src/Levenshtein/levenshtein_cpp.cxx.orig	2023-09-26 11:15:40 UTC
2
+++ src/Levenshtein/levenshtein_cpp.cxx
3
@@ -3094,7 +3094,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
4
 static PyObject *__pyx_pf_11Levenshtein_15levenshtein_cpp_median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_strlist, PyObject *__pyx_v_wlist) {
5
   std::vector<double>  __pyx_v_weights;
6
   std::vector<RF_String>  __pyx_v_strings;
7
-  std::basic_string<uint32_t>  __pyx_v_median;
8
+  std::vector<uint32_t>  __pyx_v_median;
9
   PyObject *__pyx_r = NULL;
10
   __Pyx_RefNannyDeclarations
11
   int __pyx_t_1;
12
@@ -3104,7 +3104,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
13
   PyObject *__pyx_t_5 = NULL;
14
   std::vector<double>  __pyx_t_6;
15
   std::vector<RF_String>  __pyx_t_7;
16
-  std::basic_string<uint32_t>  __pyx_t_8;
17
+  std::vector<uint32_t>  __pyx_t_8;
18
   int __pyx_lineno = 0;
19
   const char *__pyx_filename = NULL;
20
   int __pyx_clineno = 0;
21
@@ -3345,7 +3345,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
22
 static PyObject *__pyx_pf_11Levenshtein_15levenshtein_cpp_2quickmedian(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_strlist, PyObject *__pyx_v_wlist) {
23
   std::vector<double>  __pyx_v_weights;
24
   std::vector<RF_String>  __pyx_v_strings;
25
-  std::basic_string<uint32_t>  __pyx_v_median;
26
+  std::vector<uint32_t>  __pyx_v_median;
27
   PyObject *__pyx_r = NULL;
28
   __Pyx_RefNannyDeclarations
29
   int __pyx_t_1;
30
@@ -3355,7 +3355,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
31
   PyObject *__pyx_t_5 = NULL;
32
   std::vector<double>  __pyx_t_6;
33
   std::vector<RF_String>  __pyx_t_7;
34
-  std::basic_string<uint32_t>  __pyx_t_8;
35
+  std::vector<uint32_t>  __pyx_t_8;
36
   int __pyx_lineno = 0;
37
   const char *__pyx_filename = NULL;
38
   int __pyx_clineno = 0;
39
@@ -3612,7 +3612,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
40
   std::vector<double>  __pyx_v_weights;
41
   RF_String __pyx_v_query;
42
   std::vector<RF_String>  __pyx_v_strings;
43
-  std::basic_string<uint32_t>  __pyx_v_median;
44
+  std::vector<uint32_t>  __pyx_v_median;
45
   PyObject *__pyx_r = NULL;
46
   __Pyx_RefNannyDeclarations
47
   int __pyx_t_1;
48
@@ -3623,7 +3623,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
49
   std::vector<double>  __pyx_t_6;
50
   RF_String __pyx_t_7;
51
   std::vector<RF_String>  __pyx_t_8;
52
-  std::basic_string<uint32_t>  __pyx_t_9;
53
+  std::vector<uint32_t>  __pyx_t_9;
54
   int __pyx_lineno = 0;
55
   const char *__pyx_filename = NULL;
56
   int __pyx_clineno = 0;
57
@@ -3874,7 +3874,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
58
 static PyObject *__pyx_pf_11Levenshtein_15levenshtein_cpp_6setmedian(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_strlist, PyObject *__pyx_v_wlist) {
59
   std::vector<double>  __pyx_v_weights;
60
   std::vector<RF_String>  __pyx_v_strings;
61
-  std::basic_string<uint32_t>  __pyx_v_median;
62
+  std::vector<uint32_t>  __pyx_v_median;
63
   PyObject *__pyx_r = NULL;
64
   __Pyx_RefNannyDeclarations
65
   int __pyx_t_1;
66
@@ -3884,7 +3884,7 @@ static PyObject *__pyx_pf_11Levenshtein_15levenshtein_
67
   PyObject *__pyx_t_5 = NULL;
68
   std::vector<double>  __pyx_t_6;
69
   std::vector<RF_String>  __pyx_t_7;
70
-  std::basic_string<uint32_t>  __pyx_t_8;
71
+  std::vector<uint32_t>  __pyx_t_8;
72
   int __pyx_lineno = 0;
73
   const char *__pyx_filename = NULL;
74
   int __pyx_clineno = 0;
(-)b/devel/py-Levenshtein/files/patch-src_Levenshtein_levenshtein__cpp.pyx (+30 lines)
Added Link Here
1
--- src/Levenshtein/levenshtein_cpp.pyx.orig	2023-09-26 11:15:28 UTC
2
+++ src/Levenshtein/levenshtein_cpp.pyx
3
@@ -12,10 +12,10 @@ cdef extern from "<string>" namespace "std" nogil:
4
     object PyUnicode_FromKindAndData(int kind, const void *buffer, Py_ssize_t size)
5
 
6
 cdef extern from "<string>" namespace "std" nogil:
7
-    cdef cppclass basic_string[T]:
8
+    cdef cppclass vector[T]:
9
         ctypedef size_t size_type
10
 
11
-        basic_string() except +
12
+        vector() except +
13
 
14
         void resize(size_type) except +
15
 
16
@@ -25,10 +25,10 @@ cdef extern from "_levenshtein.hpp":
17
         size_type size()
18
 
19
 cdef extern from "_levenshtein.hpp":
20
-    cdef basic_string[uint32_t] lev_greedy_median(const vector[RF_String]& strings, const vector[double]& weights) except +
21
-    cdef basic_string[uint32_t] lev_median_improve(const RF_String& string, const vector[RF_String]& strings, const vector[double]& weights) except +
22
-    cdef basic_string[uint32_t] lev_quick_median(const vector[RF_String]& strings, const vector[double]& weights) except +
23
-    cdef basic_string[uint32_t] lev_set_median(const vector[RF_String]& strings, const vector[double]& weights) except +
24
+    cdef vector[uint32_t] lev_greedy_median(const vector[RF_String]& strings, const vector[double]& weights) except +
25
+    cdef vector[uint32_t] lev_median_improve(const RF_String& string, const vector[RF_String]& strings, const vector[double]& weights) except +
26
+    cdef vector[uint32_t] lev_quick_median(const vector[RF_String]& strings, const vector[double]& weights) except +
27
+    cdef vector[uint32_t] lev_set_median(const vector[RF_String]& strings, const vector[double]& weights) except +
28
 
29
     cdef double lev_set_distance(const vector[RF_String]& strings1, const vector[RF_String]& strings2) except +
30
     cdef double lev_edit_seq_distance(const vector[RF_String]& strings1, const vector[RF_String]& strings2) except +

Return to bug 281534