Nuspell
spellchecker
Public Types | Public Member Functions | List of all members
nuspell::Condition< CharT > Class Template Reference

Limited regular expression matching used in affix entries. More...

#include <structures.hxx>

Public Types

enum  Span_Type { NORMAL, DOT, ANY_OF, NONE_OF }
 
using StrT = std::basic_string< CharT >
 

Public Member Functions

 Condition (const StrT &condition)
 
 Condition (StrT &&condition)
 
auto match (const StrT &s, size_t pos=0, size_t len=StrT::npos) const -> bool
 Checks if provided string matched the condition. More...
 
auto match_prefix (const StrT &s) const
 
auto match_suffix (const StrT &s) const
 

Detailed Description

template<class CharT>
class nuspell::Condition< CharT >

Limited regular expression matching used in affix entries.

This implementation increases performance over the regex implementation in the standard library.

Member Enumeration Documentation

◆ Span_Type

template<class CharT >
enum nuspell::Condition::Span_Type
Enumerator
NORMAL 

normal character

DOT 

wildcard character

ANY_OF 

set of possible characters

NONE_OF 

set of excluding characters

Member Function Documentation

◆ match()

template<class CharT >
auto nuspell::Condition< CharT >::match ( const StrT &  s,
size_t  pos = 0,
size_t  len = StrT::npos 
) const -> bool

Checks if provided string matched the condition.

Parameters
sstring to check if it matches the condition.
posstart position for string, default is 0.
lenlength of string counting from the start position.
Returns
The valueof true when string matched condition.

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