Coverage Report

Created: 2026-06-10 06:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/aspell/modules/speller/default/editdist2.hpp
Line
Count
Source
1
2
#include "leditdist.hpp"
3
#include "editdist.hpp"
4
5
#include <cassert>
6
7
namespace aspeller {
8
  inline int edit_distance(ParmString a, ParmString b, 
9
         int level, // starting level
10
         int limit, // maximum level
11
         const EditDistanceWeights & w 
12
         = EditDistanceWeights()) 
13
15.8M
  {
14
15.8M
    int score;
15
15.8M
    assert(level > 0  && limit >= level);
16
16.9M
    do {
17
16.9M
      if (level == 2) {
18
9.54M
  score = limit2_edit_distance(a,b,w);
19
9.54M
      } else if (level < 5) {
20
6.91M
  score = limit_edit_distance(a,b,level,w);
21
6.91M
      } else {
22
470k
  score = edit_distance(a,b,w);
23
470k
      }
24
16.9M
      ++level;
25
16.9M
    } while (score >= LARGE_NUM && level <= limit);
26
15.8M
    return score;
27
15.8M
  }
28
}