clang-tools  15.0.0git
Classes | Namespaces | Functions
Trigram.h File Reference
#include "index/dex/Token.h"
#include "llvm/ADT/bit.h"
#include <array>
#include <string>
Include dependency graph for Trigram.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


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


 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 Some operations such as code completion produce a set of candidates.


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

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.