opener-polarity-tagger 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee937e14a2da85b39cc76765d221ac23f9df4d713953482cd58bee4acebd1f0d
|
4
|
+
data.tar.gz: d86cd682deb902951b93a3c217a9ccfff677956c39adc4b21a29597483f4b28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d400f873a98d0426b4090f4155339ab2e2bb6743218d65dde59ed40d3ae61a5f66c836fb2f4bd197058e12c1646f473bbc7fc460ba83c1accfc6b27778d2259d
|
7
|
+
data.tar.gz: 5957d89cce03e50eb7d554aac1c39cd06c80d9f9381142ec7e0fc40931e3910b06a7298a9c9a3f1fcac58332edca175afe7fd2e26271f60b2c672471c05f2ebd
|
@@ -10,15 +10,15 @@ module Opener
|
|
10
10
|
LAST_EDITED = '21may2014'
|
11
11
|
VERSION = '1.2'
|
12
12
|
|
13
|
-
|
14
|
-
@cache = LexiconsCache.new
|
13
|
+
CACHE = LexiconsCache.new
|
15
14
|
|
15
|
+
def initialize ignore_pos: false, **params
|
16
16
|
@ignore_pos = ignore_pos
|
17
17
|
end
|
18
18
|
|
19
19
|
def run input
|
20
20
|
@kaf = KAF::Document.from_xml input
|
21
|
-
@map = @kaf.map =
|
21
|
+
@map = @kaf.map = CACHE[@kaf.language]
|
22
22
|
|
23
23
|
negators = 0
|
24
24
|
@kaf.terms.each do |t|
|
@@ -33,11 +33,11 @@ module Opener
|
|
33
33
|
end
|
34
34
|
if l = @map.by_negator(lemma)
|
35
35
|
negators += 1
|
36
|
-
lexicon,
|
36
|
+
lexicon, polarity_pos = l, nil
|
37
37
|
attrs.sentiment_modifier = 'shifter'
|
38
38
|
end
|
39
39
|
if l = @map.by_intensifier(lemma)
|
40
|
-
lexicon,
|
40
|
+
lexicon, polarity_pos = l, nil
|
41
41
|
attrs.sentiment_modifier = 'intensifier'
|
42
42
|
end
|
43
43
|
|