AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxKeywords.h File Reference

clue words drawn in a warm colour (Guidance option, LuxGuidance.h). More...

#include <algorithm>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  cLuxTextSpan

Functions

bool LuxIsWordChar (wchar_t c)
wchar_t LuxFoldCase (wchar_t c)
bool LuxLongerFirst (const std::wstring &a, const std::wstring &b)
std::vector< std::wstring > LuxParseKeywords (const std::wstring &asList)
 "fuse box| winch |" -> {"fuse box", "winch"}, longest first.
size_t LuxKeywordMatchAt (const std::wstring &asText, size_t alPos, const std::wstring &asWord)
 Length of the keyword match at alPos (0: none).
std::vector< cLuxTextSpan > LuxKeywordSpans (const std::wstring &asText, const std::vector< std::wstring > &avKeywords)
 The text split into plain and keyword runs, in order, covering all of it.

Detailed Description

clue words drawn in a warm colour (Guidance option, LuxGuidance.h).

The list is a translatable string, AMFP2026/Keywords in the Enhanced lang file: words separated by "|". Latin words match whole words, any case, plural "s"/"es" included; CJK words match anywhere. The longest word wins ("fuse box" before "fuse"). Pure, unit tested in tests/cpp/test_keywords.cpp.

Definition in file LuxKeywords.h.

Function Documentation

◆ LuxIsWordChar()

bool LuxIsWordChar ( wchar_t c)
inline

Definition at line 21 of file LuxKeywords.h.

◆ LuxFoldCase()

wchar_t LuxFoldCase ( wchar_t c)
inline

Definition at line 27 of file LuxKeywords.h.

◆ LuxLongerFirst()

bool LuxLongerFirst ( const std::wstring & a,
const std::wstring & b )
inline

Definition at line 29 of file LuxKeywords.h.

◆ LuxParseKeywords()

std::vector< std::wstring > LuxParseKeywords ( const std::wstring & asList)
inline

"fuse box| winch |" -> {"fuse box", "winch"}, longest first.

Definition at line 32 of file LuxKeywords.h.

◆ LuxKeywordMatchAt()

size_t LuxKeywordMatchAt ( const std::wstring & asText,
size_t alPos,
const std::wstring & asWord )
inline

Length of the keyword match at alPos (0: none).

Definition at line 50 of file LuxKeywords.h.

◆ LuxKeywordSpans()

std::vector< cLuxTextSpan > LuxKeywordSpans ( const std::wstring & asText,
const std::vector< std::wstring > & avKeywords )
inline

The text split into plain and keyword runs, in order, covering all of it.

Definition at line 65 of file LuxKeywords.h.