reflexive 1.0.17__tar.gz → 1.0.19__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflexive
3
- Version: 1.0.17
3
+ Version: 1.0.19
4
4
  Summary: Supports AWS Reflexive Expressions Analysis
5
5
  Home-page: https://github.com/nlytx/reflexive
6
6
  Author: Andrew Gibson
@@ -109,8 +109,8 @@ class Display:
109
109
  x = None
110
110
  else:
111
111
  # both start and end is available
112
- taken.append(off[0])
113
- taken.append(off[1])
112
+ for t in range(off[0],(off[1]+1)):
113
+ taken.append(t)
114
114
  #print(taken)
115
115
  new_ent["start"] = off[0]
116
116
  new_ent["end"] = off[1]
@@ -153,8 +153,29 @@ class Display:
153
153
  for sr in syntax_results:
154
154
  pos = sr['PartOfSpeech']
155
155
  if pos['Score']>0.99:
156
- if pos['Tag'] in ['PRON','NOUN','ADJ']:
156
+ if pos['Tag'] in ['NOUN','ADJ']:
157
157
  offsets.setdefault("EO",[]).append((sr['BeginOffset'],sr['EndOffset']))
158
158
  if pos['Tag'] in ['ADV','VERB']:
159
159
  offsets.setdefault("EA",[]).append((sr['BeginOffset'],sr['EndOffset']))
160
- return offsets
160
+ return self.concatenate_offsets(offsets)
161
+
162
+ def concatenate_offsets(self,offsets:dict):
163
+ new_offsets = {}
164
+ for k in offsets.keys():
165
+ #print("TAG:",k)
166
+ #print("Offsets:",len(offsets[k]))
167
+ b,e = offsets[k][0] # set to first tag
168
+ for v in offsets[k]:
169
+ #print("b,e",b,e)
170
+ #print("offset:",v)
171
+ if v[0] <= (e+1): # this tag extends a previous tag
172
+ e = v[1]
173
+ #print("extending")
174
+ #print("new_offset:",(b,e))
175
+ else: # this tag starts a new tag
176
+ #print("new tag")
177
+ new_offsets.setdefault(k,[]).append((b,e))
178
+ b = v[0]
179
+ e = v[1]
180
+ #print("New offsets:",len(new_offsets[k]))
181
+ return new_offsets
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflexive
3
- Version: 1.0.17
3
+ Version: 1.0.19
4
4
  Summary: Supports AWS Reflexive Expressions Analysis
5
5
  Home-page: https://github.com/nlytx/reflexive
6
6
  Author: Andrew Gibson
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = reflexive
3
- version = 1.0.17
3
+ version = 1.0.19
4
4
  author = Andrew Gibson
5
5
  author_email = andrew@nlytx.io
6
6
  description = Supports AWS Reflexive Expressions Analysis
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes