Class: Kotoshu::Grammar::PatternMatchers::BaseMatcher
- Inherits:
-
Object
- Object
- Kotoshu::Grammar::PatternMatchers::BaseMatcher
- Defined in:
- lib/kotoshu/grammar/pattern_matchers/base_matcher.rb
Overview
Base class for pattern matchers.
Pattern matchers check token sequences against specific patterns defined in YAML configuration.
Direct Known Subclasses
DoubleNegativeMatcher, PhraseMatcher, PossessiveContextMatcher, PossessiveContractionMatcher, SentenceStartMatcher, VowelSoundMatcher, WordListMatcher
Instance Method Summary collapse
-
#initialize(pattern, exceptions = {}) ⇒ BaseMatcher
constructor
A new instance of BaseMatcher.
-
#match(_tokens, _rule) ⇒ Array<Hash>
Match tokens against the pattern.
Constructor Details
#initialize(pattern, exceptions = {}) ⇒ BaseMatcher
Returns a new instance of BaseMatcher.
11 12 13 14 |
# File 'lib/kotoshu/grammar/pattern_matchers/base_matcher.rb', line 11 def initialize(pattern, exceptions = {}) @pattern = pattern @exceptions = exceptions end |
Instance Method Details
#match(_tokens, _rule) ⇒ Array<Hash>
Match tokens against the pattern.
21 22 23 |
# File 'lib/kotoshu/grammar/pattern_matchers/base_matcher.rb', line 21 def match(_tokens, _rule) [] end |