Module: Freql::FPMW

Defined in:
lib/freql/fpmw.rb

Class Method Summary collapse

Class Method Details

.calc_fpmw(occurances, total) ⇒ Object



34
35
36
# File 'lib/freql/fpmw.rb', line 34

def calc_fpmw occurances, total
  (occurances / total.to_f) * 1000000
end

.fpmw_to_cb(fpmw) ⇒ Object



30
31
32
# File 'lib/freql/fpmw.rb', line 30

def fpmw_to_cb fpmw
  Math.log10(fpmw / 1000000.0) * 100.0
end

.fpmw_to_fpbw(fpmw) ⇒ Object



24
25
26
# File 'lib/freql/fpmw.rb', line 24

def fpmw_to_fpbw fpmw
  fpmw * 1000
end

.fpmw_to_fq(fpmw) ⇒ Object



21
22
23
# File 'lib/freql/fpmw.rb', line 21

def fpmw_to_fq fpmw
  fpmw / 1000000.0
end

.fpmw_to_zipf(fpmw) ⇒ Object



27
28
29
# File 'lib/freql/fpmw.rb', line 27

def fpmw_to_zipf fpmw
  Math.log10(fpmw * 1000)
end