decider-con 1.0.0__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.
Files changed (51) hide show
  1. decider_con-1.0.0/PKG-INFO +30 -0
  2. decider_con-1.0.0/README +1 -0
  3. decider_con-1.0.0/chapter_/__init__.py +15 -0
  4. decider_con-1.0.0/chapter_/cli.py +50 -0
  5. decider_con-1.0.0/chapter_/features/__init__.py +8 -0
  6. decider_con-1.0.0/chapter_/features/intro.py +71 -0
  7. decider_con-1.0.0/chapter_/path.py +14 -0
  8. decider_con-1.0.0/decider_con/__init__.py +16 -0
  9. decider_con-1.0.0/decider_con.egg-info/PKG-INFO +30 -0
  10. decider_con-1.0.0/decider_con.egg-info/SOURCES.txt +49 -0
  11. decider_con-1.0.0/decider_con.egg-info/dependency_links.txt +1 -0
  12. decider_con-1.0.0/decider_con.egg-info/entry_points.txt +4 -0
  13. decider_con-1.0.0/decider_con.egg-info/requires.txt +17 -0
  14. decider_con-1.0.0/decider_con.egg-info/top_level.txt +4 -0
  15. decider_con-1.0.0/pyproject.toml +119 -0
  16. decider_con-1.0.0/setup.cfg +4 -0
  17. decider_con-1.0.0/smarty_/__init__.py +22 -0
  18. decider_con-1.0.0/smarty_/cli.py +55 -0
  19. decider_con-1.0.0/smarty_/driver.py +97 -0
  20. decider_con-1.0.0/smarty_/features/__init__.py +8 -0
  21. decider_con-1.0.0/smarty_/features/badwords.py +126 -0
  22. decider_con-1.0.0/smarty_/features/spelling.py +82 -0
  23. decider_con-1.0.0/smarty_/path.py +30 -0
  24. decider_con-1.0.0/smarty_/utils.py +18 -0
  25. decider_con-1.0.0/tests/test_validate.py +79 -0
  26. decider_con-1.0.0/textflow_/__init__.py +22 -0
  27. decider_con-1.0.0/textflow_/__patch__.py +21 -0
  28. decider_con-1.0.0/textflow_/cli.py +132 -0
  29. decider_con-1.0.0/textflow_/docref/__init__.py +8 -0
  30. decider_con-1.0.0/textflow_/docref/basic.py +107 -0
  31. decider_con-1.0.0/textflow_/docref/matches.py +193 -0
  32. decider_con-1.0.0/textflow_/docref/style.py +71 -0
  33. decider_con-1.0.0/textflow_/features/__init__.py +166 -0
  34. decider_con-1.0.0/textflow_/features/abbrev.py +107 -0
  35. decider_con-1.0.0/textflow_/features/character.py +460 -0
  36. decider_con-1.0.0/textflow_/features/docref.py +69 -0
  37. decider_con-1.0.0/textflow_/features/lineending.py +260 -0
  38. decider_con-1.0.0/textflow_/features/paragraph.py +118 -0
  39. decider_con-1.0.0/textflow_/features/physical.py +109 -0
  40. decider_con-1.0.0/textflow_/features/quotation.py +169 -0
  41. decider_con-1.0.0/textflow_/features/startend.py +237 -0
  42. decider_con-1.0.0/textflow_/features/writing.py +263 -0
  43. decider_con-1.0.0/textflow_/path.py +75 -0
  44. decider_con-1.0.0/textflow_/startend/__init__.py +8 -0
  45. decider_con-1.0.0/textflow_/startend/hurenkind.py +67 -0
  46. decider_con-1.0.0/textflow_/utils.py +100 -0
  47. decider_con-1.0.0/textflow_/writing/__init__.py +8 -0
  48. decider_con-1.0.0/textflow_/writing/complexity.py +21 -0
  49. decider_con-1.0.0/textflow_/writing/perspective.py +62 -0
  50. decider_con-1.0.0/textflow_/writing/statistics.py +64 -0
  51. decider_con-1.0.0/textflow_/writing/utils.py +46 -0
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: decider-con
3
+ Version: 1.0.0
4
+ Author-email: Helmut Konrad Schewe <helmutus@outlook.com>
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/anaticulae/decider-con
7
+ Project-URL: Repository, https://github.com/anaticulae/decider-con
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Requires-Python: >=3.12
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: callidus<2.0.0,>=1.7.1
14
+ Requires-Dist: configos<2.0.0,>=1.0.4
15
+ Requires-Dist: decider_chapter<2.0.0,>=1.0.1
16
+ Requires-Dist: germania<2.0.0,>=1.32.2
17
+ Requires-Dist: iamraw<5.0.0,>=4.95.0
18
+ Requires-Dist: konradus<2.0.0,>=1.0.1
19
+ Requires-Dist: protoerror<4.0.0,>=3.20.4
20
+ Requires-Dist: texes<2.0.0,>=1.0.1
21
+ Requires-Dist: utilo<3.0.0,>=2.111.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: capita==1.25.3; extra == "dev"
24
+ Requires-Dist: capita_ref==1.0.1; extra == "dev"
25
+ Requires-Dist: gennex==1.1.0; extra == "dev"
26
+ Requires-Dist: hoverpower==1.7.0; extra == "dev"
27
+ Requires-Dist: utilotest==1.1.1; extra == "dev"
28
+ Requires-Dist: writers<2.0.0,>=1.7.1; extra == "dev"
29
+
30
+ # decider_con
@@ -0,0 +1 @@
1
+ # decider_con
@@ -0,0 +1,15 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import decider_con
11
+
12
+ __version__ = decider_con.__version__
13
+
14
+ PROCESS = 'chapter_'
15
+ ROOT = decider_con.ROOT
@@ -0,0 +1,50 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import protoerror
11
+ import utilo
12
+
13
+ import chapter_
14
+ import chapter_.path
15
+
16
+ DESCRIPTION = ''
17
+
18
+ WORKPLAN = [
19
+ utilo.create_step(
20
+ 'intro',
21
+ inputs=[
22
+ utilo.ResultFile('chapter', 'intro_intro'),
23
+ ],
24
+ output=protoerror.ResultDefault,
25
+ ),
26
+ ]
27
+
28
+
29
+ def main():
30
+ hook = protoerror.integrate(
31
+ root=chapter_.ROOT,
32
+ features='chapter_.features',
33
+ )
34
+ docinfo = protoerror.integrate_docinfo()
35
+ utilo.featurepack(
36
+ workplan=WORKPLAN,
37
+ root=chapter_.ROOT,
38
+ featurepackage='chapter_.features',
39
+ config=utilo.FeaturePackConfig(
40
+ cli_hook=[
41
+ docinfo,
42
+ hook,
43
+ ],
44
+ description=DESCRIPTION,
45
+ multiprocessed=True,
46
+ name=chapter_.PROCESS,
47
+ pages=True,
48
+ version=chapter_.__version__,
49
+ ),
50
+ )
@@ -0,0 +1,8 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
@@ -0,0 +1,71 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import functools
11
+
12
+ import chapter.serialize
13
+ import configos
14
+ import iamraw
15
+ import protoerror
16
+
17
+
18
+ def work(introx: str, docinfo: iamraw.DocInfo) -> protoerror.ResultType:
19
+ intro = chapter.serialize.load_chapter_introinfo(introx)
20
+ driver = protoerror.driver(intro=intro)
21
+ user, developer = protoerror.run(
22
+ __name__,
23
+ driver=driver,
24
+ document=docinfo,
25
+ )
26
+ return user, developer
27
+
28
+
29
+ SOLUTION_6500 = """\
30
+ Einleitung unvollständig
31
+
32
+ Überprüfen Sie die Einleitung und achten darauf dass der Bereich: \
33
+ **{{topic}}** ausreichend dargestellt ist.
34
+
35
+ Siehe optimaler Aufbau:
36
+ {aufbau_gliederung/kapitel1}
37
+
38
+ TODO: ADD AI-USED HINT
39
+ """
40
+
41
+ TOKEN_OCCURRENCE_MIN = configos.HV_INT_PLUS(default=3)
42
+
43
+
44
+ @protoerror.german # TODO REMOVE LATER
45
+ @protoerror.nodiss
46
+ @protoerror.nobook
47
+ @protoerror.nosmall
48
+ def check_6500_intro_complete(linter: callable, driver):
49
+ intro = driver.intro
50
+ if driver.intro.pagestart is None:
51
+ protoerror.skip_method('no intro loaded')
52
+ return
53
+ # 'start', 'goal', 'method', 'limit', 'structure'
54
+ start = len(intro.start) >= TOKEN_OCCURRENCE_MIN
55
+ goal = len(intro.goal) >= TOKEN_OCCURRENCE_MIN
56
+ method = len(intro.method) >= TOKEN_OCCURRENCE_MIN
57
+ limit = len(intro.limit) >= TOKEN_OCCURRENCE_MIN
58
+ structure = len(intro.structure) >= TOKEN_OCCURRENCE_MIN
59
+
60
+ location = iamraw.Location.from_page(page=driver.intro.pagestart)
61
+ linter = functools.partial(linter, location=location)
62
+ if not start:
63
+ linter(topic='Hinführung zum Thema')
64
+ if not goal:
65
+ linter(topic='Ziel der Arbeit')
66
+ if not method:
67
+ linter(topic='Beschreibung der Methodik')
68
+ if not limit:
69
+ linter(topic='Abgrenzung der Arbeit')
70
+ if not structure:
71
+ linter(topic='Aufbau der Arbeit')
@@ -0,0 +1,14 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import utilo
11
+
12
+
13
+ def chapter__intro(path: str, prefix: str = '') -> str:
14
+ return utilo.pathconnector(path, 'chapter_', 'intro_user', prefix)
@@ -0,0 +1,16 @@
1
+ #==============================================================================
2
+ # C O P Y R I G H T
3
+ #------------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ #==============================================================================
9
+
10
+ import importlib.metadata
11
+ import os
12
+
13
+ __version__ = importlib.metadata.version('decider-con')
14
+
15
+ ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
16
+ PROCESS = 'decider_con'
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: decider-con
3
+ Version: 1.0.0
4
+ Author-email: Helmut Konrad Schewe <helmutus@outlook.com>
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/anaticulae/decider-con
7
+ Project-URL: Repository, https://github.com/anaticulae/decider-con
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Requires-Python: >=3.12
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: callidus<2.0.0,>=1.7.1
14
+ Requires-Dist: configos<2.0.0,>=1.0.4
15
+ Requires-Dist: decider_chapter<2.0.0,>=1.0.1
16
+ Requires-Dist: germania<2.0.0,>=1.32.2
17
+ Requires-Dist: iamraw<5.0.0,>=4.95.0
18
+ Requires-Dist: konradus<2.0.0,>=1.0.1
19
+ Requires-Dist: protoerror<4.0.0,>=3.20.4
20
+ Requires-Dist: texes<2.0.0,>=1.0.1
21
+ Requires-Dist: utilo<3.0.0,>=2.111.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: capita==1.25.3; extra == "dev"
24
+ Requires-Dist: capita_ref==1.0.1; extra == "dev"
25
+ Requires-Dist: gennex==1.1.0; extra == "dev"
26
+ Requires-Dist: hoverpower==1.7.0; extra == "dev"
27
+ Requires-Dist: utilotest==1.1.1; extra == "dev"
28
+ Requires-Dist: writers<2.0.0,>=1.7.1; extra == "dev"
29
+
30
+ # decider_con
@@ -0,0 +1,49 @@
1
+ README
2
+ pyproject.toml
3
+ chapter_/__init__.py
4
+ chapter_/cli.py
5
+ chapter_/path.py
6
+ chapter_/features/__init__.py
7
+ chapter_/features/intro.py
8
+ decider_con/__init__.py
9
+ decider_con.egg-info/PKG-INFO
10
+ decider_con.egg-info/SOURCES.txt
11
+ decider_con.egg-info/dependency_links.txt
12
+ decider_con.egg-info/entry_points.txt
13
+ decider_con.egg-info/requires.txt
14
+ decider_con.egg-info/top_level.txt
15
+ smarty_/__init__.py
16
+ smarty_/cli.py
17
+ smarty_/driver.py
18
+ smarty_/path.py
19
+ smarty_/utils.py
20
+ smarty_/features/__init__.py
21
+ smarty_/features/badwords.py
22
+ smarty_/features/spelling.py
23
+ tests/test_validate.py
24
+ textflow_/__init__.py
25
+ textflow_/__patch__.py
26
+ textflow_/cli.py
27
+ textflow_/path.py
28
+ textflow_/utils.py
29
+ textflow_/docref/__init__.py
30
+ textflow_/docref/basic.py
31
+ textflow_/docref/matches.py
32
+ textflow_/docref/style.py
33
+ textflow_/features/__init__.py
34
+ textflow_/features/abbrev.py
35
+ textflow_/features/character.py
36
+ textflow_/features/docref.py
37
+ textflow_/features/lineending.py
38
+ textflow_/features/paragraph.py
39
+ textflow_/features/physical.py
40
+ textflow_/features/quotation.py
41
+ textflow_/features/startend.py
42
+ textflow_/features/writing.py
43
+ textflow_/startend/__init__.py
44
+ textflow_/startend/hurenkind.py
45
+ textflow_/writing/__init__.py
46
+ textflow_/writing/complexity.py
47
+ textflow_/writing/perspective.py
48
+ textflow_/writing/statistics.py
49
+ textflow_/writing/utils.py
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ chapter = chapter_.cli:main
3
+ smarty = smarty_.cli:main
4
+ textflow = textflow_.cli:main
@@ -0,0 +1,17 @@
1
+ callidus<2.0.0,>=1.7.1
2
+ configos<2.0.0,>=1.0.4
3
+ decider_chapter<2.0.0,>=1.0.1
4
+ germania<2.0.0,>=1.32.2
5
+ iamraw<5.0.0,>=4.95.0
6
+ konradus<2.0.0,>=1.0.1
7
+ protoerror<4.0.0,>=3.20.4
8
+ texes<2.0.0,>=1.0.1
9
+ utilo<3.0.0,>=2.111.0
10
+
11
+ [dev]
12
+ capita==1.25.3
13
+ capita_ref==1.0.1
14
+ gennex==1.1.0
15
+ hoverpower==1.7.0
16
+ utilotest==1.1.1
17
+ writers<2.0.0,>=1.7.1
@@ -0,0 +1,4 @@
1
+ chapter_
2
+ decider_con
3
+ smarty_
4
+ textflow_
@@ -0,0 +1,119 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=83.0.0",
4
+ "wheel>=0.47.0",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "decider-con"
10
+ version = "1.0.0"
11
+ description = ""
12
+ requires-python = ">=3.12"
13
+ authors = [
14
+ { name = "Helmut Konrad Schewe", email = "helmutus@outlook.com" },
15
+ ]
16
+ dependencies = [
17
+ "callidus>=1.7.1,<2.0.0",
18
+ "configos>=1.0.4,<2.0.0",
19
+ "decider_chapter>=1.0.1,<2.0.0",
20
+ "germania>=1.32.2,<2.0.0",
21
+ "iamraw>=4.95.0,<5.0.0",
22
+ "konradus>=1.0.1,<2.0.0",
23
+ "protoerror>=3.20.4,<4.0.0",
24
+ "texes>=1.0.1,<2.0.0",
25
+ "utilo>=2.111.0,<3.0.0",
26
+ ]
27
+ keywords = []
28
+ classifiers = [
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ ]
33
+ license = "MIT"
34
+ license-files = [
35
+ "LICENSE",
36
+ ]
37
+
38
+ [project.readme]
39
+ file = "README"
40
+ content-type = "text/markdown"
41
+
42
+ [project.optional-dependencies]
43
+ dev = [
44
+ "capita==1.25.3",
45
+ "capita_ref==1.0.1",
46
+ "gennex==1.1.0",
47
+ "hoverpower==1.7.0",
48
+ "utilotest==1.1.1",
49
+ "writers>=1.7.1,<2.0.0",
50
+ ]
51
+
52
+ [project.urls]
53
+ Homepage = "https://github.com/anaticulae/decider-con"
54
+ Repository = "https://github.com/anaticulae/decider-con"
55
+
56
+ [project.scripts]
57
+ chapter = "chapter_.cli:main"
58
+ smarty = "smarty_.cli:main"
59
+ textflow = "textflow_.cli:main"
60
+
61
+ [tool.semantic_release]
62
+ version_toml = [
63
+ "pyproject.toml:project.version",
64
+ ]
65
+
66
+ [tool.semantic_release.changelog]
67
+ mode = "init"
68
+ output_format = "md"
69
+
70
+ [tool.semantic_release.changelog.default_templates]
71
+ changelog_file = "CHANGELOG"
72
+
73
+ [tool.semantic_release.commit_parser_options]
74
+ patch_tags = [
75
+ "build",
76
+ "chore",
77
+ "ci",
78
+ "deps",
79
+ "docs",
80
+ "fix",
81
+ "perf",
82
+ "refactor",
83
+ "style",
84
+ "test",
85
+ ]
86
+ minor_tags = [
87
+ "feat",
88
+ ]
89
+
90
+ [tool.setuptools.packages.find]
91
+ where = [
92
+ ".",
93
+ ]
94
+ include = [
95
+ "chapter_",
96
+ "chapter_.features",
97
+ "decider_con",
98
+ "smarty_",
99
+ "smarty_.features",
100
+ "textflow_",
101
+ "textflow_.docref",
102
+ "textflow_.features",
103
+ "textflow_.startend",
104
+ "textflow_.writing",
105
+ ]
106
+ exclude = [
107
+ "tests*",
108
+ ]
109
+
110
+ [tool.hoverpower]
111
+ packages = [
112
+ "BACHELOR",
113
+ "BOOK",
114
+ "DISS",
115
+ "DOCU",
116
+ "HOME",
117
+ "MASTER",
118
+ "TECH",
119
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,22 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import configos
11
+
12
+ import decider_con
13
+ import smarty_.path
14
+
15
+ ROOT = decider_con.ROOT
16
+
17
+ __version__ = decider_con.__version__
18
+
19
+ PACKAGE = 'smarty_'
20
+ PROCESS = 'smarty_'
21
+
22
+ configos.cloud_lookup(PROCESS)
@@ -0,0 +1,55 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import protoerror
11
+ import utilo
12
+
13
+ import smarty_
14
+
15
+ DESCRIPTION = ''
16
+
17
+ WORKPLAN = [
18
+ utilo.create_step(
19
+ 'badwords',
20
+ inputs=[
21
+ utilo.ResultFile('smarty', 'avoid_avoid'),
22
+ utilo.ResultFile('smarty', 'improvement_improvement'),
23
+ utilo.ResultFile('smarty', 'phrases_phrases'),
24
+ utilo.ResultFile('smarty', 'pleonasma_pleonasma'),
25
+ utilo.ResultFile('smarty', 'reduce_reduce'),
26
+ ],
27
+ output=protoerror.ResultDefault,
28
+ ),
29
+ utilo.create_step(
30
+ 'spelling',
31
+ inputs=[
32
+ utilo.ResultFile('smarty', 'spelling_hyphen'),
33
+ utilo.ResultFile('smarty', 'spelling_guess'),
34
+ ],
35
+ output=protoerror.ResultDefault,
36
+ ),
37
+ ]
38
+
39
+
40
+ def main():
41
+ root, features = smarty_.ROOT, 'smarty_.features'
42
+ hook = protoerror.integrate(root=root, features=features)
43
+ utilo.featurepack(
44
+ workplan=WORKPLAN,
45
+ featurepackage=features,
46
+ root=root,
47
+ config=utilo.FeaturePackConfig(
48
+ description=DESCRIPTION,
49
+ cli_hook=hook,
50
+ multiprocessed=True,
51
+ name=smarty_.PROCESS,
52
+ pages=True,
53
+ version=smarty_.__version__,
54
+ ),
55
+ )
@@ -0,0 +1,97 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2021-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================
9
+
10
+ import collections
11
+
12
+ import protoerror
13
+ import serializeraw
14
+ import utilo
15
+
16
+
17
+ def create(
18
+ avoid: str = None,
19
+ improvement: str = None,
20
+ phrases: str = None,
21
+ pleonasma: str = None,
22
+ reduce: str = None,
23
+ pages: tuple = None,
24
+ ):
25
+ # prepare findings
26
+ avoid = load_textadvice(avoid, pages=pages)
27
+ improvement = load_textadvice(improvement, pages=pages)
28
+ phrases = load_textadvice(phrases, pages=pages)
29
+ pleonasma = load_textadvice(pleonasma, pages=pages)
30
+ reduce = load_textadvice(reduce, pages=pages)
31
+ # driver
32
+ driver = protoerror.driver(
33
+ avoid=avoid,
34
+ improvement=improvement,
35
+ phrases=phrases,
36
+ pleonasma=pleonasma,
37
+ reduce=reduce,
38
+ )
39
+ return driver
40
+
41
+
42
+ def load_textadvice(path: str, pages: tuple = None):
43
+ if not utilo.exists(path):
44
+ return None
45
+ result = serializeraw.load_textadvices(path, pages=pages)
46
+ return result
47
+
48
+
49
+ def create_spelling(hyphen: str, guess: str, pages: tuple):
50
+ hyphen = load_textadvice(hyphen, pages)
51
+ if not hyphen:
52
+ hyphen = []
53
+ guess = load_textadvice(guess, pages)
54
+ if not guess:
55
+ guess = []
56
+ result = protoerror.driver(
57
+ hyphen=hyphen,
58
+ guess=guess,
59
+ )
60
+ return result
61
+
62
+
63
+ class TokenInside:
64
+ """\
65
+ >>> ti = TokenInside()
66
+ >>> ti.add(5,4,3)
67
+ >>> ti.add(6,2,6)
68
+ >>> ti.contains(6,2,6)
69
+ True
70
+ >>> ti.contains(0,2,6)
71
+ False
72
+ """
73
+
74
+ def __init__(self):
75
+ self.pages = collections.defaultdict(dict)
76
+
77
+ def add(self, page, sentence, token):
78
+ try:
79
+ self.pages[page][sentence].add(token)
80
+ except KeyError:
81
+ self.pages[page][sentence] = {token}
82
+
83
+ def contains(self, page, sentence, token) -> bool:
84
+ try:
85
+ return token in self.pages[page][sentence]
86
+ except KeyError:
87
+ return False
88
+
89
+
90
+ def create_tokeninside(hyphens) -> TokenInside:
91
+ overlapping = TokenInside()
92
+ for hyphen in hyphens:
93
+ docref = hyphen.docref
94
+ for item in docref.marked:
95
+ for token in utilo.rlist(*item):
96
+ overlapping.add(docref.page, docref.sentence, token)
97
+ return overlapping
@@ -0,0 +1,8 @@
1
+ # =============================================================================
2
+ # C O P Y R I G H T
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2020-2022 by Helmut Konrad Fahrendholz. All rights reserved.
5
+ # This file is property of Helmut Konrad Fahrendholz. Any unauthorized copy,
6
+ # use or distribution is an offensive act against international law and may
7
+ # be prosecuted under federal law. Its content is company confidential.
8
+ # =============================================================================