yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::anonymous_namespace{command_palette.cc} Namespace Reference

Functions

std::string ToLower (std::string_view text)
 
bool IsAlnum (char c)
 
bool IsWordStartAt (const std::string &text, size_t index)
 
std::vector< std::string > SplitWhitespace (const std::string &text)
 
int BestSubsequenceScore (const std::string &text, const std::string &query)
 
int ScoreSingle (const std::string &text, const std::string &query)
 
bool HasPanelWord (std::string_view name)
 
int FrecencyBoost (int usage_count, int64_t last_used_ms, int64_t now_ms)
 

Variables

constexpr int kScoreExact = 1000
 
constexpr int kScorePrefix = 800
 
constexpr int kScoreWordStartSubstring = 600
 
constexpr int kScoreSubstring = 400
 
constexpr int kScoreSubsequenceMax = kScoreSubstring - 1
 
constexpr int kCharBase = 2
 
constexpr int kCharWordStartBonus = 8
 
constexpr int kCharConsecutiveBonus = 4
 
constexpr const char * kShortcutsProviderId = "shortcuts"
 

Function Documentation

◆ ToLower()

std::string yaze::editor::anonymous_namespace{command_palette.cc}::ToLower ( std::string_view text)

Definition at line 45 of file command_palette.cc.

◆ IsAlnum()

bool yaze::editor::anonymous_namespace{command_palette.cc}::IsAlnum ( char c)

Definition at line 53 of file command_palette.cc.

References IsAlnum().

Referenced by HasPanelWord(), IsAlnum(), and IsWordStartAt().

Here is the call graph for this function:

◆ IsWordStartAt()

bool yaze::editor::anonymous_namespace{command_palette.cc}::IsWordStartAt ( const std::string & text,
size_t index )

Definition at line 57 of file command_palette.cc.

References IsAlnum(), and IsWordStartAt().

Referenced by BestSubsequenceScore(), IsWordStartAt(), and ScoreSingle().

Here is the call graph for this function:

◆ SplitWhitespace()

std::vector< std::string > yaze::editor::anonymous_namespace{command_palette.cc}::SplitWhitespace ( const std::string & text)

Definition at line 61 of file command_palette.cc.

References SplitWhitespace().

Referenced by SplitWhitespace().

Here is the call graph for this function:

◆ BestSubsequenceScore()

int yaze::editor::anonymous_namespace{command_palette.cc}::BestSubsequenceScore ( const std::string & text,
const std::string & query )

Definition at line 81 of file command_palette.cc.

References BestSubsequenceScore(), IsWordStartAt(), kCharBase, kCharConsecutiveBonus, kCharWordStartBonus, and yaze::editor::kNone.

Referenced by BestSubsequenceScore(), and ScoreSingle().

Here is the call graph for this function:

◆ ScoreSingle()

int yaze::editor::anonymous_namespace{command_palette.cc}::ScoreSingle ( const std::string & text,
const std::string & query )

Definition at line 121 of file command_palette.cc.

References BestSubsequenceScore(), IsWordStartAt(), kScoreExact, kScorePrefix, kScoreSubsequenceMax, kScoreSubstring, kScoreWordStartSubstring, and ScoreSingle().

Referenced by ScoreSingle().

Here is the call graph for this function:

◆ HasPanelWord()

bool yaze::editor::anonymous_namespace{command_palette.cc}::HasPanelWord ( std::string_view name)

Definition at line 144 of file command_palette.cc.

References HasPanelWord(), and IsAlnum().

Referenced by HasPanelWord().

Here is the call graph for this function:

◆ FrecencyBoost()

int yaze::editor::anonymous_namespace{command_palette.cc}::FrecencyBoost ( int usage_count,
int64_t last_used_ms,
int64_t now_ms )

Definition at line 159 of file command_palette.cc.

References FrecencyBoost().

Referenced by FrecencyBoost().

Here is the call graph for this function:

Variable Documentation

◆ kScoreExact

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kScoreExact = 1000
constexpr

Definition at line 28 of file command_palette.cc.

Referenced by ScoreSingle().

◆ kScorePrefix

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kScorePrefix = 800
constexpr

Definition at line 29 of file command_palette.cc.

Referenced by ScoreSingle().

◆ kScoreWordStartSubstring

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kScoreWordStartSubstring = 600
constexpr

Definition at line 30 of file command_palette.cc.

Referenced by ScoreSingle().

◆ kScoreSubstring

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kScoreSubstring = 400
constexpr

Definition at line 31 of file command_palette.cc.

Referenced by ScoreSingle().

◆ kScoreSubsequenceMax

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kScoreSubsequenceMax = kScoreSubstring - 1
constexpr

Definition at line 32 of file command_palette.cc.

Referenced by ScoreSingle().

◆ kCharBase

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kCharBase = 2
constexpr

Definition at line 37 of file command_palette.cc.

Referenced by BestSubsequenceScore().

◆ kCharWordStartBonus

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kCharWordStartBonus = 8
constexpr

Definition at line 38 of file command_palette.cc.

Referenced by BestSubsequenceScore().

◆ kCharConsecutiveBonus

constexpr int yaze::editor::anonymous_namespace{command_palette.cc}::kCharConsecutiveBonus = 4
constexpr

Definition at line 39 of file command_palette.cc.

Referenced by BestSubsequenceScore().

◆ kShortcutsProviderId

constexpr const char* yaze::editor::anonymous_namespace{command_palette.cc}::kShortcutsProviderId = "shortcuts"
constexpr

Definition at line 43 of file command_palette.cc.