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("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。

[View source]
def self.new(rcfile : Nil | String = nil, dicdir : Nil | String = nil, userdic : Nil | String = nil, lattice_level : Int32 | Nil = nil, output_format_type : Nil | String = nil, all_morphs : Bool | Nil = nil, nbest : Int32 | Nil = nil, partial : Bool | Nil = nil, marginal : Bool | Nil = nil, max_grouping_size : Int32 | Nil = nil, node_format : Nil | String = nil, unk_format : Nil | String = nil, bos_format : Nil | String = nil, eos_format : Nil | String = nil, eon_format : Nil | String = nil, unk_feature : Nil | String = nil, input_buffer_size : Int32 | Nil = nil, allocate_sentence : Bool | Nil = nil, theta : Float32 | Nil = nil, cost_factor : Int32 | Nil = 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("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。

[View source]

Instance Method Detail

def all_morphs : Bool | Nil #

output all morphs (default false)


[View source]
def allocate_sentence : Bool | Nil #

allocate new memory for input sentence


[View source]
def bos_format : String | Nil #

user-defined beginning-of-sentence format


[View source]
def cost_factor : Int32 | Nil #

set cost factor (default 700)


[View source]
def dicdir : String | Nil #

directory of the system dictionary


[View source]
def eon_format : String | Nil #

user-defined end-of-NBest format


[View source]
def eos_format : String | Nil #

user-defined end-of-sentence format


[View source]
def input_buffer_size : Int32 | Nil #

input buffer size (default 8192)


[View source]
def lattice_level : Int32 | Nil #

lattice information level (DEPRECATED)


[View source]
def marginal : Bool | Nil #

output marginal probability (default false)


[View source]
def max_grouping_size : Int32 | Nil #

maximum grouping size for unknown words (default 24)


[View source]
def nbest : Int32 | Nil #

output N best results (default 1)


[View source]
def node_format : String | Nil #

user-defined node format


[View source]
def output_format_type : String | Nil #

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


[View source]
def partial : Bool | Nil #

partial parsing mode (default false)


[View source]
def rcfile : String | Nil #

resource file


[View source]
def theta : Float32 | Nil #

set temparature parameter theta (default 0.75)


[View source]
def unk_feature : String | Nil #

feature for unknown word


[View source]
def unk_format : String | Nil #

user-defined unknown node format


[View source]
def userdic : String | Nil #

path to the user dictionary


[View source]