Module: Freql::FPBW
- Defined in:
- lib/freql/fpbw.rb
Class Method Summary collapse
- .calc_fpbw(occurances, total) ⇒ Object
- .fpbw_to_cb(fpbw) ⇒ Object
- .fpbw_to_fpmw(fpbw) ⇒ Object
- .fpbw_to_fq(fpbw) ⇒ Object
- .fpbw_to_zipf(fpbw) ⇒ Object
Class Method Details
.calc_fpbw(occurances, total) ⇒ Object
22 23 24 |
# File 'lib/freql/fpbw.rb', line 22 def calc_fpbw occurances, total (occurances / total.to_f) * 1000000000 end |
.fpbw_to_cb(fpbw) ⇒ Object
18 19 20 |
# File 'lib/freql/fpbw.rb', line 18 def fpbw_to_cb fpbw Math.log10(fpbw / 1000000000.0) * 100.0 end |
.fpbw_to_fpmw(fpbw) ⇒ Object
12 13 14 |
# File 'lib/freql/fpbw.rb', line 12 def fpbw_to_fpmw fpbw fpbw / 1000 end |
.fpbw_to_fq(fpbw) ⇒ Object
9 10 11 |
# File 'lib/freql/fpbw.rb', line 9 def fpbw_to_fq fpbw fpbw / 1000000000.0 end |
.fpbw_to_zipf(fpbw) ⇒ Object
15 16 17 |
# File 'lib/freql/fpbw.rb', line 15 def fpbw_to_zipf fpbw Math.log10(fpbw) end |