class Kuromoji::Commands

Public Class Methods

new(args = [], options = {}, config = {}) click to toggle source
Calls superclass method
# File lib/kuromoji/commands.rb, line 13
def initialize(args = [], options = {}, config = {})
  super(args, options, config)
  @global_options = config[:shell].base.options
  @core = Kuromoji::Core.new(@global_options[:user_dictionary])
end

Public Instance Methods

all_features() click to toggle source
# File lib/kuromoji/commands.rb, line 26
def all_features
  sentence = STDIN.read
  puts Yajl::Encoder.encode(@core.tokenize(sentence))
end
reading() click to toggle source
# File lib/kuromoji/commands.rb, line 32
def reading
  sentence = STDIN.read
  puts Yajl::Encoder.encode(@core.reading(sentence))
end
tokenize() click to toggle source
# File lib/kuromoji/commands.rb, line 20
def tokenize
  sentence = STDIN.read
  puts Yajl::Encoder.encode(@core.tokenize_with_hash(sentence))
end