opener-polarity-tagger 3.2.7 → 3.3.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcce63ff8ce9916a2387c5d0f48209b203eacbc3834eedcf3b5b4990084ac1ad
|
4
|
+
data.tar.gz: 495e79bfdec921d459ff78e50bdae28a2c6a0a8bc2aed150de27f49a7f99c423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51288c630084ce9be780b022ae23012337622b6df30de91962f5c73fd2ef32054435247bf850924a40ca723c3fe1a71fc9f688455b1ea5141acf80959fbe37a
|
7
|
+
data.tar.gz: e8f00bd36a27aab5242d91e3f350d4da94d2661ef5565590e1793e02eb65075cf7dd789682b2cd0e06cf4b84bb21a5d5671d51f7e9d94ec1748cd1c8012f33ac
|
data/core/LexiconMod.py
CHANGED
@@ -45,9 +45,7 @@ def load_lexicons(language, path=None):
|
|
45
45
|
def show_lexicons(language, path=None):
|
46
46
|
if path is None:
|
47
47
|
path = __module_dir
|
48
|
-
|
49
|
-
LexiconSent(language,None,path)
|
50
|
-
|
48
|
+
lexicons, default_id, this_folder, folder_per_lang = load_lexicons(language, path)
|
51
49
|
print
|
52
50
|
print '#'*30
|
53
51
|
print 'Available lexicons for',language
|
@@ -31,19 +31,19 @@ module Opener
|
|
31
31
|
pos = if @ignore_pos then nil else t.pos end
|
32
32
|
attrs = Hashie::Mash.new
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
# text matching have priority as sometimes
|
35
|
+
# the lemma provided by Stanza is a different word
|
36
|
+
lexicon, polarity_pos = @map.by_polarity text, pos
|
37
|
+
lexicon, polarity_pos = @map.by_polarity lemma, pos if lexicon.polarity == 'unknown'
|
36
38
|
|
37
|
-
if
|
38
|
-
attrs.polarity = lexicon.polarity
|
39
|
-
end
|
40
|
-
if l = @map.by_negator(lemma) || @map.by_negator(text)
|
39
|
+
if l = @map.by_negator(text) || @map.by_negator(lemma)
|
41
40
|
lexicon, polarity_pos = l, nil
|
42
41
|
attrs.sentiment_modifier = 'shifter'
|
43
|
-
|
44
|
-
if l = @map.by_intensifier(lemma) || @map.by_intensifier(text)
|
42
|
+
elsif l = @map.by_intensifier(text) || @map.by_intensifier(lemma)
|
45
43
|
lexicon, polarity_pos = l, nil
|
46
44
|
attrs.sentiment_modifier = 'intensifier'
|
45
|
+
elsif lexicon.polarity != 'unknown'
|
46
|
+
attrs.polarity = lexicon.polarity
|
47
47
|
end
|
48
48
|
|
49
49
|
if attrs.size > 0
|
@@ -46,13 +46,12 @@ module Opener
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def by_polarity lemma, short_pos
|
49
|
-
|
49
|
+
l = @with_polarity[lemma+short_pos] if short_pos
|
50
|
+
return [l, short_pos] if l
|
50
51
|
|
51
52
|
POS_ORDER.chars.each do |short_pos|
|
52
|
-
|
53
|
-
|
54
|
-
return [l, short_pos]
|
55
|
-
end
|
53
|
+
l = @with_polarity[lemma+short_pos]
|
54
|
+
return [l, short_pos] if l
|
56
55
|
end
|
57
56
|
|
58
57
|
[UNKNOWN, 'unknown']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-polarity-tagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- development@olery.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opener-daemons
|