Coverage Report

Created: 2026-01-25 07:13

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