textmood 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/textmood +12 -3
- metadata +1 -1
data/bin/textmood
CHANGED
@@ -100,9 +100,18 @@ opts_parser = OptionParser.new do |opts|
|
|
100
100
|
end
|
101
101
|
opts_parser.parse!
|
102
102
|
|
103
|
-
|
103
|
+
def do_main(text, options)
|
104
104
|
scorer = TextMood.new(options)
|
105
|
-
puts scorer.score_text(
|
105
|
+
puts scorer.score_text(text)
|
106
|
+
end
|
107
|
+
|
108
|
+
if ARGV[0]
|
109
|
+
do_main(ARGV[0], options)
|
106
110
|
else
|
107
|
-
|
111
|
+
text = $stdin.read
|
112
|
+
if text
|
113
|
+
do_main(text, options)
|
114
|
+
else
|
115
|
+
mini_usage(usage, true)
|
116
|
+
end
|
108
117
|
end
|