summaryrefslogtreecommitdiff
path: root/length-ratio
diff options
context:
space:
mode:
authorPatrick Simianer <pks@pks.rocks>2018-01-30 13:15:58 +0100
committerPatrick Simianer <pks@pks.rocks>2018-01-30 13:15:58 +0100
commit102feddfb3033640abf2916a17cb9394d94fd638 (patch)
tree9be5d2eea86f197f5658ea7f9758bb7093ad19fe /length-ratio
parentc3caa66919439ff5f92733f5ee7825c4e6783f23 (diff)
parentbda3b2633935b3e217b17406ed0a379ffb97c2a1 (diff)
Merge branch 'master' of github.com:pks/nlp_scripts
Diffstat (limited to 'length-ratio')
-rwxr-xr-xlength-ratio12
1 files changed, 12 insertions, 0 deletions
diff --git a/length-ratio b/length-ratio
new file mode 100755
index 0000000..4b4432d
--- /dev/null
+++ b/length-ratio
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+
+require 'zipf'
+
+a = ReadFile.new ARGV[0]
+b = ReadFile.new ARGV[1]
+
+while linea = a.gets
+ lineb = b.gets
+ puts linea.strip.split.size.to_f / lineb.strip.split.size.to_f
+end
+