class TypoGen::EndSameSound
Constants
- PATTERN_LIST
Public Class Methods
create(word)
click to toggle source
# File lib/typogen/end_same_sound.rb, line 14 def self.create(word) typo_list = [] PATTERN_LIST.each do |pattern| pattern.combination(2).each do |from, to| if word =~ /#{from}$/ typo_list << word.sub(/#{from}$/, to) elsif word =~ /#{to}$/ typo_list << word.sub(/#{to}$/, from) end end end typo_list end