textmood 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -14
- data/lang/no_NB.txt +6024 -6028
- metadata +1 -1
data/README.md
CHANGED
@@ -38,15 +38,15 @@ scorer = TextMood.new(files: ["en_US-mod1.txt", "emoticons.txt"])
|
|
38
38
|
# N-gram can be specified using the :start_ngram and :end_ngram options
|
39
39
|
scorer = TextMood.new(lang: "en_US", debug: true, start_ngram: 2, end_ngram: 3)
|
40
40
|
score = scorer.score_text("some long text with many words")
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
#(stdout): some long: 0.1
|
42
|
+
#(stdout): long text: 0.1
|
43
|
+
#(stdout): text with: -0.1
|
44
|
+
#(stdout): with many: -0.1
|
45
|
+
#(stdout): many words: -0.1
|
46
|
+
#(stdout): some long text: -0.1
|
47
|
+
#(stdout): long text with: 0.1
|
48
|
+
#(stdout): text with many: 0.1
|
49
|
+
#(stdout): with many words: 0.1
|
50
50
|
#=> '0.1'
|
51
51
|
|
52
52
|
# Using :normalize, you can make TextMood return a normalized value: 1 for positive,
|
@@ -66,20 +66,21 @@ score = scorer.score_text("some text")
|
|
66
66
|
# token was not found)
|
67
67
|
scorer = TextMood.new(lang: "en_US", debug: true)
|
68
68
|
score = scorer.score_text("some text")
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
#(stdout): some: 0.1
|
70
|
+
#(stdout): text: 0.1
|
71
|
+
#(stdout): some text: -0.1
|
72
72
|
#=> '0.1'
|
73
73
|
```
|
74
74
|
|
75
75
|
#### CLI tool
|
76
|
-
|
76
|
+
You can also pass some UTF-8-encoded text to the CLI tool and get a score back, like so
|
77
77
|
```bash
|
78
78
|
textmood -l en_US "<some text>"
|
79
79
|
-0.4375
|
80
80
|
```
|
81
81
|
|
82
|
-
The cli tool has many useful options, mostly mirroring those of the library
|
82
|
+
The cli tool has many useful options, mostly mirroring those of the library. Here’s the
|
83
|
+
output from `textmood -h`:
|
83
84
|
```
|
84
85
|
Usage: textmood [options] "<text>"
|
85
86
|
|