るりまサーチ

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

別のキーワード

  1. _builtin to_h
  2. struct to_h
  3. hash to_h
  4. openstruct to_h
  5. ostruct to_h

ライブラリ

クラス

検索結果

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

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

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

@param string 辞書に用いる文字列を指定します。詳しくは zlib.h を参照してく...
...uire 'zlib'

def case1(str)
dez = Zlib::Deflate.new
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.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.siz...
...nd

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, dic...

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

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

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

@param string 展開に用いる辞書を文字列で指定します。

require 'zlib'

def case2(str, dict)
dez = Zlib::Deflat...
...dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
i
nz = Zlib::Inflate.new
begin
i
nz.inflate(comp_str)
rescue Zlib::NeedDict
end
# 展開に用いる辞書が必要です。
i
nz.set_dictionary(dict)
p inz.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)...