Method: Narou.parse_replace_txt

Defined in:
lib/narou.rb

.parse_replace_txt(text) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/narou.rb', line 137

def parse_replace_txt(text)
  pattern = []
  text.each_line do |line|
    line.sub!(/[\r\n]+\z/, "")
    next if line[0] == ";"    # コメント記号
    pair = line.split("\t", 2)
    if pair.length == 2 && pair[0]
      pattern << pair
    end
  end
  pattern
end