15#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FUZZYMATCH_H
16#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FUZZYMATCH_H
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/SmallString.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/raw_ostream.h"
67 llvm::MutableArrayRef<CharRole> Roles);
80 std::optional<float>
match(llvm::StringRef Word);
82 llvm::StringRef
pattern()
const {
return llvm::StringRef(Pat, PatN); }
83 bool empty()
const {
return PatN == 0; }
88 llvm::SmallString<256>
dumpLast(llvm::raw_ostream &)
const;
92 constexpr static int MaxPat = 63, MaxWord = 127;
98 constexpr static Action Miss =
false;
99 constexpr static Action Match =
true;
101 bool init(llvm::StringRef Word);
103 bool allowMatch(
int P,
int W, Action Last)
const;
104 int skipPenalty(
int W, Action Last)
const;
105 int matchBonus(
int P,
int W, Action Last)
const;
118 char LowWord[MaxWord];
121 bool WordContainsPattern;
127 signed int Score : 15;
130 ScoreInfo Scores[MaxPat + 1][MaxWord + 1][ 2];
std::optional< float > Score
llvm::SmallString< 256 > dumpLast(llvm::raw_ostream &) const
std::optional< float > match(llvm::StringRef Word)
llvm::StringRef pattern() const
unsigned char CharTypeSet
CharTypeSet calculateRoles(llvm::StringRef Text, llvm::MutableArrayRef< CharRole > Roles)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//