るりまサーチ

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

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

ライブラリ

クラス

モジュール

検索結果

Abbrev.#abbrev(words, pattern = nil) -> Hash (35238.0)

文字列の配列から一意に決まる短縮形を計算し、 短縮形をキー、元の文字列を値とするハッシュを返します。

...equire 'abbrev'

# words に同じ文字列が含まれている場合は
# 以下のようにその文字列しか返しません。
pp Abbrev.abbrev(%w[ruby ruby]).sort
# => [["ruby", "ruby"]]

# 空白が含まれていても適切に処理します。
pp Abbrev.abbrev(['ru by...
...["ru", "ru by"],
# ["ru ", "ru by"],
# ["ru b", "ru by"],
# ["ru by", "ru by"]]
# sort していない例
p %w[ruby rubyist].abbrev
#=> {"ruby" => "ruby",
# "rubyi" => "rubyist",
# "rubyis" => "rubyist",
# "rubyist" => "rubyist"}...

Array#abbrev(pattern = nil) -> Hash (26238.0)

self が文字列の配列の場合、self から一意に決まる短縮形を計算し、 短縮形をキー、元の文字列を値とするハッシュを返します。

...

Abbrev
.#abbrev(self, pattern) と同じです。

@param pattern Regexp か String を指定します。


require 'abbrev'
p %w[ruby rubyist].abbrev
#=> {"ruby" => "ruby",
# "rubyi" => "rubyist",
# "rubyis" => "rubyist",
# "rubyist" => "rubyist"}

@see Abbrev.#abbrev...

NEWS for Ruby 3.0.0 (72.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added...
...cant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#n...
....

== Stdlib compatibility issues

* Default gems
* The following libraries are promoted to default gems from stdlib.
* English
* abbrev
* base64
* drb
* debug
* erb
* find
* net-ftp
* net-http
* net-imap
* net-protocol
*...