diff options
| author | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
|---|---|---|
| committer | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
| commit | b31ace79ea5f6b3f279c544cd3a443d6fbf2a24d (patch) | |
| tree | 31f2b599fa5f6996aeb134390d58deb63eefe04a /repetition-rate | |
| parent | 8805e95ae94d798c6441f7e1b72c90e049563f17 (diff) | |
Diffstat (limited to 'repetition-rate')
| -rwxr-xr-x | repetition-rate | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/repetition-rate b/repetition-rate index 87938ae..12e0fab 100755 --- a/repetition-rate +++ b/repetition-rate @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'zipf' +require "zipf" windows = [] cur = [] @@ -9,7 +9,7 @@ while line = STDIN.gets if cur_sz >= 1000 windows << cur cur = [] - cur_sz = 0 + cur_sz = 0 end cur << line.strip cur_sz += cur.last.split.size @@ -37,8 +37,7 @@ windows.each { |w| rr = 1.0 enums.each_with_index { |i,j| - rr *= i/denoms[j] + rr *= i/denoms[j] } puts ((rr**0.25)*100).round 2 - |
