struct Wakame::Options

Overview

Struct that represents a collection of options to pass to the Wakame::MeCab object.

Defined in:

wakame/options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(option_str : String) #

Creates a new options object with the given command-line style option arguments.

options = Wakame::Options.new("-F %pS%f[7]\\s -E \\0")
mecab = Wakame::MeCab.new(options)
puts mecab.parse("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。

def self.new(rcfile : String? = nil, dicdir : String? = nil, userdic : String? = nil, lattice_level : Int32? = nil, output_format_type : String? = nil, all_morphs : Bool? = nil, nbest : Int32? = nil, partial : Bool? = nil, marginal : Bool? = nil, max_grouping_size : Int32? = nil, node_format : String? = nil, unk_format : String? = nil, bos_format : String? = nil, eos_format : String? = nil, eon_format : String? = nil, unk_feature : String? = nil, input_buffer_size : Int32? = nil, allocate_sentence : Bool? = nil, theta : Float32? = nil, cost_factor : Int32? = nil) #

Creates a new object that represents a collection of the given option arguments to pass to the Wakame::MeCab object.

options = Wakame::Options.new(node_format: "%pS%f[7]\\s", eos_format: "\\0")
mecab = Wakame::MeCab.new(options)
puts mecab.parse("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。

Instance Method Detail

def all_morphs : Bool? #

output all morphs (default false)


def allocate_sentence : Bool? #

allocate new memory for input sentence


def bos_format : String? #

user-defined beginning-of-sentence format


def cost_factor : Int32? #

set cost factor (default 700)


def dicdir : String? #

directory of the system dictionary


def eon_format : String? #

user-defined end-of-NBest format


def eos_format : String? #

user-defined end-of-sentence format


def input_buffer_size : Int32? #

input buffer size (default 8192)


def lattice_level : Int32? #

lattice information level (DEPRECATED)


def marginal : Bool? #

output marginal probability (default false)


def max_grouping_size : Int32? #

maximum grouping size for unknown words (default 24)


def nbest : Int32? #

output N best results (default 1)


def node_format : String? #

user-defined node format


def output_format_type : String? #

output format type (wakati, chasen, yomi, etc.)


def partial : Bool? #

partial parsing mode (default false)


def rcfile : String? #

resource file


def theta : Float32? #

set temparature parameter theta (default 0.75)


def unk_feature : String? #

feature for unknown word


def unk_format : String? #

user-defined unknown node format


def userdic : String? #

path to the user dictionary