From da8d0a3e1764e62f1ec321e5d64ab4e746d704a8 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 12 Nov 2015 13:48:16 +0100 Subject: map lines to number of token they contain --- ltok | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 ltok diff --git a/ltok b/ltok new file mode 100755 index 0000000..c90823e --- /dev/null +++ b/ltok @@ -0,0 +1,9 @@ +#!/usr/bin/ruby + +STDIN.set_encoding 'utf-8' +STDOUT.set_encoding 'utf-8' + +while line = STDIN.gets + puts line.strip.split(/\s/).size +end + -- cgit v1.2.3