Module: Bise
- Included in:
- File
- Defined in:
- lib/bise.rb,
lib/bise/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
-
#bin_find(term, &comp) ⇒ Object
Finds the first string in the presorted text file that satisfies term <= str.
Instance Method Details
#bin_find(term, &comp) ⇒ Object
Finds the first string in the presorted text file that satisfies term <= str. Takes optional comparison block accepting term and str. Default - { |term, str| term <=> str }
9 10 11 12 |
# File 'lib/bise.rb', line 9 def bin_find(term, &comp) comp ||= lambda{|term, str| term <=> str} bin_search(term, 0, stat.size, &comp) end |