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 : 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.
Instance Method Summary
-
#all_morphs : Bool | Nil
output all morphs (default false)
-
#allocate_sentence : Bool | Nil
allocate new memory for input sentence
-
#bos_format : String | Nil
user-defined beginning-of-sentence format
-
#cost_factor : Int32 | Nil
set cost factor (default 700)
-
#dicdir : String | Nil
directory of the system dictionary
-
#eon_format : String | Nil
user-defined end-of-NBest format
-
#eos_format : String | Nil
user-defined end-of-sentence format
-
#input_buffer_size : Int32 | Nil
input buffer size (default 8192)
-
#lattice_level : Int32 | Nil
lattice information level (DEPRECATED)
-
#marginal : Bool | Nil
output marginal probability (default false)
-
#max_grouping_size : Int32 | Nil
maximum grouping size for unknown words (default 24)
-
#nbest : Int32 | Nil
output N best results (default 1)
-
#node_format : String | Nil
user-defined node format
-
#output_format_type : String | Nil
output format type (wakati, chasen, yomi, etc.)
-
#partial : Bool | Nil
partial parsing mode (default false)
-
#rcfile : String | Nil
resource file
-
#theta : Float32 | Nil
set temparature parameter theta (default 0.75)
-
#unk_feature : String | Nil
feature for unknown word
-
#unk_format : String | Nil
user-defined unknown node format
-
#userdic : String | Nil
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("吾輩は猫である。名前はまだ無い。")
# => ワガハイ ハ ネコ デ アル 。 ナマエ ハ マダ ナイ 。