From 79ffc2ecbe7fb47ceac1143f81f9d3311f02fcc6 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 29 May 2015 09:20:12 +0200 Subject: tf-idf: glob handling --- tf-idf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tf-idf') diff --git a/tf-idf b/tf-idf index 450de6b..dde2fd5 100755 --- a/tf-idf +++ b/tf-idf @@ -20,7 +20,13 @@ def main end docs = {} - cfg[:documents].each { |i| + a = [] + if cfg[:documents].strip[0] == "*" + ad = Dir.glob(cfg[:documents]) + else + ad = cfg[:documents].split + end + ad.each { |i| if cfg[:one_item_per_line] docs[i] = ReadFile.readlines_strip i else -- cgit v1.2.3