def search(self, subsequence, sequence, max_l_dist):
     return [
         get_best_match_in_group(group) for group in group_matches(
             c_fnm_generic_lp(
                 subsequence, sequence,
                 LevenshteinSearchParams(max_l_dist, max_l_dist,
                                         max_l_dist, max_l_dist)))
     ]
 def search(self, pattern, sequence, max_subs, max_ins, max_dels,
            max_l_dist=None):
     return list(c_fnm_generic_lp(pattern,
                                  sequence,
                                  LevenshteinSearchParams(
                                      max_subs, max_ins,
                                      max_dels, max_l_dist,
                                  )))
 def search(self, subsequence, sequence, max_l_dist):
     return [
         get_best_match_in_group(group)
         for group in group_matches(
             c_fnm_generic_lp(subsequence,
                              sequence,
                              LevenshteinSearchParams(max_l_dist, max_l_dist, max_l_dist, max_l_dist))
         )
     ]
Exemplo n.º 4
0
 def find_near_matches_generic_linear_programming(subsequence, sequence,
                                                  search_params):
     try:
         for match in c_fnm_generic_lp(subsequence, sequence,
                                       search_params):
             yield match
     except (TypeError, UnicodeEncodeError):
         for match in _find_near_matches_generic_linear_programming(
                 subsequence, sequence, search_params):
             yield match
Exemplo n.º 5
0
    def find_near_matches_generic_linear_programming(subsequence, sequence, search_params):
        if not (
            isinstance(subsequence, text_type) or
            isinstance(sequence, text_type)
        ):
            try:
                for match in c_fnm_generic_lp(subsequence, sequence, search_params):
                    yield match
            except TypeError:
                pass

        for match in _find_near_matches_generic_linear_programming(
                subsequence, sequence, search_params):
            yield match
 def search(self,
            pattern,
            sequence,
            max_subs,
            max_ins,
            max_dels,
            max_l_dist=None):
     return list(
         c_fnm_generic_lp(
             pattern, sequence,
             LevenshteinSearchParams(
                 max_subs,
                 max_ins,
                 max_dels,
                 max_l_dist,
             )))
 def search(self, subsequence, sequence, max_subs):
     return list(
         c_fnm_generic_lp(
             subsequence, sequence,
             LevenshteinSearchParams(max_subs, 0, 0, max_subs)))
 def search(self, subsequence, sequence, max_subs):
     return list(
         c_fnm_generic_lp(subsequence,
                          sequence,
                          LevenshteinSearchParams(max_subs, 0, 0, max_subs))
     )