summaryrefslogtreecommitdiff
path: root/max_len
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-01-07 18:47:50 +0100
committerPatrick Simianer <p@simianer.de>2015-01-07 18:47:50 +0100
commitcf0bf046e51a4a76315b8c964fabc8e641eb91fe (patch)
treec2746bc11a2a33007636f98c96bded350e264f40 /max_len
parente0b634754d1bef33dc8e72509c6990cccc32745a (diff)
select_from, max_len
Diffstat (limited to 'max_len')
-rwxr-xr-xmax_len16
1 files changed, 16 insertions, 0 deletions
diff --git a/max_len b/max_len
new file mode 100755
index 0000000..69013b5
--- /dev/null
+++ b/max_len
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+
+require 'zipf'
+
+max = ARGV[0].to_i
+
+i = 0
+while line = STDIN.gets
+ if tokenize(line).size <= max
+ puts i
+ else
+ STDERR.write line
+ end
+ i += 1
+end
+