if($e_require){ header("content-language: en"); $e = true; }else if($_GET['en']){ header("HTTP/1.1 301 Moved Permanently"); header("Location: index-en.php"); exit; }else{ header("content-language: ja"); $e = false; } ?>
if($e){ ?>[Japanese] }else{ ?>[English] } ?>
if($e){ ?> Ruby implementation of multiset. Unlike ordinary set(see Ruby documentation for "set" library), multiset can store two or more same items. }else{ ?> Rubyによる多重集合(マルチセット)の実装です。 通常の集合(Rubyでは"set"ライブラリ)と異なり、多重集合は同一の要素を複数格納することができます。 } ?>
Set[:a,:b,:c,:b,:b,:c] # => #<Set: {:b, :c, :a}> Multiset[:a,:b,:c,:b,:b,:c] # => #<Multiset:#3 :b, #2 :c, #1 :a>
if($e){ ?> Multisets are typically used for counting elements and their numbers of appearances in collections. }else{ ?> 多重集合(マルチセット)の典型的な使い方として、コレクションの中に含まれる要素とその数を数える、というものがあります。 } ?>
# Counting the appearances of characters in a string # (Ruby 1.8.7 or later) Multiset.new("abracadabra".each_char) # => #<Multiset:#5 "a", #2 "b", #2 "r", #1 "c", #1 "d"> # The same m = Multiset.new "abracadabra".each_char do |c| # replace with 'each_byte' in Ruby 1.8.6 or before m << c end p m # => #<Multiset:#5 "a", #2 "b", #2 "r", #1 "c", #1 "d"> # The same but works with Ruby 1.8.6 or before Multiset.new("abracadabra".split(//)) # => #<Multiset:#5 "a", #2 "b", #2 "r", #1 "c", #1 "d">
Multiset#classify
and Multiset#classify_with
returns an instance of Multimap.
}else{ ?>Version 0.201より、Multiset#classify
およびMultiset#classify_with
の返り値がMultimapとなりました。
} ?>Multiset#map
, Multiset#map_with
, and so on are added. Be careful that new Multiset#map
is NOT equal to conventional Multiset#map
(=Enumerable#map
)!!
}else{ ?>Version 0.12より、Multiset#map
・Multiset#map_with
などいくつかのメソッドを追加しました。以前のMultiset#map
(=Enumerable#map
)とは挙動が変更になっていますのでご注意下さい。
} ?>if($e){ ?>The library is available via Rubygems. Use the command }else{ ?>Rubygemsによるインストールに対応しています。以下のコマンドでインストールできます。 } ?>
gem install multiset
if($e){ ?>.gem file is available at http://rubygems.org/gems/multiset. }else{ ?>http://rubygems.org/gems/multisetから、.gemファイルを入手することもできます。 } ?>
if($e){ ?>Source codes are available at http://github.com/maraigue/multiset. You can fork or propose fixes on the library via Git. }else{ ?>ソースコードはhttps://github.com/maraigue/multisetからご覧頂けます。Git経由でプロジェクトをフォークしたり、修正の提案をしていただくことも可能です。 } ?>
[Old versions]
* if($e){ ?>This program is distributed under MIT License (0.3.* or after) / BSD license (0.2.* or before). }else{ ?>このプログラムはMITライセンス(0.3以降)およびBSDライセンス(0.2まで)にて公開しています。 } ?>
Ver. 0.5.* (almost the same for version 0.4.*) Ver. 0.2.* Ver. 0.132
if($e){ ?>[Reverse reference] }else{ ?>[逆引きリファレンス] } ?>(Added on 2008/3/1)
if($e){ ?>email to main(at-mark)hhiro.net . }else{ ?>メールアドレス main(あっとまーく)hhiro.net } ?>
if($e){ ?>Back to top }else{ ?>戻る } ?>