lib/ununiga/josa_picker.rb in ununiga-1.0.4 vs lib/ununiga/josa_picker.rb in ununiga-1.0.5

- old
+ new

@@ -23,13 +23,16 @@ end def takewell korean_str.gsub josa_regexp do |matched| index = $~.offset(0)[0] - next if index == 0 - josa = JOSAS.find { |josa| josa_convension(josa).include? matched } - splitter = JasoSplitter.new(korean_str[index - 1]) - josa[(splitter.jongsung ? 0 : 1)] + if index == 0 + matched + else + josa = JOSAS.find { |josa| josa_convension(josa).include? matched } + splitter = JasoSplitter.new(korean_str[index - 1]) + josa[(splitter.jongsung ? 0 : 1)] + end end end def josas res = []