wowool-common 3.5.3.dev13__py3-none-any.whl → 3.5.3.dev22__py3-none-any.whl
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.
Potentially problematic release.
This version of wowool-common might be problematic. Click here for more details.
- wowool/annotation/annotation.py +3 -3
- wowool/annotation/entity.py +5 -5
- wowool/annotation/paragraph.py +1 -1
- wowool/annotation/sentence.py +0 -30
- wowool/annotation/token.py +8 -8
- wowool/common/pipeline/objects.py +7 -7
- wowool/diagnostic.py +4 -4
- wowool/document/analysis/apps/anonymizer.py +2 -2
- wowool/document/analysis/apps/chunks.py +4 -9
- wowool/document/analysis/apps/lid.py +1 -1
- wowool/document/analysis/apps/sentiments.py +5 -5
- wowool/document/analysis/document.py +3 -3
- wowool/document/document.py +13 -13
- wowool/document/document_interface.py +1 -1
- wowool/document/factory.py +2 -2
- wowool/string/__init__.py +3 -3
- {wowool_common-3.5.3.dev13.dist-info → wowool_common-3.5.3.dev22.dist-info}/METADATA +2 -2
- {wowool_common-3.5.3.dev13.dist-info → wowool_common-3.5.3.dev22.dist-info}/RECORD +20 -20
- {wowool_common-3.5.3.dev13.dist-info → wowool_common-3.5.3.dev22.dist-info}/WHEEL +0 -0
- {wowool_common-3.5.3.dev13.dist-info → wowool_common-3.5.3.dev22.dist-info}/top_level.txt +0 -0
wowool/annotation/annotation.py
CHANGED
|
@@ -10,8 +10,8 @@ class BasicAnnotation:
|
|
|
10
10
|
"""Initialize a BasicAnnotation instance.
|
|
11
11
|
|
|
12
12
|
Args:
|
|
13
|
-
begin_offset: Begin offset of the annotation.
|
|
14
|
-
end_offset: End offset of the annotation.
|
|
13
|
+
begin_offset (int): Begin offset of the annotation.
|
|
14
|
+
end_offset (int): End offset of the annotation.
|
|
15
15
|
"""
|
|
16
16
|
self._begin_offset: int = begin_offset
|
|
17
17
|
self._end_offset: int = end_offset
|
|
@@ -106,7 +106,7 @@ class Annotation(BasicAnnotation):
|
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Args:
|
|
109
|
-
object: Object to iterate over (Analysis, Sentence, or Entity).
|
|
109
|
+
object (AnalysisDocument|TextAnalysis|Sentence): Object to iterate over (Analysis, Sentence, or Entity).
|
|
110
110
|
|
|
111
111
|
Returns:
|
|
112
112
|
Iterator: Generator yielding annotations.
|
wowool/annotation/entity.py
CHANGED
|
@@ -449,7 +449,7 @@ class Entity(Annotation):
|
|
|
449
449
|
```
|
|
450
450
|
|
|
451
451
|
Args:
|
|
452
|
-
object: Object to iterate
|
|
452
|
+
object (AnalysisDocument|TextAnalysis|Sentence|Entity): Object to iterate Sentence or Entity).
|
|
453
453
|
filter (FilterType): Predicate function to filter the entities. A callable that accepts
|
|
454
454
|
a concept and returns True if the concept is considered a match.
|
|
455
455
|
align (bool): Whether to align the iteration.
|
|
@@ -476,12 +476,12 @@ class Entity(Annotation):
|
|
|
476
476
|
raise TypeError(f"Expected Document, TextAnalysis, Sentence, or Entity but got '{type(object)}'")
|
|
477
477
|
|
|
478
478
|
@staticmethod
|
|
479
|
-
def next(sentence: List[Annotation], object) -> Entity:
|
|
479
|
+
def next(sentence: List[Annotation], object: Entity) -> Entity:
|
|
480
480
|
"""Get the next Entity in the sentence.
|
|
481
481
|
|
|
482
482
|
Args:
|
|
483
483
|
sentence (List[Annotation]): The list of annotations in the sentence.
|
|
484
|
-
object: The current object.
|
|
484
|
+
object (Entity): The current object.
|
|
485
485
|
|
|
486
486
|
Returns:
|
|
487
487
|
Entity: The next Entity.
|
|
@@ -499,12 +499,12 @@ class Entity(Annotation):
|
|
|
499
499
|
raise ErrorAnnotationNotFound
|
|
500
500
|
|
|
501
501
|
@staticmethod
|
|
502
|
-
def prev(sentence: List[Annotation], object) -> Entity:
|
|
502
|
+
def prev(sentence: List[Annotation], object: Entity) -> Entity:
|
|
503
503
|
"""Get the previous Entity in the sentence.
|
|
504
504
|
|
|
505
505
|
Args:
|
|
506
506
|
sentence (List[Annotation]): The list of annotations in the sentence.
|
|
507
|
-
object: The current object.
|
|
507
|
+
object (Entity): The current object.
|
|
508
508
|
|
|
509
509
|
Returns:
|
|
510
510
|
Entity: The previous Entity.
|
wowool/annotation/paragraph.py
CHANGED
|
@@ -147,7 +147,7 @@ class Paragraph(Annotation):
|
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
Args:
|
|
150
|
-
object: Object to iterate
|
|
150
|
+
object(AnalysisDocument|TextAnalysis): Object to iterate the paragraphs.
|
|
151
151
|
original_text (str, optional): The original text to use for paragraph detection.
|
|
152
152
|
align (bool): Whether to align the iteration.
|
|
153
153
|
|
wowool/annotation/sentence.py
CHANGED
|
@@ -218,15 +218,6 @@ class Sentence(BasicAnnotation):
|
|
|
218
218
|
return self.attributes.get("header", []) == ["true"]
|
|
219
219
|
|
|
220
220
|
def concepts(self, filter=_filter_pass_thru_concept):
|
|
221
|
-
"""Access the concepts in the analysis of the sentence.
|
|
222
|
-
|
|
223
|
-
Args:
|
|
224
|
-
filter: Optional filter to select or discard concepts.
|
|
225
|
-
A functor accepting an Entity and returning a bool.
|
|
226
|
-
|
|
227
|
-
Yields:
|
|
228
|
-
Entity: The concepts in the processed sentence.
|
|
229
|
-
"""
|
|
230
221
|
yield from Entity.iter(self, filter)
|
|
231
222
|
|
|
232
223
|
@staticmethod
|
|
@@ -245,27 +236,6 @@ class Sentence(BasicAnnotation):
|
|
|
245
236
|
|
|
246
237
|
@staticmethod
|
|
247
238
|
def iter(object, filter: FilterType = _filter_pass_thru, align: bool = True) -> Iterator["Sentence"]:
|
|
248
|
-
"""Iterate over the sentences in a document, analysis, or paragraph.
|
|
249
|
-
|
|
250
|
-
Example:
|
|
251
|
-
```python
|
|
252
|
-
document = analyzer("Hello from Antwerp, said John Smith.")
|
|
253
|
-
for sentence in Sentence.iter(document):
|
|
254
|
-
print(sentence)
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Args:
|
|
258
|
-
object: Object to iterate (Analysis, AnalysisDocument, or Paragraph).
|
|
259
|
-
filter (FilterType): Predicate function to filter the sentences. A callable that
|
|
260
|
-
accepts a sentence and returns True if the sentence is considered a match.
|
|
261
|
-
align (bool): Whether to align the iteration.
|
|
262
|
-
|
|
263
|
-
Returns:
|
|
264
|
-
Iterator[Sentence]: A generator expression yielding sentences.
|
|
265
|
-
|
|
266
|
-
Raises:
|
|
267
|
-
TypeError: If object type is not supported.
|
|
268
|
-
"""
|
|
269
239
|
from wowool.document.analysis.document import AnalysisDocument
|
|
270
240
|
from wowool.document.analysis.text_analysis import TextAnalysis
|
|
271
241
|
from wowool.annotation.paragraph import Paragraph
|
wowool/annotation/token.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from wowool.annotation.annotation import Annotation, ErrorAnnotationNotFound
|
|
3
|
-
from typing import List, MutableSet,
|
|
3
|
+
from typing import List, MutableSet, cast, Generator
|
|
4
4
|
import warnings
|
|
5
5
|
from typing import NewType
|
|
6
6
|
|
|
@@ -212,7 +212,7 @@ class Token(Annotation):
|
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
Args:
|
|
215
|
-
object: Object to iterate. Can be AnalysisDocument, TextAnalysis,
|
|
215
|
+
object (AnalysisDocument|TextAnalysis|Sentence|Entity): Object to iterate. Can be AnalysisDocument, TextAnalysis,
|
|
216
216
|
Sentence or Entity.
|
|
217
217
|
|
|
218
218
|
Returns:
|
|
@@ -239,12 +239,12 @@ class Token(Annotation):
|
|
|
239
239
|
raise TypeError(f"Expected Document, TextAnalysis, Sentence, or Entity but got '{type(object)}'")
|
|
240
240
|
|
|
241
241
|
@staticmethod
|
|
242
|
-
def next(sentence, object) -> Token:
|
|
242
|
+
def next(sentence, object: Token) -> Token:
|
|
243
243
|
"""Return the next Token.
|
|
244
244
|
|
|
245
245
|
Args:
|
|
246
|
-
sentence: The sentence containing the tokens.
|
|
247
|
-
object: The current object to find the next token from.
|
|
246
|
+
sentence (Sentence): The sentence containing the tokens.
|
|
247
|
+
object (Token): The current object to find the next token from.
|
|
248
248
|
|
|
249
249
|
Returns:
|
|
250
250
|
Token: The next token in the sentence.
|
|
@@ -262,12 +262,12 @@ class Token(Annotation):
|
|
|
262
262
|
raise ErrorAnnotationNotFound
|
|
263
263
|
|
|
264
264
|
@staticmethod
|
|
265
|
-
def prev(sentence, object:
|
|
265
|
+
def prev(sentence, object: Entity | Token) -> Token:
|
|
266
266
|
"""Return the previous Token.
|
|
267
267
|
|
|
268
268
|
Args:
|
|
269
|
-
sentence: The sentence containing the tokens.
|
|
270
|
-
object (
|
|
269
|
+
sentence (Sentence): The sentence containing the tokens.
|
|
270
|
+
object (Entity|Token): The current object to find the previous token from.
|
|
271
271
|
|
|
272
272
|
Returns:
|
|
273
273
|
Token: The previous token in the sentence.
|
|
@@ -8,7 +8,7 @@ class UUID:
|
|
|
8
8
|
|
|
9
9
|
Attributes:
|
|
10
10
|
name (str): The name of the component.
|
|
11
|
-
options (dict[str,
|
|
11
|
+
options (dict[str,Any]): Configuration options for the component.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
name: str
|
|
@@ -18,7 +18,7 @@ class UUID:
|
|
|
18
18
|
"""Convert the UUID to a JSON-serializable dictionary.
|
|
19
19
|
|
|
20
20
|
Returns:
|
|
21
|
-
dict[str,
|
|
21
|
+
dict[str,Any]: A dictionary containing the name and options.
|
|
22
22
|
"""
|
|
23
23
|
return {"name": self.name, "options": self.options}
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ def createUUID(uid: str | UUID | dict) -> UUID:
|
|
|
27
27
|
"""Create a UUID object from various input types.
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
|
-
uid (str
|
|
30
|
+
uid (str|UUID|dict): The input to create a UUID from. Can be a string name,
|
|
31
31
|
an existing UUID object, or a dictionary with 'name' and optional 'options' keys.
|
|
32
32
|
|
|
33
33
|
Returns:
|
|
@@ -62,13 +62,13 @@ class ComponentInfo:
|
|
|
62
62
|
Contains metadata and configuration information for a component in the pipeline.
|
|
63
63
|
|
|
64
64
|
Attributes:
|
|
65
|
-
options (dict[str,
|
|
65
|
+
options (dict[str,Any]): Configuration options on how the component has been initialized.
|
|
66
66
|
type (str): The type of component (e.g., 'language', 'domain', 'app').
|
|
67
67
|
name (str): The name of the component. (e.g., 'english.language', 'english-entity.dom').
|
|
68
68
|
uid (str): Unique identifier for the component.
|
|
69
|
-
filename (str
|
|
70
|
-
app (dict[str,
|
|
71
|
-
original (str
|
|
69
|
+
filename (str|None): Optional filename associated with the component (if applicable).
|
|
70
|
+
app (dict[str,str]|None): Optional application-specific information.
|
|
71
|
+
original (str|None): Optional original source information.
|
|
72
72
|
"""
|
|
73
73
|
|
|
74
74
|
options: dict[str, Any]
|
wowool/diagnostic.py
CHANGED
|
@@ -109,11 +109,11 @@ class Diagnostic:
|
|
|
109
109
|
"""Initialize a Diagnostic instance.
|
|
110
110
|
|
|
111
111
|
Args:
|
|
112
|
-
id (str
|
|
112
|
+
id (str|None): Unique identifier.
|
|
113
113
|
message (str): Message.
|
|
114
114
|
type (int): Diagnostic type.
|
|
115
|
-
line (int
|
|
116
|
-
offset (int
|
|
115
|
+
line (int|None): Line number. Defaults to None.
|
|
116
|
+
offset (int|None): Offset. Defaults to None.
|
|
117
117
|
"""
|
|
118
118
|
super(Diagnostic, self).__init__()
|
|
119
119
|
self.id = id
|
|
@@ -215,7 +215,7 @@ class Diagnostics:
|
|
|
215
215
|
"""Initialize a Diagnostics instance.
|
|
216
216
|
|
|
217
217
|
Args:
|
|
218
|
-
items (List[Diagnostic]
|
|
218
|
+
items (List[Diagnostic]|None): Diagnostics. Defaults to an empty list.
|
|
219
219
|
"""
|
|
220
220
|
super(Diagnostics, self).__init__()
|
|
221
221
|
self.items = items if items else []
|
|
@@ -16,8 +16,8 @@ class Location:
|
|
|
16
16
|
uri (str): URI or identifier for the type of sensitive content detected.
|
|
17
17
|
anonymized (str): The anonymized replacement text.
|
|
18
18
|
text (str): The original sensitive text that was anonymized.
|
|
19
|
-
byte_begin_offset (int
|
|
20
|
-
byte_end_offset (int
|
|
19
|
+
byte_begin_offset (int|None): Starting byte position, if available.
|
|
20
|
+
byte_end_offset (int|None): Ending byte position, if available.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
begin_offset: int
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
"""Chunk
|
|
2
|
-
|
|
3
|
-
This module provides functionality to work with text chunks, which are segments
|
|
4
|
-
of text that contain sentences along with their metadata including offsets,
|
|
5
|
-
outline information, topics, and themes.
|
|
6
|
-
"""
|
|
1
|
+
"""Chunk API classes"""
|
|
7
2
|
|
|
8
3
|
from dataclasses import dataclass
|
|
9
4
|
from wowool.document.analysis.apps.topics import convert_topics, Topic
|
|
@@ -21,9 +16,9 @@ class Chunk:
|
|
|
21
16
|
sentences (list): List of sentences contained in this chunk.
|
|
22
17
|
begin_offset (int): Starting character position of the chunk in the document.
|
|
23
18
|
end_offset (int): Ending character position of the chunk in the document.
|
|
24
|
-
outline (list
|
|
25
|
-
topics (list[Topic]
|
|
26
|
-
themes (list[Theme]
|
|
19
|
+
outline (list|None): Hierarchical outline structure for the chunk, if available.
|
|
20
|
+
topics (list[Topic]|None): List of topics associated with the chunk, if any.
|
|
21
|
+
themes (list[Theme]|None): List of themes associated with the chunk, if any.
|
|
27
22
|
"""
|
|
28
23
|
|
|
29
24
|
sentences: list
|
|
@@ -14,7 +14,7 @@ class LanguageIdentifierSectionResult:
|
|
|
14
14
|
language (str): The identified language code (e.g., 'en', 'fr', 'es').
|
|
15
15
|
begin_offset (int): Starting character position of the section.
|
|
16
16
|
end_offset (int): Ending character position of the section.
|
|
17
|
-
text (str
|
|
17
|
+
text (str|None): The actual text content of the section, if available.
|
|
18
18
|
Defaults to None.
|
|
19
19
|
"""
|
|
20
20
|
|
|
@@ -19,11 +19,11 @@ class Sentiment:
|
|
|
19
19
|
text (str): The actual text content of the sentiment expression.
|
|
20
20
|
begin_offset (int): Starting character position of the sentiment expression.
|
|
21
21
|
end_offset (int): Ending character position of the sentiment expression.
|
|
22
|
-
object (str
|
|
23
|
-
adjective (str
|
|
24
|
-
expression (str
|
|
25
|
-
comp (str
|
|
26
|
-
verb (str
|
|
22
|
+
object (str|None): The object of the sentiment, if identified. Defaults to None.
|
|
23
|
+
adjective (str|None): Sentiment-bearing adjective, if present. Defaults to None.
|
|
24
|
+
expression (str|None): The sentiment expression phrase, if identified. Defaults to None.
|
|
25
|
+
comp (str|None): Comparative element in the sentiment, if present. Defaults to None.
|
|
26
|
+
verb (str|None): Sentiment-bearing verb, if identified. Defaults to None.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
polarity: str
|
|
@@ -76,7 +76,7 @@ class AnalysisDocument(DocumentInterface):
|
|
|
76
76
|
|
|
77
77
|
Args:
|
|
78
78
|
document (DocumentInterface): The input document to analyze.
|
|
79
|
-
metadata (dict
|
|
79
|
+
metadata (dict|None): Document metadata. Defaults to None.
|
|
80
80
|
"""
|
|
81
81
|
super().__init__()
|
|
82
82
|
|
|
@@ -231,7 +231,7 @@ class AnalysisDocument(DocumentInterface):
|
|
|
231
231
|
"""Check if the document contains diagnostics.
|
|
232
232
|
|
|
233
233
|
Args:
|
|
234
|
-
app_id (str
|
|
234
|
+
app_id (str|None): Application identifier. If None, checks
|
|
235
235
|
for any diagnostics. Defaults to None.
|
|
236
236
|
|
|
237
237
|
Returns:
|
|
@@ -253,7 +253,7 @@ class AnalysisDocument(DocumentInterface):
|
|
|
253
253
|
"""Get the diagnostics of the given application.
|
|
254
254
|
|
|
255
255
|
Args:
|
|
256
|
-
app_id (str
|
|
256
|
+
app_id (str|None): Application identifier. If None, returns
|
|
257
257
|
all diagnostics. Defaults to None.
|
|
258
258
|
|
|
259
259
|
Returns:
|
wowool/document/document.py
CHANGED
|
@@ -2,7 +2,7 @@ from wowool.document.document_interface import DocumentInterface
|
|
|
2
2
|
from wowool.document.factory import Factory, _resolve__pass_thru
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from wowool.document.defines import WJ_ID, WJ_DATA, WJ_MIME_TYPE, WJ_METADATA
|
|
5
|
-
from typing import Generator, Any
|
|
5
|
+
from typing import Generator, Any, Callable
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Document(DocumentInterface):
|
|
@@ -23,8 +23,8 @@ class Document(DocumentInterface):
|
|
|
23
23
|
"""Initialize a Document instance.
|
|
24
24
|
|
|
25
25
|
Args:
|
|
26
|
-
data (str
|
|
27
|
-
id (Path
|
|
26
|
+
data (str|bytes): The content of the document as string or bytes.
|
|
27
|
+
id (Path|str| None): Unique document identifier or file path.
|
|
28
28
|
mime_type (str): Document MIME type.
|
|
29
29
|
metadata (dict): Additional metadata for the document.
|
|
30
30
|
encoding (str): Character encoding of the given data.
|
|
@@ -125,12 +125,12 @@ class Document(DocumentInterface):
|
|
|
125
125
|
"""Create a document from the given data.
|
|
126
126
|
|
|
127
127
|
Args:
|
|
128
|
-
data (str
|
|
129
|
-
id (Path
|
|
128
|
+
data (str|bytes|None): Document content.
|
|
129
|
+
id (Path|str|None): Unique document identifier.
|
|
130
130
|
mime_type (str): Document MIME type.
|
|
131
131
|
encoding (str): Document character encoding.
|
|
132
132
|
binary (bool): If True, the data is treated as binary.
|
|
133
|
-
|
|
133
|
+
kwargs: Additional keyword arguments.
|
|
134
134
|
|
|
135
135
|
Returns:
|
|
136
136
|
DocumentInterface: Document object.
|
|
@@ -155,11 +155,11 @@ class Document(DocumentInterface):
|
|
|
155
155
|
"""Create a document from the given file.
|
|
156
156
|
|
|
157
157
|
Args:
|
|
158
|
-
file (Path
|
|
159
|
-
data (str
|
|
158
|
+
file (Path|str|None): Path to the file.
|
|
159
|
+
data (str|bytes|None): Document content.
|
|
160
160
|
mime_type (str): Document MIME type.
|
|
161
161
|
encoding (str): Document character encoding.
|
|
162
|
-
|
|
162
|
+
kwargs: Additional keyword arguments.
|
|
163
163
|
|
|
164
164
|
Returns:
|
|
165
165
|
DocumentInterface: Document object.
|
|
@@ -182,7 +182,7 @@ class Document(DocumentInterface):
|
|
|
182
182
|
folder: Path | str,
|
|
183
183
|
pattern: str = "**/*.txt",
|
|
184
184
|
mime_type: str = "",
|
|
185
|
-
resolve=_resolve__pass_thru,
|
|
185
|
+
resolve: Callable[[str | Path], str] = _resolve__pass_thru,
|
|
186
186
|
binary: bool = False,
|
|
187
187
|
stop_on_error: bool = False,
|
|
188
188
|
**kwargs,
|
|
@@ -199,13 +199,13 @@ class Document(DocumentInterface):
|
|
|
199
199
|
print(doc.id, doc.text)
|
|
200
200
|
```
|
|
201
201
|
Args:
|
|
202
|
-
folder (Path
|
|
202
|
+
folder (Path|str): Path to the folder.
|
|
203
203
|
pattern (str): Pattern to match files.
|
|
204
204
|
mime_type (str): Document MIME type.
|
|
205
|
-
resolve: Function to resolve the data.
|
|
205
|
+
resolve (Callable[[str|Path], str]): Function to resolve the data.
|
|
206
206
|
binary (bool): If True, the data is treated as binary.
|
|
207
207
|
stop_on_error (bool): If True, stop processing on first error.
|
|
208
|
-
|
|
208
|
+
kwargs: Additional keyword arguments.
|
|
209
209
|
|
|
210
210
|
Returns:
|
|
211
211
|
Generator[DocumentInterface, Any, None]: Generator of Document objects.
|
|
@@ -57,7 +57,7 @@ class DocumentInterface(Protocol):
|
|
|
57
57
|
"""Get the document metadata.
|
|
58
58
|
|
|
59
59
|
Returns:
|
|
60
|
-
dict[str,
|
|
60
|
+
dict[str,Any]: A dictionary containing document metadata
|
|
61
61
|
with string keys and values of any type.
|
|
62
62
|
"""
|
|
63
63
|
...
|
wowool/document/factory.py
CHANGED
|
@@ -14,8 +14,8 @@ DEFAULT_TEXT_MIME_TYPE = "plain/text"
|
|
|
14
14
|
DEFAULT_ANALYSIS_DATA_TYPE = AnalysisInputProvider.MIME_TYPE
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def _resolve__pass_thru(id):
|
|
18
|
-
return id
|
|
17
|
+
def _resolve__pass_thru(id: str | Path) -> str:
|
|
18
|
+
return str(id)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def data2str(data: Union[str, bytes, None], encoding="utf-8") -> str:
|
wowool/string/__init__.py
CHANGED
|
@@ -56,7 +56,7 @@ def _camelize(name, separator=""):
|
|
|
56
56
|
Remove spaces and replace with the separator.
|
|
57
57
|
|
|
58
58
|
Args:
|
|
59
|
-
name: The name to camelize.
|
|
59
|
+
name (str): The name to camelize.
|
|
60
60
|
separator (str): The separator to use between words.
|
|
61
61
|
|
|
62
62
|
Returns:
|
|
@@ -85,7 +85,7 @@ def initial_caps(name):
|
|
|
85
85
|
"""Capitalize the first letter of every part of a multiword.
|
|
86
86
|
|
|
87
87
|
Args:
|
|
88
|
-
name: The name to capitalize.
|
|
88
|
+
name (str): The name to capitalize.
|
|
89
89
|
|
|
90
90
|
Returns:
|
|
91
91
|
str: The string with initial capitals and spaces preserved.
|
|
@@ -113,7 +113,7 @@ def canonicalize(obj, lemmas: bool = False, dates=True, spelling=True) -> str:
|
|
|
113
113
|
"""Replace the literal or the lemmas by their canonical form. The obj can be a `Sentence` or an `Entity`.
|
|
114
114
|
|
|
115
115
|
Args:
|
|
116
|
-
obj: The annotation to be converted (Sentence or Entity).
|
|
116
|
+
obj (Sentence|Entity): The annotation to be converted (Sentence or Entity).
|
|
117
117
|
lemmas (bool): Replace using the lemma or the literal.
|
|
118
118
|
dates (bool): Whether to canonicalize dates.
|
|
119
119
|
spelling (bool): Whether to use canonical spelling corrections.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wowool-common
|
|
3
|
-
Version: 3.5.3.
|
|
3
|
+
Version: 3.5.3.dev22
|
|
4
4
|
Summary: The Wowool Common Package
|
|
5
5
|
Home-page: https://www.wowool.com/
|
|
6
6
|
Author: wowool
|
|
@@ -14,4 +14,4 @@ Requires-Dist: unidecode
|
|
|
14
14
|
Requires-Dist: beautifulsoup4
|
|
15
15
|
Requires-Dist: html5lib
|
|
16
16
|
|
|
17
|
-
The
|
|
17
|
+
The Wowool Common Package
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
wowool/config.py,sha256=Jx-uTsdDLw6jza-5W-Ds2_nU8qsB537gllZhpioIMkg,2215
|
|
2
|
-
wowool/diagnostic.py,sha256=
|
|
2
|
+
wowool/diagnostic.py,sha256=C7xE0J9Ln6qjlhmL6mX0iiKzPrni1g7VJQJ8J603f18,9895
|
|
3
3
|
wowool/error.py,sha256=UxBxA-vC_gdp0yX1qMkI_MCaW9ZNNUfq82j8ZtgeO2c,33
|
|
4
4
|
wowool/wow.py,sha256=T-_LV-hHVpm9On64eKMvKjVhD230baks1_KZ4OPA9Fg,17736
|
|
5
5
|
wowool/annotation/__init__.py,sha256=d5KPT8PFHmA_fo6rKNjq1p572_CLvRU_3ktOjib2ofc,322
|
|
6
|
-
wowool/annotation/annotation.py,sha256=
|
|
6
|
+
wowool/annotation/annotation.py,sha256=nKxKxoSHotYXOzLIbR0oPwbfT_xvB8hOELj3iIVYK8g,4121
|
|
7
7
|
wowool/annotation/concept.py,sha256=j7oXlIyy1nUOXEh6nhrUVyEVrFOFuZRZIh5nuVKp1vQ,70
|
|
8
|
-
wowool/annotation/entity.py,sha256=
|
|
9
|
-
wowool/annotation/paragraph.py,sha256=
|
|
10
|
-
wowool/annotation/sentence.py,sha256=
|
|
11
|
-
wowool/annotation/token.py,sha256=
|
|
8
|
+
wowool/annotation/entity.py,sha256=Y3DkJOKf3_OmIBX4gWmLy9qPmqj7qY0CTgLStTyQ5rM,18446
|
|
9
|
+
wowool/annotation/paragraph.py,sha256=oLlk_iLp8SgdVf8WLpB15EgUgzZP7Y5rbXA1N5HReag,5969
|
|
10
|
+
wowool/annotation/sentence.py,sha256=vw9AQGHIQxpjhVFy9jENW6gUAR4k4PoCRw1NQ-4oKas,7983
|
|
11
|
+
wowool/annotation/token.py,sha256=uSuvJtnP_TSwqdpmOh2zfsOnnGLjj6Vmrv5I9mpczNg,11887
|
|
12
12
|
wowool/apps/info.py,sha256=4lGDPR_XsNINi5yEAueT21EfX6kESpbpwBTqpwwvYCk,3218
|
|
13
13
|
wowool/common/utilities.py,sha256=bGjoD4U08-XQ9jrDa9eFGzQuzpRKSWNjqhP0UcKZRR4,640
|
|
14
14
|
wowool/common/pipeline/__init__.py,sha256=KIQ-ks9ya6ArbFzo2LoIE2Wq6QxSsDBT9t-oCOCJF-k,89
|
|
15
|
-
wowool/common/pipeline/objects.py,sha256=
|
|
15
|
+
wowool/common/pipeline/objects.py,sha256=TwspR92t9lKzkpYD_1W01P0TpDhNVAES1VEO2cRm8nQ,3152
|
|
16
16
|
wowool/document/__init__.py,sha256=nawon97OgjGoj9YOMfX32mQDLg1wLKDDk5-OhQVRD6I,126
|
|
17
17
|
wowool/document/defines.py,sha256=SSj0DYckHVayK2s2Ulb7ZcBRKVTp-E2D3W38g0Dpmqs,126
|
|
18
|
-
wowool/document/document.py,sha256=
|
|
19
|
-
wowool/document/document_interface.py,sha256=
|
|
20
|
-
wowool/document/factory.py,sha256=
|
|
18
|
+
wowool/document/document.py,sha256=ejg9gUEaBYfaPtMwFgBvo3o8QSv41ZFLZ-F6gEbHow8,6683
|
|
19
|
+
wowool/document/document_interface.py,sha256=SVG4gL2TtFQLhGKcaKIZht6rLmEYqxQpBUyoqoiIWJ0,1764
|
|
20
|
+
wowool/document/factory.py,sha256=_osK-UAlDoNdIq0nnJV8GhmSQuMQc316L0GEO9qUOPE,10831
|
|
21
21
|
wowool/document/serialize.py,sha256=AD2G6vlVSgLcuvWRxv-xD5SbziC9rI3HIujyAwG7qn4,2631
|
|
22
22
|
wowool/document/analysis/analysis_parser.py,sha256=_d6b5_aDvgg6XtCCVnNoXGL58bT0irIgbXUAAoaUtys,4036
|
|
23
|
-
wowool/document/analysis/document.py,sha256=
|
|
23
|
+
wowool/document/analysis/document.py,sha256=FzVS1VtY0p9ROtiGS8bN0e-mn3YXEkr1iRdLALFHQys,20803
|
|
24
24
|
wowool/document/analysis/document_format_exception.py,sha256=5AJxZFgyCD3u13QZioQRiuqKo-OD9Le_B_kzHrC5HrE,307
|
|
25
25
|
wowool/document/analysis/text_analysis.py,sha256=6sMZxcNAdjsVZyKiOm9TvfJzL41soVkG75vIQWcupoI,9389
|
|
26
26
|
wowool/document/analysis/utilities.py,sha256=t59v-Z_tpQsSHr8Ys5miMcZMgIKEuC21xGWXyZGUbJU,170
|
|
27
|
-
wowool/document/analysis/apps/anonymizer.py,sha256=
|
|
28
|
-
wowool/document/analysis/apps/chunks.py,sha256=
|
|
27
|
+
wowool/document/analysis/apps/anonymizer.py,sha256=LrOn4bDjJ4UfK00qTYgYvq8lTppZf5p3DVh80r_SDjs,1837
|
|
28
|
+
wowool/document/analysis/apps/chunks.py,sha256=lmWTYKEoeV7JYy7ON_xuagceW46P4pymc2qxG4edt2A,1473
|
|
29
29
|
wowool/document/analysis/apps/entity_graph.py,sha256=EFBjs8Sev_XTGmDq6woNQrKrSvHq-1I6YBRaqxp_Sbg,929
|
|
30
|
-
wowool/document/analysis/apps/lid.py,sha256=
|
|
31
|
-
wowool/document/analysis/apps/sentiments.py,sha256=
|
|
30
|
+
wowool/document/analysis/apps/lid.py,sha256=ba0J3zqGDzPdfFAHUUun05MQHggwdTbjdh_J2JRI37g,2442
|
|
31
|
+
wowool/document/analysis/apps/sentiments.py,sha256=Wk9OVhSBkKZdJab8_DiaoQHZnVEIS6R4XDpzGBh0Ovw,2866
|
|
32
32
|
wowool/document/analysis/apps/themes.py,sha256=ag2_qzsExpTPEs0XlZ9d-0nTAZb1eFtILuxdtEPf7EI,688
|
|
33
33
|
wowool/document/analysis/apps/topics.py,sha256=MPL63PQ4Dvz61uLoL9x4vI6yT0WJNXGeDBcORilpvLY,688
|
|
34
34
|
wowool/io/console/__init__.py,sha256=1oRysDXK854buv7t-3PHSg_fM6U4hfPsUxGk0asYKco,56
|
|
@@ -44,7 +44,7 @@ wowool/io/provider/html_v2.py,sha256=wTAAy1QDoTQX9Zjk2uXQyCsAuNMK7H1sGA8rfaYyDFY
|
|
|
44
44
|
wowool/io/provider/pdf_no_layout.py,sha256=BdUDB8et22m8-HlWprUqlIT8voSy3Cj0zUHfcwilnPY,1168
|
|
45
45
|
wowool/io/provider/rtf.py,sha256=i_5aDx-7EybCKyD4mRHCCoXvBhqmofUEwgnWspryDdk,966
|
|
46
46
|
wowool/io/provider/str.py,sha256=EcLLOv-h3MsDDPvi9aFxmt89tXH6QbOgQhyKoQBTciE,946
|
|
47
|
-
wowool/string/__init__.py,sha256=
|
|
47
|
+
wowool/string/__init__.py,sha256=63WNqP5M_nH_14rNAVsDtD0AFr04pfLWp0nCLfVxmf8,6725
|
|
48
48
|
wowool/tool/woc/create.py,sha256=7qSBqtdh52Q5fu7Eue06oAkWBlH0SM7KCvBDT_1Ncho,1307
|
|
49
49
|
wowool/utility/__init__.py,sha256=uOJsrXHMYnTRJLej2GqHnuQ6jO1SkFJChGLKRKaRIKk,318
|
|
50
50
|
wowool/utility/default_arguments.py,sha256=0MPUaGxD0D-O5nJHnpH9ti7pcIVP8jgJbifDoJSKlfQ,1692
|
|
@@ -59,7 +59,7 @@ wowool/utility/mime_type/mime_type.py,sha256=3U3U6Adgj3lMbxumxmrKoTplVLCt-gQgajr
|
|
|
59
59
|
wowool/utility/path/__init__.py,sha256=8fzkUt2NwTbeoIjCUVR8tPgvHrCWLXaxXKZlC0oa_xQ,63
|
|
60
60
|
wowool/utility/path/path.py,sha256=6LSPGXUyiYtKP_7LzxDaHUq0UYGIg-Zvgvpc2fdJBA8,285
|
|
61
61
|
wowool/utility/text/cleanup.py,sha256=vN6I9n5PJN2EEhTaxyD2_jSVJ_BGI3EGaMr06LvgRT0,2886
|
|
62
|
-
wowool_common-3.5.3.
|
|
63
|
-
wowool_common-3.5.3.
|
|
64
|
-
wowool_common-3.5.3.
|
|
65
|
-
wowool_common-3.5.3.
|
|
62
|
+
wowool_common-3.5.3.dev22.dist-info/METADATA,sha256=Bc-gJb_yrnw26etapZyS9ml-t_vDwjxSMOfxg85u-FI,421
|
|
63
|
+
wowool_common-3.5.3.dev22.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
64
|
+
wowool_common-3.5.3.dev22.dist-info/top_level.txt,sha256=zerqoDN-iHSHwsS1SN2h0q4H6RI1FOVeHW8fNQC9YdU,7
|
|
65
|
+
wowool_common-3.5.3.dev22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|