Documentation ¶
Index ¶
Constants ¶
View Source
const ( NumberMatchedString = "number" PositiveNumberMatchedString = "positive_number" AnyMatchedString = "any" FirstWordMatchedString = "first_word" PositiveNumberInWordsMatchedString = "positive_number_in_words" )
View Source
const (
AgreeMatchedString = "Точно!"
)
Variables ¶
View Source
var ( NumberMatcher = NewRegexMather(`[\-]{0,1}[0-9]+[\.][0-9]+|[\-]{0,1}[0-9]+`, NumberMatchedString) PositiveNumberMatcher = NewRegexMather( `^\+?(0*[1-9]\d*(?:[\., ]\d+)*) *(?:\p{Sc}|°[FC])?$`, PositiveNumberMatchedString, ) AnyMatcher = NewRegexMather(`.*`, AnyMatchedString) FirstWordMatcher = NewRegexMather(`[^\s]+`, FirstWordMatchedString) )
View Source
var ( PositiveNumberError = scene.BaseTextError{ Message: positiveNumberErrorString, } NumberError = scene.BaseTextError{ Message: numberErrorString, } )
View Source
var Agree = NewSelectorMatcher( []string{ "Точно", "Согласен", "Да", "Ага", }, AgreeMatchedString, )
View Source
var PositiveNumberInWordsMatcher = NumberMatchers{}
Functions ¶
This section is empty.
Types ¶
type NumberMatchers ¶
type NumberMatchers struct{}
func (NumberMatchers) GetMatchedName ¶
func (nm NumberMatchers) GetMatchedName() string
type RegexMatcher ¶
type RegexMatcher struct {
// contains filtered or unexported fields
}
func NewRegexMather ¶
func NewRegexMather(pattern, nameMatched string) *RegexMatcher
func (*RegexMatcher) GetMatchedName ¶
func (rm *RegexMatcher) GetMatchedName() string
type SelectorMatcher ¶
type SelectorMatcher struct {
// contains filtered or unexported fields
}
func NewSelectorMatcher ¶
func NewSelectorMatcher(variants []string, replaceMessage string) *SelectorMatcher
func (*SelectorMatcher) GetMatchedName ¶
func (sm *SelectorMatcher) GetMatchedName() string
Click to show internal directories.
Click to hide internal directories.