class Diachronr::Rewrite
rules for rewriting character variations and digraphs
Attributes
from[RW]
to[RW]
Public Class Methods
new(rewrite)
click to toggle source
# File lib/diachronr/rewrite.rb, line 8 def initialize(rewrite) @from, @to = rewrite.split '|' end
Public Instance Methods
apply(target)
click to toggle source
# File lib/diachronr/rewrite.rb, line 12 def apply(target) target.gsub @from, @to end
reverse(target)
click to toggle source
# File lib/diachronr/rewrite.rb, line 16 def reverse(target) target.gsub @to, @from end