libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::StringMatcherTransliterateToken Class Reference

Matches like StringMatcherTransliterate and, in addition, matches the pattern's consecutive words against a consecutive run of the candidate's words, so a candidate whose name joins words with a separator is found by a pattern that spells those words apart (and the other way round). More...

#include <StringMatcher.h>

+ Inheritance diagram for osmscout::StringMatcherTransliterateToken:

Public Member Functions

Result Match (const std::string &text) const override
 
 StringMatcherTransliterateToken (const std::string &pattern)
 
- Public Member Functions inherited from osmscout::StringMatcher
virtual ~StringMatcher ()=default
 

Additional Inherited Members

- Public Types inherited from osmscout::StringMatcher
enum  Result { noMatch , partialMatch , match }
 

Detailed Description

Matches like StringMatcherTransliterate and, in addition, matches the pattern's consecutive words against a consecutive run of the candidate's words, so a candidate whose name joins words with a separator is found by a pattern that spells those words apart (and the other way round).

Separators are whitespace, comma, hyphen, slash, backslash and the en/em dash. Only a run of words that appears in the candidate in the same order as in the pattern matches; a pattern whose words are reordered, or interrupted by a candidate word the pattern does not carry, does not match by this rule. A run covering the whole candidate is reported as match, a run covering only part of it as partialMatch.

The transliterating substring match is evaluated first and its result is returned unchanged, so this matcher only adds matches; it never removes one and never reports a different quality for an existing match.

Constructor & Destructor Documentation

◆ StringMatcherTransliterateToken()

osmscout::StringMatcherTransliterateToken::StringMatcherTransliterateToken ( const std::string &  pattern)
explicit

Member Function Documentation

◆ Match()

StringMatcher::Result osmscout::StringMatcherTransliterateToken::Match ( const std::string &  text) const
overridevirtual

The documentation for this class was generated from the following files: