summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-05-29 09:20:12 +0200
committerPatrick Simianer <p@simianer.de>2015-05-29 09:20:12 +0200
commit79ffc2ecbe7fb47ceac1143f81f9d3311f02fcc6 (patch)
tree4ed1b5b8569ba59f534fc1948ad7d903be9e2663
parent181c0bd79b0e7db2891047305dc87d20ca04097b (diff)
tf-idf: glob handling
-rwxr-xr-xtf-idf8
1 files changed, 7 insertions, 1 deletions
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