Add stats counting to tokenizer class

This commit is contained in:
Veronica Berglyd Olsen
2024-02-27 19:39:58 +01:00
parent 3bd67b4f1d
commit 2a2b12f0a5
3 changed files with 107 additions and 4 deletions
+5 -2
View File
@@ -52,14 +52,15 @@ class NWBuildDocument:
manuscript, based on a build definition object (BuildSettings).
"""
__slots__ = ("_project", "_build", "_queue", "_error", "_cache")
__slots__ = ("_project", "_build", "_queue", "_error", "_cache", "_count")
def __init__(self, project: NWProject, build: BuildSettings) -> None:
def __init__(self, project: NWProject, build: BuildSettings, doCount: bool = False) -> None:
self._project = project
self._build = build
self._queue = []
self._error = None
self._cache = None
self._count = doCount
return
##
@@ -319,6 +320,8 @@ class NWBuildDocument:
bldObj.doPreProcessing()
bldObj.tokenizeText()
bldObj.doHeaders()
if self._count:
bldObj.countStats()
if convert:
bldObj.doConvert()
else: