clang-tools 20.0.0git
Classes | Namespaces | Functions
Trigram.h File Reference

Trigrams are attributes of the symbol unqualified name used to effectively extract symbols which can be fuzzy-matched given user query from the inverted index. More...

#include "index/dex/Token.h"
#include "llvm/ADT/bit.h"
#include <array>
#include <string>

Go to the source code of this file.

Classes

class  clang::clangd::dex::Trigram
 
struct  llvm::DenseMapInfo< clang::clangd::dex::Trigram >
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::clangd
 FIXME: Skip testing on windows temporarily due to the different escaping code mode.
 
namespace  clang::clangd::dex
 
namespace  llvm
 Some operations such as code completion produce a set of candidates.
 

Functions

void clang::clangd::dex::generateIdentifierTrigrams (llvm::StringRef Identifier, std::vector< Trigram > &Out)
 Produces list of unique fuzzy-search trigrams from unqualified symbol.
 
std::vector< Token > clang::clangd::dex::generateQueryTrigrams (llvm::StringRef Query)
 Returns list of unique fuzzy-search trigrams given a query.
 

Detailed Description

Trigrams are attributes of the symbol unqualified name used to effectively extract symbols which can be fuzzy-matched given user query from the inverted index.

To match query with the extracted set of trigrams Q, the set of generated trigrams T for identifier (unqualified symbol name) should contain all items of Q, i.e. Q ⊆ T.

Trigram sets extracted from unqualified name and from query are different: the set of query trigrams only contains consecutive sequences of three characters (which is only a subset of all trigrams generated for an identifier).

Definition in file Trigram.h.