Class: JLDrill::Deinflection::Transform

Inherits:
Object
  • Object
show all
Defined in:
lib/jldrill/model/DeinflectionRules.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orig, root, rule) ⇒ Transform

Returns a new instance of Transform.



60
61
62
63
64
# File 'lib/jldrill/model/DeinflectionRules.rb', line 60

def initialize(orig, root, rule)
    @orignal = orig
    @root = root
    @rule = rule
end

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



58
59
60
# File 'lib/jldrill/model/DeinflectionRules.rb', line 58

def original
  @original
end

#rootObject (readonly)

Returns the value of attribute root.



58
59
60
# File 'lib/jldrill/model/DeinflectionRules.rb', line 58

def root
  @root
end

#ruleObject (readonly)

Returns the value of attribute rule.



58
59
60
# File 'lib/jldrill/model/DeinflectionRules.rb', line 58

def rule
  @rule
end

Class Method Details

.start(string) ⇒ Object



66
67
68
# File 'lib/jldrill/model/DeinflectionRules.rb', line 66

def Transform.start(string)
    Transform.new(string, string, nil)
end

Instance Method Details

#dictionaryObject



70
71
72
73
74
75
76
# File 'lib/jldrill/model/DeinflectionRules.rb', line 70

def dictionary
    retVal = @root
    if !@rule.nil?
        retVal = @root + @rule.replaceWith
    end
    return retVal
end

#to_sObject



78
79
80
# File 'lib/jldrill/model/DeinflectionRules.rb', line 78

def to_s
    @orignal + " " + @root + " " + @rule.to_s
end