Coverage Report

Created: 2025-10-13 06:12

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
40.3M
  {
14
40.3M
    int score;
15
40.3M
    assert(level > 0  && limit >= level);
16
41.2M
    do {
17
41.2M
      if (level == 2) {
18
21.3M
  score = limit2_edit_distance(a,b,w);
19
21.3M
      } else if (level < 5) {
20
18.7M
  score = limit_edit_distance(a,b,level,w);
21
18.7M
      } else {
22
1.21M
  score = edit_distance(a,b,w);
23
1.21M
      }
24
41.2M
      ++level;
25
41.2M
    } while (score >= LARGE_NUM && level <= limit);
26
40.3M
    return score;
27
40.3M
  }
28
}