Sha256: 238f289179851a465d7ba5151542c70dc629f475c18df45ba60e54ee04f8e02d

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

class MecabStandalone
  LD_LIBRARY_PATH = File.join( $LOAD_PATH.grep(/mecab\_standalone\-/).first, 'lib' )

  def self.reading(input, rcfile = "#{__dir__ }/etc/mecabrc", dic = "#{__dir__ }/lib/mecab/dic/ipadic/")    
    io = IO.popen({'LD_LIBRARY_PATH' => LD_LIBRARY_PATH}, 
      "echo \"#{input}\" | #{__dir__ }/bin/mecab -r #{rcfile} -d #{dic} -Oyomi")
    reading = io.read
    io.close
    reading
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mecab_standalone-0.1.1 lib/mecab_standalone.rb
mecab_standalone-0.1.0 lib/mecab_standalone.rb