Class: Kotoshu::Readers::PhonetTable::Rule
- Inherits:
-
Struct
- Object
- Struct
- Kotoshu::Readers::PhonetTable::Rule
- Defined in:
- lib/kotoshu/readers/aff_data.rb
Overview
Rule class for phonetic transformations.
Instance Attribute Summary collapse
-
#end ⇒ Boolean
Match at end.
-
#followup ⇒ Boolean
Follow-up rule.
-
#priority ⇒ Integer
Rule priority.
-
#replacement ⇒ String
Replacement string.
-
#search ⇒ Regexp
Search pattern.
-
#start ⇒ Boolean
Match at start.
Instance Method Summary collapse
-
#match?(word, pos) ⇒ Boolean
Check if rule matches at position.
Instance Attribute Details
#end ⇒ Boolean
Match at end
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def end @end end |
#followup ⇒ Boolean
Follow-up rule
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def followup @followup end |
#priority ⇒ Integer
Rule priority
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def priority @priority end |
#replacement ⇒ String
Replacement string
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def replacement @replacement end |
#search ⇒ Regexp
Search pattern
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def search @search end |
#start ⇒ Boolean
Match at start
301 302 303 |
# File 'lib/kotoshu/readers/aff_data.rb', line 301 def start @start end |
Instance Method Details
#match?(word, pos) ⇒ Boolean
Check if rule matches at position.
307 308 309 310 311 |
# File 'lib/kotoshu/readers/aff_data.rb', line 307 def match?(word, pos) return false if @start && pos > 0 return @search.match?(word, pos) if @end @search.match?(word, pos) end |