# File lib/mirimiri/ttagger.rb, line 34 def self.parse chunk_lines open = false tag = nil chunks = [] words = [] chunk_lines.each do |l| l.chomp! if l =~ /^<\w+>$/ open = true tag = l elsif l =~ /^<\/\w+>$/ if !words.empty? && open && l == tag.sub(/</, '</') open = false chunks.push Chunk.new(words.join(" "), tag) words.clear else next end else words.push(l.split.first) end end chunks end