filter less than 3 dimensions
This commit is contained in:
@ -50,25 +50,29 @@ func makeMatcherByConig(insensitive bool, cfgs ...config.MatcherPredicate) match
|
||||
return m
|
||||
}
|
||||
|
||||
func (m *Matcher) Match(value string) MatchResult {
|
||||
func (m *Matcher) Match(value string) (r MatchResult, priority bool) {
|
||||
switch {
|
||||
case value == "Высота":
|
||||
priority = true
|
||||
fallthrough
|
||||
case m.height.Match(value):
|
||||
return MatchResultHeight
|
||||
return MatchResultHeight, priority
|
||||
case value == "Глубина":
|
||||
return MatchResultDepth
|
||||
priority = true
|
||||
return MatchResultDepth, priority
|
||||
case value == "Длина":
|
||||
priority = true
|
||||
fallthrough
|
||||
case m.length.Match(value):
|
||||
return MatchResultLength
|
||||
return MatchResultLength, priority
|
||||
case value == "Ширина":
|
||||
priority = true
|
||||
fallthrough
|
||||
case m.width.Match(value):
|
||||
return MatchResultWidth
|
||||
return MatchResultWidth, priority
|
||||
}
|
||||
|
||||
return MatchResultMiss
|
||||
return MatchResultMiss, false
|
||||
}
|
||||
|
||||
func (m *Matcher) GetRegisteredPatterns() map[string][]string {
|
||||
|
||||
Reference in New Issue
Block a user