textmood 0.0.3 → 0.0.4
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/README.md +6 -0
- data/bin/textmood +3 -2
- metadata +1 -1
data/README.md
CHANGED
@@ -79,6 +79,12 @@ textmood -l en_US "<some text>"
|
|
79
79
|
-0.4375
|
80
80
|
```
|
81
81
|
|
82
|
+
Alternatively, you can pipe some text to textmood on stdin:
|
83
|
+
```bash
|
84
|
+
echo "<some text>" | textmood -l en_US
|
85
|
+
-0.4375
|
86
|
+
```
|
87
|
+
|
82
88
|
The cli tool has many useful options, mostly mirroring those of the library. Here’s the
|
83
89
|
output from `textmood -h`:
|
84
90
|
```
|
data/bin/textmood
CHANGED
@@ -13,7 +13,7 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
|
|
13
13
|
require "optparse"
|
14
14
|
require "textmood"
|
15
15
|
|
16
|
-
usage = "Usage: #{File.basename($0)} [options] \"<text>\""
|
16
|
+
usage = "Usage: #{File.basename($0)} [options] \"<text>\"\n OR\n echo \"<text>\" | #{File.basename($0)} [options]"
|
17
17
|
|
18
18
|
def mini_usage(usage, notext = false)
|
19
19
|
puts usage
|
@@ -21,7 +21,8 @@ def mini_usage(usage, notext = false)
|
|
21
21
|
if notext
|
22
22
|
puts "ERROR: Quoted text must be provided after the last option."
|
23
23
|
else
|
24
|
-
puts "ERROR: An IETF language tag must be provided using the -l/--language option
|
24
|
+
puts "ERROR: An IETF language tag must be provided using the -l/--language option,"
|
25
|
+
puts " or sentiment files must be provided with the -f/--file option."
|
25
26
|
end
|
26
27
|
puts ""
|
27
28
|
puts "Use \"#{File.basename($0)} -h\" for full usage info."
|