wowool-common 3.1.3.dev1__py3-none-any.whl → 3.1.3.dev3__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.

@@ -1,5 +1,6 @@
1
1
  from io import StringIO
2
2
  from wowool.annotation.annotation import BasicAnnotation
3
+ from wowool.annotation.token import Token
3
4
  from wowool.annotation.entity import Entity
4
5
  from typing import Callable, Iterator, Self
5
6
 
@@ -35,7 +36,7 @@ class Sentence(BasicAnnotation):
35
36
  self.annotations = []
36
37
  self.text_ = None
37
38
  self.attributes = {}
38
- self.tokens_ = None
39
+ self.tokens_: list[Token] | None = None
39
40
 
40
41
  def rich(self) -> str:
41
42
  """
@@ -86,7 +87,7 @@ class Sentence(BasicAnnotation):
86
87
  return len(self.annotations)
87
88
 
88
89
  @property
89
- def tokens(self):
90
+ def tokens(self) -> list[Token]:
90
91
  if self.tokens_ is None:
91
92
  self.tokens_ = [a for a in self.annotations if a.is_token]
92
93
  return self.tokens_
@@ -40,7 +40,7 @@ class Analysis:
40
40
  ID = APP_ID
41
41
 
42
42
  @staticmethod
43
- def parse(json_data: Union[dict, str], id=None):
43
+ def parse(json_data: Union[dict, str], id=None) -> "Analysis":
44
44
  """
45
45
  Create an :class:`Analysis` instance from JSON (``dict``) data such as that returned from the Portal API.
46
46
 
@@ -286,6 +286,7 @@ class AnalysisDocument(DocumentInterface):
286
286
  output.write(str(self.analysis))
287
287
  else:
288
288
  output.write(self.__repr__())
289
+ output.write("\n")
289
290
 
290
291
  # print the rest of the applications.
291
292
  for app_id, app_data in self._apps.items():
@@ -70,7 +70,7 @@ class FileInputProvider(DocumentInterface):
70
70
  except ImportError:
71
71
  raise RuntimeError("install the chardet library, 'on macos: brew install libmagic ; pip3 install filemagic'")
72
72
 
73
- self.encoding = filemagic.id_filename(self.id())
73
+ self.encoding = filemagic.id_filename(self.id)
74
74
  if self.encoding == "binary":
75
75
  # print(f"self.cleanup.................{self.cleanup}")
76
76
  if self.cleanup is None:
@@ -78,7 +78,7 @@ class FileInputProvider(DocumentInterface):
78
78
  try:
79
79
  if self.encoding == "unknown-8bit":
80
80
  print(f"Warning: unknown encoding using ascii : {self.id}")
81
- with open(self.id(), "rb") as f:
81
+ with open(self.id, "rb") as f:
82
82
  r = f.read()
83
83
  if self.cleanup:
84
84
  return self.cache_it(self.cleanup(r))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wowool-common
3
- Version: 3.1.3.dev1
3
+ Version: 3.1.3.dev3
4
4
  Summary: The Wowool Common Package
5
5
  Home-page: https://www.wowool.com/
6
6
  Author: wowool
@@ -8,7 +8,7 @@ wowool/annotation/annotation.py,sha256=mmQEbQmjB2vS9Zn_qLlRIOso81__i8Pyaxg9Vi99_
8
8
  wowool/annotation/concept.py,sha256=j7oXlIyy1nUOXEh6nhrUVyEVrFOFuZRZIh5nuVKp1vQ,70
9
9
  wowool/annotation/entity.py,sha256=3Lf9pMVFcTO7kl7T0W0Wo05duZclxx8X0MY_CQrOEo8,15812
10
10
  wowool/annotation/paragraph.py,sha256=kk5VxMUC6o-GHDAAp1LP8rfj7u2YhZ3xxckhzCNf62o,5642
11
- wowool/annotation/sentence.py,sha256=qI0Oz0gPtRa25btOYEDoal9jxi4Rey5ItlbrOUaLz0k,8947
11
+ wowool/annotation/sentence.py,sha256=SEUzpOyuZdSxPCekleu4qIP545h9fOjM-i9eTGJgeRU,9024
12
12
  wowool/annotation/token.py,sha256=rdQuzgTr5RsYuL5vRk6vRTSD5oywKmoekWy9GcYih00,8422
13
13
  wowool/apps/info.py,sha256=4lGDPR_XsNINi5yEAueT21EfX6kESpbpwBTqpwwvYCk,3218
14
14
  wowool/common/utilities.py,sha256=HEONm63nESP5LIxAhWNTT--bMhDk5_C_ziNMuBBdjtA,326
@@ -20,9 +20,9 @@ wowool/document/document.py,sha256=kbymyAdFVX6UmiNm2RytIzHGQqYBVCQhdbnK6JSnUu0,4
20
20
  wowool/document/document_interface.py,sha256=lZm7hmT5kc1rj2067PvZW5xKLgkRK7ljpWkMiLe7P-Y,816
21
21
  wowool/document/factory.py,sha256=DgLrpHZBtnw89TSMWpCjVJVZteBUAyJvAMctNYVD4oY,10447
22
22
  wowool/document/serialize.py,sha256=cDUrSp0J44DbZzHdqsmeI56bghV7D-EUs_2M0DL9CPM,1601
23
- wowool/document/analysis/analysis.py,sha256=DNp42cQAwwzs6H8pLHvi7hZRQ4C6SWPhicFo26a3OEA,9159
23
+ wowool/document/analysis/analysis.py,sha256=o3sFVhVKhj2BP8ySyJ28Iw4SbvdQx0VeTJ6PYr7uYTQ,9173
24
24
  wowool/document/analysis/analysis_parser.py,sha256=RiU7bWlBLOlf4s41cwZfuzA_i_iuTgDoMuV_SByRdtM,3723
25
- wowool/document/analysis/document.py,sha256=Z0cDkY6JC0dU4vcR308vfuhwiOHDXb3y1crbAfD-NNA,14323
25
+ wowool/document/analysis/document.py,sha256=FkpCKDoL2f8Mw2E-YlPeO6zDnwjpRehm58SsewklxzY,14358
26
26
  wowool/document/analysis/apps/chunks.py,sha256=gQKzQkuxCYlbsyQT3QCoHymBQX_lIUsTwaah3AOFvLE,629
27
27
  wowool/document/analysis/apps/themes.py,sha256=YPgcXQc1VimVkfsNywr_oHeDSuEbhtz6SNRYkZzu7AU,198
28
28
  wowool/document/analysis/apps/topics.py,sha256=qAhbXyjvhK_Y0t5ffelEpZvcqlbylcmu85Q_LZ1_mwQ,198
@@ -32,7 +32,7 @@ wowool/io/console/console.py,sha256=W8Hs3HTe0GIR8AcGLxwYEKs7GnZ1BIsW06X-ChIoGbQ,
32
32
  wowool/io/provider/__init__.py,sha256=hTUFPiirYqaEYFS51SrhJqk0aFXxBJFaZ0H8E5E73ws,66
33
33
  wowool/io/provider/docx.py,sha256=siXUvY9vyQ9WQYGMjmOvH4q9SA2gfRpfiArua-0f9q8,1129
34
34
  wowool/io/provider/factory.py,sha256=DaRWieg31pWQtwMRfOFRO4xsh8N5ba2CGQEI8SS190s,5639
35
- wowool/io/provider/file.py,sha256=cpnkEfZvOC4Nh4b1FptBczcOGUvFMegpXr6t_if8BA4,3327
35
+ wowool/io/provider/file.py,sha256=q3qycu2TLqeyUozMmJYleCA9AkT_WkWhY6LD4eUZoaM,3323
36
36
  wowool/io/provider/html_v2.py,sha256=E6LbDCcS6hJbkpb42S_qsgPXvdyLL7EZRZM-Y8lgNfM,14170
37
37
  wowool/io/provider/pdf_no_layout.py,sha256=BdUDB8et22m8-HlWprUqlIT8voSy3Cj0zUHfcwilnPY,1168
38
38
  wowool/io/provider/raw.py,sha256=Puqa_w0unDQq-1SMMrduyD9kOJOOsA8w6KritssVGYY,1027
@@ -52,7 +52,7 @@ wowool/utility/iterators/__init__.py,sha256=oOnKogPeE-Yhky1lTsX1cEgYnWORdF-iqSTN
52
52
  wowool/utility/path/__init__.py,sha256=8fzkUt2NwTbeoIjCUVR8tPgvHrCWLXaxXKZlC0oa_xQ,63
53
53
  wowool/utility/path/path.py,sha256=6LSPGXUyiYtKP_7LzxDaHUq0UYGIg-Zvgvpc2fdJBA8,285
54
54
  wowool/utility/text/cleanup.py,sha256=vN6I9n5PJN2EEhTaxyD2_jSVJ_BGI3EGaMr06LvgRT0,2886
55
- wowool_common-3.1.3.dev1.dist-info/METADATA,sha256=BJKySQyqKJiVHPSGINQ9Y2NWOfhZ5idnWIBMqgQYpbE,229
56
- wowool_common-3.1.3.dev1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
57
- wowool_common-3.1.3.dev1.dist-info/top_level.txt,sha256=zerqoDN-iHSHwsS1SN2h0q4H6RI1FOVeHW8fNQC9YdU,7
58
- wowool_common-3.1.3.dev1.dist-info/RECORD,,
55
+ wowool_common-3.1.3.dev3.dist-info/METADATA,sha256=zelkJ7CdlWoi5JMZ4Ux70EzMvLLbdR7Jvmj5KpcZiIA,229
56
+ wowool_common-3.1.3.dev3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
57
+ wowool_common-3.1.3.dev3.dist-info/top_level.txt,sha256=zerqoDN-iHSHwsS1SN2h0q4H6RI1FOVeHW8fNQC9YdU,7
58
+ wowool_common-3.1.3.dev3.dist-info/RECORD,,