るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.079秒)
トップページ > クエリ:-[x] > クエリ:Set[x] > クエリ:set_dictionary[x]

別のキーワード

  1. _builtin set_encoding
  2. set new
  3. stringio set_encoding
  4. tracer set_get_line_procs
  5. set divide

ライブラリ

クラス

検索結果

Zlib::Inflate#set_dictionary(string) -> String (24326.0)

展開に用いる辞書を指定します。string を返します。 このメソッドは Zlib::NeedDict 例外が発生した直後のみ 有効です。詳細は zlib.h を参照して下さい。

...ate.new
dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
inz = Zlib::Inflate.new
begin
inz.inflate(comp_str)
rescue Zlib::NeedDict
end
# 展開に用いる辞書が必要です。
inz.set_dictionary(dict)
p i...
....inflate(comp_str)
end
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1,
0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
str = g.collect{|m| sset.at(m)}.join("")

case2(str, dict)...

Zlib::Deflate#set_dictionary(string) -> String (24314.0)

圧縮に用いる辞書を指定します。string を返します。 このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。

...圧縮に用いる辞書を指定します。string を返します。
このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset
を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。

@param string 辞書に用いる文字列を指定します。詳しく...
...tr.size
end

def case2(str, dict)
dez = Zlib::Deflate.new
p dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
end

i = 10
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 1, 1, 1, 0, 0...
..., 0, 3, 3, 3, 0, 0, 1, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0]
str = (1..i).collect{|m| t = rand(g.size); sset.at(g[t])}.join("")

printf "%d normal:%d, dict:%d\n", i, case1(str), case2(str, dict)...

Zlib::Inflate#inflate(string) -> String (112.0)

string を展開ストリームに入力します。

...字列を入力します。

@raise Zlib::NeedDict 展開に辞書が必要な場合に発生します。
Zlib::Inflate#set_dictionary メソッドで辞書をセットした
後で、空文字列と共にこのメソッドを再度呼び出して下さい...