struct Wakame::Options
- Wakame::Options
- Struct
- Value
- Object
Overview
Struct that represents a collection of options to pass to the Wakame::MeCab object.
Defined in:
wakame/options.crConstructors
-
.new(option_str : String)
Creates a new options object with the given command-line style option arguments.
-
.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.
Instance Method Summary
-
#all_morphs : Bool?
output all morphs (default false)
-
#allocate_sentence : Bool?
allocate new memory for input sentence
-
#bos_format : String?
user-defined beginning-of-sentence format
-
#cost_factor : Int32?
set cost factor (default 700)
-
#dicdir : String?
directory of the system dictionary
-
#eon_format : String?
user-defined end-of-NBest format
-
#eos_format : String?
user-defined end-of-sentence format
-
#input_buffer_size : Int32?
input buffer size (default 8192)
-
#lattice_level : Int32?
lattice information level (DEPRECATED)
-
#marginal : Bool?
output marginal probability (default false)
-
#max_grouping_size : Int32?
maximum grouping size for unknown words (default 24)
-
#nbest : Int32?
output N best results (default 1)
-
#node_format : String?
user-defined node format
-
#output_format_type : String?
output format type (wakati, chasen, yomi, etc.)
-
#partial : Bool?
partial parsing mode (default false)
-
#rcfile : String?
resource file
-
#theta : Float32?
set temparature parameter theta (default 0.75)
-
#unk_feature : String?
feature for unknown word
-
#unk_format : String?
user-defined unknown node format
-
#userdic : String?
path to the user dictionary
Constructor Detail
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("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。
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("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。