Class: JLDrill::Deinflection::Rule
- Inherits:
-
Object
- Object
- JLDrill::Deinflection::Rule
- Defined in:
- lib/jldrill/model/DeinflectionRules.rb
Overview
Represents a deinflection rule. It contains the string that will be found in the original text, the text that will be used to replace the original text, and an index into the reason array.
Constant Summary collapse
- RULE_RE =
/^([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)/
Instance Attribute Summary collapse
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#replaceWith ⇒ Object
readonly
Returns the value of attribute replaceWith.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(original, replaceWith, reason) ⇒ Rule
constructor
A new instance of Rule.
- #to_s ⇒ Object
Constructor Details
#initialize(original, replaceWith, reason) ⇒ Rule
Returns a new instance of Rule.
37 38 39 40 41 |
# File 'lib/jldrill/model/DeinflectionRules.rb', line 37 def initialize(original, replaceWith, reason) @original = original @replaceWith = replaceWith @reason = reason end |
Instance Attribute Details
#original ⇒ Object (readonly)
Returns the value of attribute original.
33 34 35 |
# File 'lib/jldrill/model/DeinflectionRules.rb', line 33 def original @original end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
33 34 35 |
# File 'lib/jldrill/model/DeinflectionRules.rb', line 33 def reason @reason end |
#replaceWith ⇒ Object (readonly)
Returns the value of attribute replaceWith.
33 34 35 |
# File 'lib/jldrill/model/DeinflectionRules.rb', line 33 def replaceWith @replaceWith end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
51 52 53 |
# File 'lib/jldrill/model/DeinflectionRules.rb', line 51 def to_s @original + "\t" + @replaceWith + "\t" + reason end |