diff --git a/index.js b/index.js index a72c983ba..ed8ef9fc0 100644 --- a/index.js +++ b/index.js @@ -4140,18 +4140,35 @@ INDEX=[ "func":1 }, { -"ref":"tf.browser.ner.triggers.Triggers.showInheritance", +"ref":"tf.browser.ner.triggers.Triggers.showRaw", "url":98, "doc":"", "func":1 }, { -"ref":"tf.browser.ner.triggers.Triggers.showRawInfo", +"ref":"tf.browser.ner.triggers.Triggers.showCombined", "url":98, "doc":"", "func":1 }, { +"ref":"tf.browser.ner.triggers.Triggers.showCompiled", +"url":98, +"doc":"", +"func":1 +}, +{ +"ref":"tf.browser.ner.triggers.Triggers.showInstructions", +"url":98, +"doc":"", +"func":1 +}, +{ +"ref":"tf.browser.ner.triggers.Triggers.nameMap", +"url":98, +"doc":"Will contain a mapping from entities to names. The entities are keyed by their (eid, kind) tuple. The values are names plus the sheet where they are first defined." +}, +{ "ref":"tf.browser.ner.triggers.Triggers.instructions", "url":98, "doc":"Will contain the information in a spreadsheet for marking up entities." @@ -4846,7 +4863,7 @@ INDEX=[ { "ref":"tf.browser.ner.ner.NER.showInventory", "url":108, -"doc":"Shows the inventory. The surface forms in the inventory are put into the context of the entities of which they are surface forms.", +"doc":"Shows the inventory.", "func":1 }, { @@ -5580,11 +5597,16 @@ INDEX=[ "doc":"Auxiliary functions. To see how this fits among all the modules of this package, see tf.browser.ner.annotate . \u2039\u203a" }, { -"ref":"tf.browser.ner.helpers.CUT_OFF", +"ref":"tf.browser.ner.helpers.PART_CUT_OFF", "url":109, "doc":"Maximum length of parts of entity identifiers." }, { +"ref":"tf.browser.ner.helpers.CUT_OFF", +"url":109, +"doc":"Maximum length of entity identifiers." +}, +{ "ref":"tf.browser.ner.helpers.TO_ASCII_DEF", "url":109, "doc":"Undecomposable UNICODE characters mapped to their related ASCII characters." @@ -5602,6 +5624,18 @@ INDEX=[ "func":1 }, { +"ref":"tf.browser.ner.helpers.fromTokens", +"url":109, +"doc":"The inverse of toTokens() . Doing first toTokens and then fromTokens is idempotent. So if you have to revert back from tokens to text, make sure that you have done a combo of toTokens and fromTokens first. You can use tnorm() for that.", +"func":1 +}, +{ +"ref":"tf.browser.ner.helpers.tnorm", +"url":109, +"doc":"", +"func":1 +}, +{ "ref":"tf.browser.ner.helpers.toAscii", "url":109, "doc":"Transforms a text with diacritical marks into a plain ASCII text. Characters with diacritics are replaced by their base character. Some characters with diacritics are considered by UNICODE to be undecomposable characters, such as \u00f8 and \u00f1 . We use a table ( TO_ASCII_DEF ) to map these on their related ASCII characters.", @@ -5656,6 +5690,12 @@ INDEX=[ "func":1 }, { +"ref":"tf.browser.ner.helpers.reportName", +"url":109, +"doc":"", +"func":1 +}, +{ "ref":"tf.browser.ner.data", "url":105, "doc":"Annotation data module. This module manages the data of annotations. To see how this fits among all the modules of this package, see tf.browser.ner.annotate . Annotation data is either the set of pre-existing data in the corpus or the result of actions by the user of this tool, whether he uses the TF browser, or the API in his own programs. Annotation data must be stored on file, must be read from file, and must be represented in memory in various ways in order to make the API functions of the tool efficient. We have set up the functions in such a way that data is only loaded and processed if it is needed and out of date." @@ -5967,7 +6007,7 @@ INDEX=[ { "ref":"tf.browser.ner.match.occMatch", "url":110, -"doc":"Finds the occurrences of multiple sequences of tokens in a single bucket. Parameters getTokens: function See tf.browser.ner.corpus.Corpus.getTokens getHeadings: function See tf.browser.ner.corpus.Corpus.getHeadings buckets: tuple of integer The bucket nodes in question instructions: dict, optional None A nested dict, keyed by section headings, with trigger information per section. Generic trigger information is present under key . The idea is that trigger info under nested keys override trigger info at parent keys. The value at a key is a dict with keys: sheet : The information about the triggers; qSeqs : The plain set of triggers; each trigger is a token sequence; qMap : A compilation of all triggers into a mapping so that you can read off, given a position and a token, the set of all triggers that have that token at that position.", +"doc":"Finds the occurrences of multiple sequences of tokens in a single bucket. Parameters getTokens: function See tf.browser.ner.corpus.Corpus.getTokens getHeadings: function See tf.browser.ner.corpus.Corpus.getHeadings buckets: tuple of integer The bucket nodes in question instructions: dict, optional None A nested dict, keyed by section headings, with trigger information per section. Generic trigger information is present under key . The idea is that trigger info under nested keys override trigger info at parent keys. The value at a key is a dict with keys: sheet : The information about the triggers; tPos : A compilation of all triggers into a mapping so that you can read off, given a position and a token, the set of all triggers that have that token at that position.", "func":1 }, { diff --git a/tf/about/annotate.html b/tf/about/annotate.html index a276a6c0a..f8998203a 100644 --- a/tf/about/annotate.html +++ b/tf/about/annotate.html @@ -298,7 +298,7 @@
Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/annotate.md
diff --git a/tf/about/annotateBrowser.html b/tf/about/annotateBrowser.html
index aac7b2f52..c5c2c2b8d 100644
--- a/tf/about/annotateBrowser.html
+++ b/tf/about/annotateBrowser.html
@@ -267,7 +267,7 @@ 

Programming

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/annotateBrowser.md
diff --git a/tf/about/apps.html b/tf/about/apps.html
index 266bdb3a1..52045b26b 100644
--- a/tf/about/apps.html
+++ b/tf/about/apps.html
@@ -115,7 +115,7 @@ 

Two contexts

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/apps.md
diff --git a/tf/about/background.html b/tf/about/background.html
index ae51d2396..4c0f4e512 100644
--- a/tf/about/background.html
+++ b/tf/about/background.html
@@ -155,7 +155,7 @@ 

History

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/background.md
diff --git a/tf/about/browser.html b/tf/about/browser.html
index 462107657..7024b5166 100644
--- a/tf/about/browser.html
+++ b/tf/about/browser.html
@@ -174,7 +174,7 @@ 

UNICODE in Excel CSVs

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/browser.md
diff --git a/tf/about/clientmanual.html b/tf/about/clientmanual.html
index 38e444c57..1373d738b 100644
--- a/tf/about/clientmanual.html
+++ b/tf/about/clientmanual.html
@@ -565,7 +565,7 @@ 

Credits

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/clientmanual.md
diff --git a/tf/about/code.html b/tf/about/code.html
index b045e317b..40b944b3a 100644
--- a/tf/about/code.html
+++ b/tf/about/code.html
@@ -98,7 +98,7 @@ 

Writing

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/code.md
diff --git a/tf/about/corpora.html b/tf/about/corpora.html
index 4ff44b22c..8d441dfa7 100644
--- a/tf/about/corpora.html
+++ b/tf/about/corpora.html
@@ -351,7 +351,7 @@ 

Extra data

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/corpora.md
diff --git a/tf/about/datamodel.html b/tf/about/datamodel.html
index fdf5846bb..8659464d8 100644
--- a/tf/about/datamodel.html
+++ b/tf/about/datamodel.html
@@ -265,7 +265,7 @@ 

Serializing and pre-computing

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/datamodel.md
diff --git a/tf/about/datasharing.html b/tf/about/datasharing.html
index b5bb6c03c..3d1b13da6 100644
--- a/tf/about/datasharing.html
+++ b/tf/about/datasharing.html
@@ -362,7 +362,7 @@ 

More modules at the same time

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/datasharing.md
diff --git a/tf/about/displaydesign.html b/tf/about/displaydesign.html
index 72e794808..8b5273078 100644
--- a/tf/about/displaydesign.html
+++ b/tf/about/displaydesign.html
@@ -151,7 +151,7 @@ 

Output

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/displaydesign.md
diff --git a/tf/about/faq.html b/tf/about/faq.html
index bb72bb952..11ea4ca12 100644
--- a/tf/about/faq.html
+++ b/tf/about/faq.html
@@ -161,7 +161,7 @@ 

GitHub Rate Limit Exceeded!

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/faq.md
diff --git a/tf/about/fileformats.html b/tf/about/fileformats.html
index 29c59ab86..abea5621b 100644
--- a/tf/about/fileformats.html
+++ b/tf/about/fileformats.html
@@ -158,7 +158,7 @@ 

Single values

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/fileformats.md
diff --git a/tf/about/index.html b/tf/about/index.html
index 75b9f23c8..f08985f3b 100644
--- a/tf/about/index.html
+++ b/tf/about/index.html
@@ -33,7 +33,7 @@ 

Documents

Expand source code -Browse git +Browse git
"""
 # Documents
diff --git a/tf/about/install.html b/tf/about/install.html
index 92044a519..46a1209f1 100644
--- a/tf/about/install.html
+++ b/tf/about/install.html
@@ -108,7 +108,7 @@ 

Note for Linux users

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/install.md
diff --git a/tf/about/manual.html b/tf/about/manual.html
index c32ae9dcd..f2d625756 100644
--- a/tf/about/manual.html
+++ b/tf/about/manual.html
@@ -390,7 +390,7 @@ 

Keyboard shortcuts

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/manual.md
diff --git a/tf/about/optimizations.html b/tf/about/optimizations.html
index 21944a162..6e3aa7974 100644
--- a/tf/about/optimizations.html
+++ b/tf/about/optimizations.html
@@ -187,7 +187,7 @@ 

Edge features

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/optimizations.md
diff --git a/tf/about/releases.html b/tf/about/releases.html
index 21360ee23..373ac8496 100644
--- a/tf/about/releases.html
+++ b/tf/about/releases.html
@@ -482,7 +482,7 @@ 

Older releases

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/releases.md
diff --git a/tf/about/releasesold.html b/tf/about/releasesold.html
index 585b58132..ba2c58a27 100644
--- a/tf/about/releasesold.html
+++ b/tf/about/releasesold.html
@@ -3430,7 +3430,7 @@ 
Changed
Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/releasesold.md
diff --git a/tf/about/searchdesign.html b/tf/about/searchdesign.html
index 41c8e78db..4a74bd5e8 100644
--- a/tf/about/searchdesign.html
+++ b/tf/about/searchdesign.html
@@ -477,7 +477,7 @@ 

Small-first strategy

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/searchdesign.md
diff --git a/tf/about/searchusage.html b/tf/about/searchusage.html
index 4e894cb46..c51b0e870 100644
--- a/tf/about/searchusage.html
+++ b/tf/about/searchusage.html
@@ -776,7 +776,7 @@ 
Implementation
Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/searchusage.md
diff --git a/tf/about/tests.html b/tf/about/tests.html
index 7cbafd2fb..ddcabcbea 100644
--- a/tf/about/tests.html
+++ b/tf/about/tests.html
@@ -71,7 +71,7 @@ 

Relations

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/tests.md
diff --git a/tf/about/use.html b/tf/about/use.html
index 90d016a2e..d554828a9 100644
--- a/tf/about/use.html
+++ b/tf/about/use.html
@@ -90,7 +90,7 @@ 

TF API

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/use.md
diff --git a/tf/about/usefunc.html b/tf/about/usefunc.html
index 033853590..a3bdd5fb7 100644
--- a/tf/about/usefunc.html
+++ b/tf/about/usefunc.html
@@ -419,7 +419,7 @@ 

Prevent data loading

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/usefunc.md
diff --git a/tf/about/variants.html b/tf/about/variants.html
index 658c51090..6eb0dbd2e 100644
--- a/tf/about/variants.html
+++ b/tf/about/variants.html
@@ -438,7 +438,7 @@ 

The stack

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/variants.md
diff --git a/tf/about/volumes.html b/tf/about/volumes.html
index 5ce76b2a5..62ba18a67 100644
--- a/tf/about/volumes.html
+++ b/tf/about/volumes.html
@@ -323,7 +323,7 @@ 

Reflection

Expand source code -Browse git +Browse git
"""
 .. include:: ../docs/about/volumes.md
diff --git a/tf/advanced/annotate.html b/tf/advanced/annotate.html
index 654cdadc6..de4027df7 100644
--- a/tf/advanced/annotate.html
+++ b/tf/advanced/annotate.html
@@ -34,7 +34,7 @@ 

Module tf.advanced.annotate

Expand source code -Browse git +Browse git
"""
 Enable manual annotation APIs.
@@ -84,7 +84,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def annotateApi(app):
     """Produce the interchange functions API.
@@ -106,7 +106,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def makeNer(app):
     return NER(app)
diff --git a/tf/advanced/app.html b/tf/advanced/app.html index fefaf9b08..3528b3558 100644 --- a/tf/advanced/app.html +++ b/tf/advanced/app.html @@ -31,7 +31,7 @@

Module tf.advanced.app

Expand source code -Browse git +Browse git
import types
 import traceback
@@ -834,7 +834,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def findApp(
     appName,
@@ -1129,7 +1129,7 @@ 

Returns

Expand source code -Browse git +Browse git
def loadApp(silent=DEEP):
     """Loads a given TF app or loads the TF app based on the working directory.
@@ -1197,7 +1197,7 @@ 

See Also

Expand source code -Browse git +Browse git
def useApp(appName, backend):
     """Make use of a corpus.
@@ -1299,7 +1299,7 @@ 

Parameters

Expand source code -Browse git +Browse git
class App:
     def __init__(
@@ -1665,7 +1665,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hoist(self, hoist, silent=None):
     """Hoist the API handles of this TF app to the global scope.
@@ -1733,7 +1733,7 @@ 

Returns

Expand source code -Browse git +Browse git
def load(self, features, silent=SILENT_D):
     """Loads extra features in addition to the main dataset.
@@ -1771,7 +1771,7 @@ 

Returns

Expand source code -Browse git +Browse git
def reinit(self):
     """TF Apps may override this method.
@@ -1806,7 +1806,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def reuse(self, hoist=False):
     """Re-initialize the app.
diff --git a/tf/advanced/condense.html b/tf/advanced/condense.html
index 02060509e..5d80c6dd9 100644
--- a/tf/advanced/condense.html
+++ b/tf/advanced/condense.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.condense

Expand source code -Browse git +Browse git
def condense(api, tuples, condenseType, multiple=False):
     F = api.F
@@ -135,7 +135,7 @@ 

Functions

Expand source code -Browse git +Browse git
def condense(api, tuples, condenseType, multiple=False):
     F = api.F
@@ -192,7 +192,7 @@ 

Functions

Expand source code -Browse git +Browse git
def condenseSet(api, tup, condenseType):
     F = api.F
diff --git a/tf/advanced/data.html b/tf/advanced/data.html
index 4751fa959..752910557 100644
--- a/tf/advanced/data.html
+++ b/tf/advanced/data.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.data

Expand source code -Browse git +Browse git
from ..core.helpers import itemize
 from ..core.files import backendRep, expandDir, prefixSlash, normpath
@@ -496,7 +496,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getModulesData(*args):
     """Retrieve all data for a corpus.
@@ -556,7 +556,7 @@ 

Parameters

Expand source code -Browse git +Browse git
class AppData:
     def __init__(
@@ -989,7 +989,7 @@ 

See Also

Expand source code -Browse git +Browse git
def getExtra(self):
     """Get the extra data specified by the settings of the corpus.
@@ -1051,7 +1051,7 @@ 

See Also

Expand source code -Browse git +Browse git
def getMain(self):
     """Get the main data of the corpus.
@@ -1126,7 +1126,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getModule(
     self,
@@ -1271,7 +1271,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getModules(self):
     """Get data from additional local directories.
@@ -1342,7 +1342,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getRefs(self):
     """Get data from additional modules.
@@ -1397,7 +1397,7 @@ 

See Also

Expand source code -Browse git +Browse git
def getStandard(self):
     """Get the data of the standard modules specified by the settings of the corpus.
diff --git a/tf/advanced/display.html b/tf/advanced/display.html
index 47aef9dff..f8edac70b 100644
--- a/tf/advanced/display.html
+++ b/tf/advanced/display.html
@@ -69,7 +69,7 @@ 

See also

Expand source code -Browse git +Browse git
"""
 # Display
@@ -1126,7 +1126,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def displayApi(app, silent=SILENT_D):
     """Produce the display API.
@@ -1193,7 +1193,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def displayReset(app, *options):
     """Restore display parameters to their defaults.
@@ -1251,7 +1251,7 @@ 

See Also

Expand source code -Browse git +Browse git
def displaySetup(app, *show, **options):
     """Set up all display parameters.
@@ -1309,7 +1309,7 @@ 

See Also

Expand source code -Browse git +Browse git
def displayShow(app, *options):
     """Show display parameters.
@@ -1444,7 +1444,7 @@ 

Results

Expand source code -Browse git +Browse git
def export(app, tuples, toDir=None, toFile="results.tsv", **options):
     """Exports an iterable of tuples of nodes to an Excel friendly TSV file.
@@ -1589,7 +1589,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getCss(app):
     """Export the CSS for this app.
@@ -1639,7 +1639,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getToolCss(app, tool):
     """Export the CSS for a tool of this app.
@@ -1689,7 +1689,7 @@ 

Returns

Expand source code -Browse git +Browse git
def loadCss(app):
     """Load the CSS for this app.
@@ -1768,7 +1768,7 @@ 

Returns

Expand source code -Browse git +Browse git
def loadToolCss(app, tool, extraCss):
     """Load the Tool CSS for this app.
@@ -1840,7 +1840,7 @@ 

Result

Expand source code -Browse git +Browse git
def plain(app, n, _inTuple=False, _asString=False, explain=False, **options):
     """Display the plain text of a node.
@@ -1926,7 +1926,7 @@ 

Result

Expand source code -Browse git +Browse git
def plainTuple(
     app,
@@ -2169,7 +2169,7 @@ 

Result

Expand source code -Browse git +Browse git
def pretty(app, n, explain=False, _asString=False, **options):
     """Displays the material that corresponds to a node in a graphical way.
@@ -2248,7 +2248,7 @@ 

Result

Expand source code -Browse git +Browse git
def prettyTuple(app, tup, seq=None, _asString=False, item=RESULT, **options):
     """Displays the material that corresponds to a tuple of nodes in a graphical way.
@@ -2361,7 +2361,7 @@ 

Result

Expand source code -Browse git +Browse git
def show(app, tuples, _asString=False, **options):
     """Displays an iterable of tuples of nodes.
@@ -2464,7 +2464,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def table(app, tuples, _asString=False, **options):
     """Plain displays of an iterable of tuples of nodes in a table.
diff --git a/tf/advanced/find.html b/tf/advanced/find.html
index 5dcb9633c..dcd69af24 100644
--- a/tf/advanced/find.html
+++ b/tf/advanced/find.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.find

Expand source code -Browse git +Browse git
import sys
 from importlib import util
@@ -270,7 +270,7 @@ 

Returns

Expand source code -Browse git +Browse git
def findAppClass(appName, appPath):
     """Find the class definition of an app.
@@ -325,7 +325,7 @@ 

See Also

Expand source code -Browse git +Browse git
def findAppConfig(
     appName,
@@ -474,7 +474,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def loadModule(moduleName, *args):
     """Load a module dynamically, by name.
diff --git a/tf/advanced/helpers.html b/tf/advanced/helpers.html
index 7c2ef6979..250f3297c 100644
--- a/tf/advanced/helpers.html
+++ b/tf/advanced/helpers.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.helpers

Expand source code -Browse git +Browse git
import collections
 from textwrap import dedent
@@ -864,7 +864,7 @@ 

Functions

Expand source code -Browse git +Browse git
def backendRepl(match):
     thisBackend.append(match.group(1))
@@ -894,7 +894,7 @@ 

Returns

Expand source code -Browse git +Browse git
def dh(html, inNb="ipython", unexpand=False):
     """Display HTML.
@@ -952,7 +952,7 @@ 

Returns

Expand source code -Browse git +Browse git
def dm(md, inNb="ipython", unexpand=False):
     """Display markdown.
@@ -995,7 +995,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getHeaderTypes(app, tuples):
     api = app.api
@@ -1034,7 +1034,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getHeaders(app, tuples):
     headerTypes = getHeaderTypes(app, tuples)
@@ -1058,7 +1058,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getLocalDir(backend, cfg, local, version):
     provenanceSpec = cfg.get("provenanceSpec", {})
@@ -1098,7 +1098,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getResultsX(app, results, features, condenseType, fmt=None):
     """Transform a uniform iterable of nodes into a table with extra information.
@@ -1194,7 +1194,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getRowsX(app, tuples, features, condenseType, fmt=None):
     """Transform an iterable of nodes into a table with extra information.
@@ -1218,7 +1218,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getText(
     app, isPretty, n, nType, outer, first, last, level, passage, descend, options=None
@@ -1311,7 +1311,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getTuplesX(app, results, condenseType, fmt=None):
     """Transform a non-uniform iterable of nodes into a table with extra information.
@@ -1379,7 +1379,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getValue(app, n, nType, feat, suppress, math=False):
     F = app.api.F
@@ -1408,7 +1408,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hData(x):
     if not x:
@@ -1439,7 +1439,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hDict(x, outer=False):
     elem = f"{'o' if outer else 'u'}l"
@@ -1469,7 +1469,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hEmpty(x):
     return (
@@ -1491,7 +1491,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hList(x, outer=False):
     elem = f"{'o' if outer else 'u'}l"
@@ -1519,7 +1519,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hScalar(x):
     if type(x) is str:
@@ -1539,7 +1539,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hScalar0(x):
     tpv = type(x)
@@ -1584,7 +1584,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def hasData(backend, local, org, repo, version, relative):
     versionRep = f"/{version}" if version else ""
@@ -1609,7 +1609,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def htmlSafe(text, isHtml, math=False):
     return text.replace("\n", "<br>") if isHtml else htmlEsc(text, math=math)
@@ -1627,7 +1627,7 @@

Parameters

Expand source code -Browse git +Browse git
def isUniform(app, tuples):
     """Whether the members of tuples are uniform.
@@ -1669,7 +1669,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def parseFeatures(features):
     if (
@@ -1698,7 +1698,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def parseFeaturesLogical(feats):
     bare = []
@@ -1725,7 +1725,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def runsInNotebook():
     """Determines whether the program runs in an interactive shell.
@@ -1771,7 +1771,7 @@ 

Returns

Expand source code -Browse git +Browse git
def showDict(title, data, _browse, inNb, *keys):
     """Shows selected keys of a dictionary in a pretty way.
@@ -1812,7 +1812,7 @@ 

Returns

Expand source code -Browse git +Browse git
def splitModRef(moduleRef):
     thisBackend.clear()
@@ -1890,7 +1890,7 @@ 

See Also

Expand source code -Browse git +Browse git
def transitiveClosure(relation, reflexiveExceptions):
     """Produce the reflexive transitive closure of a relation.
@@ -1958,7 +1958,7 @@ 

See Also

Expand source code -Browse git +Browse git
def tupleEnum(tuples, start, end, limit, item, inNb):
     if start is None:
diff --git a/tf/advanced/highlight.html b/tf/advanced/highlight.html
index e4cfc657f..2f7e75854 100644
--- a/tf/advanced/highlight.html
+++ b/tf/advanced/highlight.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.highlight

Expand source code -Browse git +Browse git
from .search import runSearch
 
@@ -290,7 +290,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getEdgeHlAtt(e, pair, highlights):
     """Get the edge highlight attribute and style for an edge, only for pretty mode.
@@ -370,7 +370,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getHlAtt(app, n, highlights, isSlot):
     """Get the highlight attribute and style for a node for both pretty and plain modes.
@@ -457,7 +457,7 @@ 

Returns

Expand source code -Browse git +Browse git
def getPassageHighlights(app, node, query, colorMap, cache):
     """Get the highlights for a whole passage.
@@ -550,7 +550,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getTupleHighlights(api, tup, highlights, colorMap, condenseType):
     """Get the highlights for a tuple of nodes.
diff --git a/tf/advanced/index.html b/tf/advanced/index.html
index 72be98664..4cccf860b 100644
--- a/tf/advanced/index.html
+++ b/tf/advanced/index.html
@@ -66,7 +66,7 @@ 

Advanced API

Expand source code -Browse git +Browse git
"""
 # Advanced API
diff --git a/tf/advanced/interchange.html b/tf/advanced/interchange.html
index 99458ef41..2381513f0 100644
--- a/tf/advanced/interchange.html
+++ b/tf/advanced/interchange.html
@@ -35,7 +35,7 @@ 

Module tf.advanced.interchange

Expand source code -Browse git +Browse git
"""
 Produce exports of the whole dataset in different formats.
@@ -86,7 +86,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def interchangeApi(app):
     """Produce the interchange functions API.
diff --git a/tf/advanced/links.html b/tf/advanced/links.html
index 657c08732..f27ac5239 100644
--- a/tf/advanced/links.html
+++ b/tf/advanced/links.html
@@ -32,7 +32,7 @@ 

Module tf.advanced.links

Expand source code -Browse git +Browse git
"""
 Produce links to TF data and links from nodes to web resources.
@@ -1100,7 +1100,7 @@ 

Returns

Expand source code -Browse git +Browse git
def flexLink(app, kind):
     """Produce documentation links that are heavily dependent on the back-end.
@@ -1175,7 +1175,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def header(app, allMeta=False):
     """Generate a colophon of the app.
@@ -1285,7 +1285,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def linksApi(app, silent=SILENT_D):
     """Produce the link API.
@@ -1468,7 +1468,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def outLink(
     text, href, title=None, passage=None, clsName=None, target="_blank", asHtml=True
@@ -1540,7 +1540,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def provenanceLink(
     backend, org, repo, version, branch, commit, local, release, relative
@@ -1627,7 +1627,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def showProvenance(app, jobName="program code", author="program author"):
     """Shows the provenance that is normally displayed during data loading.
@@ -1710,7 +1710,7 @@ 

See Also

Expand source code -Browse git +Browse git
def webLink(
     app, n, text=None, clsName=None, urlOnly=False, _asString=False, _noUrl=False
diff --git a/tf/advanced/options.html b/tf/advanced/options.html
index 483754fc0..4de0fbe81 100644
--- a/tf/advanced/options.html
+++ b/tf/advanced/options.html
@@ -392,7 +392,7 @@ 

Parameters

Expand source code -Browse git +Browse git
"""
 # Display Settings.
@@ -1144,7 +1144,7 @@ 

Classes

Expand source code -Browse git +Browse git
class Options:
     def __init__(self, app):
@@ -1327,7 +1327,7 @@ 

Methods

Expand source code -Browse git +Browse git
def check(self, msg, options):
     app = self.app
@@ -1389,7 +1389,7 @@ 

Methods

Expand source code -Browse git +Browse git
def consume(self, options, *remove):
     return {o: options[o] for o in options if o not in remove}
@@ -1403,7 +1403,7 @@

Methods

Expand source code -Browse git +Browse git
def distill(self, options):
     defaults = self.defaults
@@ -1428,7 +1428,7 @@ 

Methods

Expand source code -Browse git +Browse git
def normalize(self, option, value):
     app = self.app
@@ -1493,7 +1493,7 @@ 

Methods

Expand source code -Browse git +Browse git
def reset(self, *options):
     app = self.app
@@ -1521,7 +1521,7 @@ 

Methods

Expand source code -Browse git +Browse git
def setup(self, *options, **overrides):
     app = self.app
@@ -1549,7 +1549,7 @@ 

Methods

Expand source code -Browse git +Browse git
class OptionsCurrent:
     def __init__(self, options):
@@ -1574,7 +1574,7 @@ 

Methods

Expand source code -Browse git +Browse git
def get(self, k, v=None):
     return getattr(self, k, v)
@@ -1588,7 +1588,7 @@

Methods

Expand source code -Browse git +Browse git
def set(self, k, v):
     self.allKeys.add(k)
diff --git a/tf/advanced/render.html b/tf/advanced/render.html
index f596ebdbe..0c341a6c9 100644
--- a/tf/advanced/render.html
+++ b/tf/advanced/render.html
@@ -45,7 +45,7 @@ 

Information shielding

Expand source code -Browse git +Browse git
"""
 # Render
@@ -807,7 +807,7 @@ 

Functions

Expand source code -Browse git +Browse git
def render(app, isPretty, n, _inTuple, _asString, explain, **options):
     """Renders a node, in plain or pretty mode.
diff --git a/tf/advanced/repo.html b/tf/advanced/repo.html
index a935e4814..b19a8c843 100644
--- a/tf/advanced/repo.html
+++ b/tf/advanced/repo.html
@@ -295,7 +295,7 @@ 

Updating a corpus that you alre
Expand source code -Browse git +Browse git
"""
 # Auto downloading from a back-end repository
@@ -2561,7 +2561,7 @@ 

Functions

Expand source code -Browse git +Browse git
def GLPERS(backend):
     return f"GL_{SHELL_VAR_RE.sub('_', backend.upper())}_PERS"
@@ -2575,7 +2575,7 @@

Functions

Expand source code -Browse git +Browse git
def bumpRelease(latestR, increase):
     if latestR:
@@ -2613,7 +2613,7 @@ 

Functions

Expand source code -Browse git +Browse git
def catchRemaining(e):
     eType = type(e)
@@ -2733,7 +2733,7 @@ 

Returns

Expand source code -Browse git +Browse git
def checkoutRepo(
     backend,
@@ -2925,7 +2925,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def extractPrecise(z):
     """Extracts a zip file precisely, by deleting some pre-existing material.
@@ -2967,7 +2967,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def getFinalUrl(url):
     finalUrl = None
@@ -3024,7 +3024,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def publishRelease(app, increase, message=None, description=None):
     """Publishes a new data release for a TF dataset to GitHub.
@@ -3203,7 +3203,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def releaseData(
     backend,
@@ -3270,7 +3270,7 @@ 

Classes

Expand source code -Browse git +Browse git
class Checkout:
     """Auxiliary class for `checkoutRepo`"""
@@ -4355,7 +4355,7 @@ 

Static methods

Expand source code -Browse git +Browse git
@staticmethod
 def fromString(string):
@@ -4392,7 +4392,7 @@ 

Static methods

Expand source code -Browse git +Browse git
@staticmethod
 def retrieve(url):
@@ -4423,7 +4423,7 @@ 

Static methods

Expand source code -Browse git +Browse git
@staticmethod
 def toString(commit, release, local, backend, source=None, dest=None):
@@ -4466,7 +4466,7 @@ 

Methods

Expand source code -Browse git +Browse git
def connect(self):
     conn = self.conn
@@ -4540,7 +4540,7 @@ 

Methods

Expand source code -Browse git +Browse git
def display(self, msg, msgPlain):
     inNb = self.inNb
@@ -4560,7 +4560,7 @@ 

Methods

Expand source code -Browse git +Browse git
def download(self):
     cChk = self.commitChk
@@ -4585,7 +4585,7 @@ 

Methods

Expand source code -Browse git +Browse git
def downloadCommit(self, commit, showErrors=True):
     c = self.getCommitObj(commit)
@@ -4609,7 +4609,7 @@ 

Methods

Expand source code -Browse git +Browse git
def downloadComplete(self):
     ssl._create_default_https_context = ssl._create_unverified_context
@@ -4698,7 +4698,7 @@ 

Methods

Expand source code -Browse git +Browse git
def downloadDir(self, commit, exclude=None, showErrors=False):
     g = self.repoOnline
@@ -4792,7 +4792,7 @@ 

Methods

Expand source code -Browse git +Browse git
def downloadRelease(self, release, showErrors=True):
     cChk = self.commitChk
@@ -4846,7 +4846,7 @@ 

Methods

Expand source code -Browse git +Browse git
def downloadZip(self, where, shiftUp=False, commit=None, showErrors=True):
     # commit parameter only supported for GitLab
@@ -4987,7 +4987,7 @@ 

Methods

Expand source code -Browse git +Browse git
def error(self, msg, newline=True):
     console(msg, error=True, newline=newline)
@@ -5001,7 +5001,7 @@

Methods

Expand source code -Browse git +Browse git
def fetchInfo(self):
     if self.isOffline():
@@ -5039,7 +5039,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fixInfo(self):
     sDir = self.dirPathLocal
@@ -5063,7 +5063,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getCommit(self, commit):
     c = self.getCommitObj(commit)
@@ -5080,7 +5080,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getCommitFromObj(self, c):
     g = self.repoOnline
@@ -5100,7 +5100,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getCommitObj(self, commit):
     g = self.repoOnline
@@ -5153,7 +5153,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getRelease(self, release, showErrors=True):
     r = self.getReleaseObj(release, showErrors=showErrors)
@@ -5170,7 +5170,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getReleaseFromObj(self, r):
     g = self.repoOnline
@@ -5197,7 +5197,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getReleaseObj(self, release, showErrors=True):
     g = self.repoOnline
@@ -5247,7 +5247,7 @@ 

Methods

Expand source code -Browse git +Browse git
def info(self, msg, newline=True):
     silent = self.silent
@@ -5263,7 +5263,7 @@ 

Methods

Expand source code -Browse git +Browse git
def isClone(self):
     return self.local == "clone"
@@ -5277,7 +5277,7 @@

Methods

Expand source code -Browse git +Browse git
def isExpress(self):
     return (
@@ -5296,7 +5296,7 @@ 

Methods

Expand source code -Browse git +Browse git
def isOffline(self):
     return self.local in {"clone", "local"}
@@ -5310,7 +5310,7 @@

Methods

Expand source code -Browse git +Browse git
def login(self):
     onGithub = self.onGithub
@@ -5392,7 +5392,7 @@ 

Methods

Expand source code -Browse git +Browse git
def makeSureLocal(self, attempt=False):
     _browse = self._browse
@@ -5600,7 +5600,7 @@ 

Methods

Expand source code -Browse git +Browse git
def possibleError(self, msg, showErrors, again=False, indent="\t", newline=False):
     if showErrors:
@@ -5619,7 +5619,7 @@ 

Methods

Expand source code -Browse git +Browse git
def readInfo(self):
     if fileExists(self.filePathLocal):
@@ -5641,7 +5641,7 @@ 

Methods

Expand source code -Browse git +Browse git
def warning(self, msg, newline=True):
     silent = self.silent
@@ -5657,7 +5657,7 @@ 

Methods

Expand source code -Browse git +Browse git
def writeInfo(self, release=None, commit=None):
     releaseOff = self.releaseOff if release is None else release
@@ -5681,7 +5681,7 @@ 

Methods

Expand source code -Browse git +Browse git
class Repo:
     """Auxiliary class for `releaseData`"""
@@ -5968,7 +5968,7 @@ 

Methods

Expand source code -Browse git +Browse git
def bumpRelease(self):
     increase = self.increase
@@ -5986,7 +5986,7 @@ 

Methods

Expand source code -Browse git +Browse git
def connect(self):
     backend = self.backend
@@ -6053,7 +6053,7 @@ 

Methods

Expand source code -Browse git +Browse git
def error(self, msg, newline=True):
     console(msg, error=True, newline=newline)
@@ -6067,7 +6067,7 @@

Methods

Expand source code -Browse git +Browse git
def fetchInfo(self):
     g = self.repoOnline
@@ -6093,7 +6093,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getCommit(self):
     c = self.getCommitObj()
@@ -6110,7 +6110,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getCommitObj(self):
     g = self.repoOnline
@@ -6139,7 +6139,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getRelease(self):
     r = self.getReleaseObj()
@@ -6156,7 +6156,7 @@ 

Methods

Expand source code -Browse git +Browse git
def getReleaseObj(self):
     g = self.repoOnline
@@ -6184,7 +6184,7 @@ 

Methods

Expand source code -Browse git +Browse git
def info(self, msg, newline=True):
     silent = self.silent
@@ -6200,7 +6200,7 @@ 

Methods

Expand source code -Browse git +Browse git
def makeRelease(self):
     g = self.repoOnline
@@ -6239,7 +6239,7 @@ 

Methods

Expand source code -Browse git +Browse git
def makeZip(self):
     source = self.source
@@ -6276,7 +6276,7 @@ 

Methods

Expand source code -Browse git +Browse git
def newRelease(self):
     if not self.makeZip():
@@ -6312,7 +6312,7 @@ 

Methods

Expand source code -Browse git +Browse git
def uploadZip(self):
     newTag = self.newTag
@@ -6351,7 +6351,7 @@ 

Methods

Expand source code -Browse git +Browse git
def warning(self, msg, newline=True):
     silent = self.silent
diff --git a/tf/advanced/search.html b/tf/advanced/search.html
index 11862895b..9c56dfd3c 100644
--- a/tf/advanced/search.html
+++ b/tf/advanced/search.html
@@ -32,7 +32,7 @@ 

Module tf.advanced.search

Expand source code -Browse git +Browse git
"""
 Calls from the advanced API to the Search API.
@@ -315,7 +315,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getQueryFeatures(exe):
     qnodes = getattr(exe, "qnodes", [])
@@ -355,7 +355,7 @@ 

Functions

Expand source code -Browse git +Browse git
def runSearch(app, query, cache):
     """A wrapper around the generic search interface of TF.
@@ -424,7 +424,7 @@ 

Functions

Expand source code -Browse git +Browse git
def runSearchCondensed(app, query, cache, condenseType):
     """A wrapper around the generic search interface of TF.
@@ -544,7 +544,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def search(
     app, query, silent=SILENT_D, sets=None, shallow=False, sort=True, limit=None
@@ -708,7 +708,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def searchApi(app):
     app.search = types.MethodType(search, app)
diff --git a/tf/advanced/sections.html b/tf/advanced/sections.html index fae7d2545..ab4c3e41b 100644 --- a/tf/advanced/sections.html +++ b/tf/advanced/sections.html @@ -49,7 +49,7 @@

Structure

Expand source code -Browse git +Browse git
"""Section
 
@@ -312,7 +312,7 @@ 

Returns

Expand source code -Browse git +Browse git
def nodeFromSectionStr(app, sectionStr, lang="en"):
     """Find the node of a section string.
@@ -430,7 +430,7 @@ 

Returns

Expand source code -Browse git +Browse git
def sectionStrFromNode(app, n, lang="en", lastSlot=False, fillup=False):
     """The heading of a section to which a node belongs.
@@ -483,7 +483,7 @@ 

Returns

Expand source code -Browse git +Browse git
def sectionsApi(app):
     app.nodeFromSectionStr = types.MethodType(nodeFromSectionStr, app)
@@ -509,7 +509,7 @@ 

Returns

Expand source code -Browse git +Browse git
def structureStrFromNode(app, n):
     """The heading of a structure to which a node belongs.
diff --git a/tf/advanced/settings.html b/tf/advanced/settings.html
index 837d8fe26..209c89790 100644
--- a/tf/advanced/settings.html
+++ b/tf/advanced/settings.html
@@ -844,7 +844,7 @@ 

writing

Expand source code -Browse git +Browse git
"""
 # App settings
@@ -2862,7 +2862,7 @@ 

Functions

Expand source code -Browse git +Browse git
def DOC_DEFAULTS(backend):
     return (
@@ -2886,7 +2886,7 @@ 

Functions

Expand source code -Browse git +Browse git
def compileFormatCls(app, specs, givenStyles):
     api = app.api
@@ -2930,7 +2930,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getDataDefaults(app, cfg, dKey, withApi):
     checker = Check(app, withApi)
@@ -2993,7 +2993,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getLevel(defaultLevel, givenInfo, isVerse):
     level = givenInfo.get("level", defaultLevel)
@@ -3013,7 +3013,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getTypeDefaults(app, cfg, dKey, withApi):
     if not withApi:
@@ -3336,7 +3336,7 @@ 

Functions

Expand source code -Browse git +Browse git
def setAppSpecs(app, cfg, reset=False):
     backend = app.backend
@@ -3440,7 +3440,7 @@ 

Functions

Expand source code -Browse git +Browse git
def setAppSpecsApi(app, cfg):
     api = app.api
@@ -3519,7 +3519,7 @@ 

See Also

Expand source code -Browse git +Browse git
def showContext(app, *keys, withComputed=True, asHtml=False):
     """Shows the *context* of the app `tf.advanced.app.App.context` in a pretty way.
@@ -3585,7 +3585,7 @@ 

Classes

Expand source code -Browse git +Browse git
class AppCurrent:
     def __init__(self, specs):
@@ -3615,7 +3615,7 @@ 

Methods

Expand source code -Browse git +Browse git
def get(self, k, v):
     return getattr(self, k, v)
@@ -3629,7 +3629,7 @@

Methods

Expand source code -Browse git +Browse git
def set(self, k, v):
     self.allKeys.add(k)
@@ -3644,7 +3644,7 @@ 

Methods

Expand source code -Browse git +Browse git
def update(self, specs):
     allKeys = self.allKeys
@@ -3664,7 +3664,7 @@ 

Methods

Expand source code -Browse git +Browse git
class Check:
     def __init__(self, app, withApi):
@@ -3867,7 +3867,7 @@ 

Methods

Expand source code -Browse git +Browse git
def checkGroup(self, cfg, defaults, dKey, postpone=set(), extra=None):
     self.cfg = cfg
@@ -3895,7 +3895,7 @@ 

Methods

Expand source code -Browse git +Browse git
def checkItem(self, cfg, dKey):
     self.cfg = cfg
@@ -3915,7 +3915,7 @@ 

Methods

Expand source code -Browse git +Browse git
def checkSetting(self, k, v, extra=None):
     app = self.app
@@ -4074,7 +4074,7 @@ 

Methods

Expand source code -Browse git +Browse git
def report(self):
     errors = self.errors
diff --git a/tf/advanced/tables.html b/tf/advanced/tables.html
index 9e576c840..535bf80a3 100644
--- a/tf/advanced/tables.html
+++ b/tf/advanced/tables.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.tables

Expand source code -Browse git +Browse git
from ..core.text import DEFAULT_FORMAT
 from .helpers import getHeaders, RESULT
@@ -416,7 +416,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def compose(
     app,
@@ -542,7 +542,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def composeP(
     app,
@@ -651,7 +651,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def composeT(
     app,
diff --git a/tf/advanced/text.html b/tf/advanced/text.html
index d7a495616..57af301d9 100644
--- a/tf/advanced/text.html
+++ b/tf/advanced/text.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.text

Expand source code -Browse git +Browse git
import types
 from textwrap import dedent
@@ -199,7 +199,7 @@ 

Functions

Expand source code -Browse git +Browse git
def showFormats(app):
     inNb = app.inNb
@@ -253,7 +253,7 @@ 

Returns

Expand source code -Browse git +Browse git
def specialCharacters(app, fmt=None, _browse=False):
     """Generate a widget for hard to type characters.
@@ -349,7 +349,7 @@ 

Returns

Expand source code -Browse git +Browse git
def textApi(app):
     api = app.api
diff --git a/tf/advanced/unravel.html b/tf/advanced/unravel.html
index c726e20c5..a4f390248 100644
--- a/tf/advanced/unravel.html
+++ b/tf/advanced/unravel.html
@@ -35,7 +35,7 @@ 

Unravel

Expand source code -Browse git +Browse git
"""
 # Unravel
@@ -746,7 +746,7 @@ 

Returns

Expand source code -Browse git +Browse git
def unravel(app, n, isPlain=True, _inTuple=False, explain=False, **options):
     """Unravels a node and its graph-neighbourhood into a tree of fragments.
@@ -801,7 +801,7 @@ 

Classes

Expand source code -Browse git +Browse git
class NodeProps:
     """Node properties during plain() or pretty().
@@ -894,7 +894,7 @@ 

Instance variables

Expand source code -Browse git +Browse git
class OuterSettings:
     """Common properties during plain() and pretty().
@@ -976,7 +976,7 @@ 

Instance variables

Expand source code -Browse git +Browse git
class TreeInfo:
     """Tree properties during plain() or pretty().
@@ -1004,7 +1004,7 @@ 

Methods

Expand source code -Browse git +Browse git
def get(self, k, v):
     return getattr(self, k, v)
@@ -1018,7 +1018,7 @@

Methods

Expand source code -Browse git +Browse git
def update(self, **specs):
     for (k, v) in specs.items():
diff --git a/tf/advanced/volumes.html b/tf/advanced/volumes.html
index 8165d20b9..164ad2dd8 100644
--- a/tf/advanced/volumes.html
+++ b/tf/advanced/volumes.html
@@ -32,7 +32,7 @@ 

Module tf.advanced.volumes

Expand source code -Browse git +Browse git
"""
 Produce links to TF data and links from nodes to web resources.
@@ -141,7 +141,7 @@ 

Functions

Expand source code -Browse git +Browse git
def collect(app, *args, **kwargs):
     """Calls `tf.fabric.Fabric.collect` from an app object."""
@@ -161,7 +161,7 @@ 

Functions

Expand source code -Browse git +Browse git
def extract(app, *args, **kwargs):
     """Calls `tf.fabric.Fabric.extract` from an app object."""
@@ -189,7 +189,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getVolumes(app, *args, **kwargs):
     """Calls `tf.fabric.Fabric.getVolumes` from an app object.
@@ -229,7 +229,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def volumesApi(app):
     """Produce the volume support functions API.
diff --git a/tf/advanced/zipdata.html b/tf/advanced/zipdata.html
index ae9739977..a6806058e 100644
--- a/tf/advanced/zipdata.html
+++ b/tf/advanced/zipdata.html
@@ -31,7 +31,7 @@ 

Module tf.advanced.zipdata

Expand source code -Browse git +Browse git
import sys
 import types
@@ -473,7 +473,7 @@ 

Functions

Expand source code -Browse git +Browse git
def addCheckout(path):
     release = None
@@ -512,7 +512,7 @@ 

Functions

Expand source code -Browse git +Browse git
def collectFiles(base, path, results, zipBase=None):
     if zipBase is None:
@@ -560,7 +560,7 @@ 

EFFECT

Expand source code -Browse git +Browse git
def main(cargs=sys.argv):
     if len(cargs) < 2 or any(
@@ -640,7 +640,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def zipAll(app):
     """Gathers all data for a TF resource and zips it into one file.
@@ -781,7 +781,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def zipApi(app):
     """Produce the zip creation API.
@@ -827,7 +827,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def zipData(
     backend,
@@ -956,7 +956,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def zipDataPart(source, results):
     if not dirExists(source):
diff --git a/tf/app.html b/tf/app.html
index c6e4ea4fe..c616605ae 100644
--- a/tf/app.html
+++ b/tf/app.html
@@ -39,7 +39,7 @@ 

Module tf.app

Expand source code -Browse git +Browse git
"""
 Make use of a corpus.
@@ -137,7 +137,7 @@ 

See Also

Expand source code -Browse git +Browse git
def use(appName, *args, backend=None, **kwargs):
     """Make use of a corpus.
diff --git a/tf/browser/command.html b/tf/browser/command.html
index 133f3eb8d..593f6e08b 100644
--- a/tf/browser/command.html
+++ b/tf/browser/command.html
@@ -32,7 +32,7 @@ 

Module tf.browser.command

Expand source code -Browse git +Browse git
"""
 Command-line argument processing
@@ -156,7 +156,7 @@ 

Functions

Expand source code -Browse git +Browse git
def argApp(cargs, simple):
     (appName, checkoutApp, dataLoc) = argParam(cargs)
@@ -212,7 +212,7 @@ 

Functions

Expand source code -Browse git +Browse git
def argNoweb(cargs):
     for arg in cargs:
@@ -229,7 +229,7 @@ 

Functions

Expand source code -Browse git +Browse git
def argParam(cargs):
     appName = None
@@ -269,7 +269,7 @@ 

Functions

Expand source code -Browse git +Browse git
def getPort(slug):
     portOffset = crc32(slug.encode("utf8")) % 10000
diff --git a/tf/browser/html.html b/tf/browser/html.html
index df4d68275..d7c2ad656 100644
--- a/tf/browser/html.html
+++ b/tf/browser/html.html
@@ -34,7 +34,7 @@ 

Module tf.browser.html

Expand source code -Browse git +Browse git
"""HTML generation done in the Pythonic way.
 
@@ -223,7 +223,7 @@ 

Returns

Expand source code -Browse git +Browse git
def dig(*content, sep=""):
     """A method to join nested iterables of strings into a string.
@@ -274,7 +274,7 @@ 

Returns

Expand source code -Browse git +Browse git
def elemFunc(close, elem):
     """Generates a function to serialize a specific HTML element.
@@ -330,7 +330,7 @@ 

Returns

Expand source code -Browse git +Browse git
def generate(close, tag, *content, **atts):
     """Transform the logical information for an HTML element into an HTML string.
@@ -384,7 +384,7 @@ 

Classes

Expand source code -Browse git +Browse git
class H:
     """Provider of HTML serializing functions per element type.
@@ -413,7 +413,7 @@ 

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -427,7 +427,7 @@

Methods

Expand source code -Browse git +Browse git
def result(**atts):
     return generate(close, elem, **atts)
@@ -441,7 +441,7 @@

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -455,7 +455,7 @@

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -469,7 +469,7 @@

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -483,7 +483,7 @@

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -497,7 +497,7 @@

Methods

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -511,7 +511,7 @@

Methods

Expand source code -Browse git +Browse git
def result(**atts):
     return generate(close, elem, **atts)
@@ -537,7 +537,7 @@

Returns

Expand source code -Browse git +Browse git
def dig(*content, sep=""):
     """A method to join nested iterables of strings into a string.
@@ -575,7 +575,7 @@ 

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -589,7 +589,7 @@

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -603,7 +603,7 @@

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -617,7 +617,7 @@

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -631,7 +631,7 @@

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
@@ -645,7 +645,7 @@

Returns

Expand source code -Browse git +Browse git
def result(*content, **atts):
     return generate(close, elem, *content, **atts)
diff --git a/tf/browser/index.html b/tf/browser/index.html index 62d213ae6..7a17ab3c4 100644 --- a/tf/browser/index.html +++ b/tf/browser/index.html @@ -32,7 +32,7 @@

Local TF data and web server

Expand source code -Browse git +Browse git
"""
 # Local TF data and web server
diff --git a/tf/browser/kernel.html b/tf/browser/kernel.html
index c52d34642..df728adee 100644
--- a/tf/browser/kernel.html
+++ b/tf/browser/kernel.html
@@ -38,7 +38,7 @@ 

Kernel API

Expand source code -Browse git +Browse git
"""
 # TF kernel
@@ -550,7 +550,7 @@ 

Functions

Expand source code -Browse git +Browse git
def makeTfKernel(app, appName):
     if not app.api:
diff --git a/tf/browser/ner/annotate.html b/tf/browser/ner/annotate.html
index afecdcafd..10cf2abf7 100644
--- a/tf/browser/ner/annotate.html
+++ b/tf/browser/ner/annotate.html
@@ -100,7 +100,7 @@ 

Module tf.browser.ner.annotate

Expand source code -Browse git +Browse git
"""Central Annotation object.
 
@@ -257,14 +257,19 @@ 

Module tf.browser.ner.annotate

if not self.properlySetup: return [] + settings = self.settings + spaceEscaped = settings.spaceEscaped instructions = self.instructions + setData = self.getSetData() getTokens = self.getTokens getHeadings = self.getHeadings buckets = setData.buckets or () - self.inventory = occMatch(getTokens, getHeadings, buckets, instructions) + self.inventory = occMatch( + getTokens, getHeadings, buckets, instructions, spaceEscaped + ) def filterContent( self, @@ -552,7 +557,7 @@

Parameters

Expand source code -Browse git +Browse git
class Annotate(Sets, Show):
     def __init__(self, app, data=None, browse=False):
@@ -621,14 +626,19 @@ 

Parameters

if not self.properlySetup: return [] + settings = self.settings + spaceEscaped = settings.spaceEscaped instructions = self.instructions + setData = self.getSetData() getTokens = self.getTokens getHeadings = self.getHeadings buckets = setData.buckets or () - self.inventory = occMatch(getTokens, getHeadings, buckets, instructions) + self.inventory = occMatch( + getTokens, getHeadings, buckets, instructions, spaceEscaped + ) def filterContent( self, @@ -979,7 +989,7 @@

Returns

Expand source code -Browse git +Browse git
def filterContent(
     self,
@@ -1242,7 +1252,7 @@ 

Returns

Expand source code -Browse git +Browse git
def findOccs(self):
     """Finds the occurrences of multiple triggers.
@@ -1267,14 +1277,19 @@ 

Returns

if not self.properlySetup: return [] + settings = self.settings + spaceEscaped = settings.spaceEscaped instructions = self.instructions + setData = self.getSetData() getTokens = self.getTokens getHeadings = self.getHeadings buckets = setData.buckets or () - self.inventory = occMatch(getTokens, getHeadings, buckets, instructions)
+ self.inventory = occMatch( + getTokens, getHeadings, buckets, instructions, spaceEscaped + )
diff --git a/tf/browser/ner/corpus.html b/tf/browser/ner/corpus.html index 1dc2e5970..ac83547be 100644 --- a/tf/browser/ner/corpus.html +++ b/tf/browser/ner/corpus.html @@ -39,7 +39,7 @@

Module tf.browser.ner.corpus

Expand source code -Browse git +Browse git
"""Access to the corpus.
 
@@ -452,7 +452,7 @@ 

Classes

Expand source code -Browse git +Browse git
class Corpus(Settings):
     def __init__(self):
diff --git a/tf/browser/ner/data.html b/tf/browser/ner/data.html
index 8bb8280b4..516c3f112 100644
--- a/tf/browser/ner/data.html
+++ b/tf/browser/ner/data.html
@@ -43,7 +43,7 @@ 

Module tf.browser.ner.data

Expand source code -Browse git +Browse git
"""Annotation data module.
 
@@ -1172,7 +1172,7 @@ 

Parameters

Expand source code -Browse git +Browse git
class Data(Corpus):
     def __init__(self, data=None):
@@ -2267,7 +2267,7 @@ 

Returns

Expand source code -Browse git +Browse git
def addEntities(self, newEntities, silent=True):
     """Add multiple entities efficiently to the current set.
@@ -2375,7 +2375,7 @@ 

Returns

Expand source code -Browse git +Browse git
def addEntity(self, vals, allMatches, silent=True):
     """Add entity occurrences to the current set.
@@ -2492,7 +2492,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def addEntityRich(self, additions, buckets, excludedTokens=set()):
     """Add specified entity occurrences to the current set.
@@ -2632,7 +2632,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def consolidateEntities(self, versionExtension):
     """Consolidates the current entities as nodes into a new TF data source.
@@ -2813,7 +2813,7 @@ 

Returns

Expand source code -Browse git +Browse git
def delEntity(self, vals, allMatches=None, silent=True):
     """Delete entity occurrences from the current set.
@@ -2932,7 +2932,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def delEntityRich(self, deletions, buckets, excludedTokens=set()):
     """Delete specified entity occurrences from the current set.
@@ -3083,7 +3083,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def fromSource(self):
     """Loads annotation data from source.
@@ -3191,7 +3191,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def loadData(self):
     """Loads data of the current annotation set into memory.
@@ -3237,7 +3237,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def mergeEntities(self, newEntities):
     """Performs additions to the current annotation set.
@@ -3329,7 +3329,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def process(self, changed):
     """Generated derived data structures out of the source data.
@@ -3513,7 +3513,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def saveEntitiesAs(self, dataFile):
     """Export the data of an annotation set to a file.
@@ -3553,7 +3553,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def weedEntities(self, delEntities):
     """Performs deletions to the current annotation set.
diff --git a/tf/browser/ner/form.html b/tf/browser/ner/form.html
index 7410a25e4..ae58290e3 100644
--- a/tf/browser/ner/form.html
+++ b/tf/browser/ner/form.html
@@ -37,7 +37,7 @@ 

Module tf.browser.ner.form

Expand source code -Browse git +Browse git
"""Machinery for request reading.
 
@@ -228,7 +228,7 @@ 

Parameters

Expand source code -Browse git +Browse git
class Form:
     def __init__(
@@ -383,7 +383,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fget2(self, k):
     """Makes form value under key `k` or its default into an boolean."""
@@ -399,7 +399,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fget3(self, k):
     """Makes form value under key `k` or its default into a 3-way boolean."""
@@ -415,7 +415,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fgeti(self, k):
     """Makes form value under key `k` or its default into an integer."""
@@ -433,7 +433,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fgetj(self, k):
     """Makes form value under key `k` or its default into a data structure.
@@ -457,7 +457,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fgets(self, k):
     """Makes form value under key `k` or its default into an string."""
@@ -476,7 +476,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fgetsi(self, k):
     """Makes form value under key `k` or its default into a set.
@@ -503,7 +503,7 @@ 

Methods

Expand source code -Browse git +Browse git
def fgettu(self, k):
     """Makes form value under key `k` or its default into a tuple.
@@ -530,7 +530,7 @@ 

Returns

Expand source code -Browse git +Browse git
def fill(self):
     """Fill a dictionary with interpreted form values.
diff --git a/tf/browser/ner/fragments.html b/tf/browser/ner/fragments.html
index cca03d7d6..07d09ebb6 100644
--- a/tf/browser/ner/fragments.html
+++ b/tf/browser/ner/fragments.html
@@ -35,7 +35,7 @@ 

Module tf.browser.ner.fragments

Expand source code -Browse git +Browse git
"""Wraps various pieces into HTML.
 
@@ -947,7 +947,7 @@ 

Classes

Expand source code -Browse git +Browse git
class Fragments:
     def wrapMessages(self):
@@ -1842,7 +1842,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapActive(self):
     """HTML for the active entity."""
@@ -1877,7 +1877,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapAnnoSets(self):
     """HTML for the annotation set chooser.
@@ -1991,7 +1991,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapAppearance(self):
     """HTML for the appearance widget.
@@ -2064,7 +2064,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntity(self):
     """Basic data for the selected entity widget.
@@ -2132,7 +2132,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityFeats(self):
     """HTML for the entity feature value selection.
@@ -2233,7 +2233,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityHeaders(self):
     """HTML for the header of the entity table, dependent on the state of sorting."""
@@ -2280,7 +2280,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityModReport(self):
     """HTML for the combined report of add / del actions."""
@@ -2305,7 +2305,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityModify(self):
     """HTML for the add / del widget.
@@ -2563,7 +2563,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityStat(self, val, feat):
     """HTML for statistics of feature values.
@@ -2596,7 +2596,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapEntityText(self):
     """HTML for the selected entity widget."""
@@ -2653,7 +2653,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapExceptions(self):
     """HTML for the select / deselect buttons.
@@ -2709,7 +2709,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapFilter(self):
     """HTML for the filter widget.
@@ -2796,7 +2796,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapFindStat(self):
     """HTML for statistics.
@@ -2821,7 +2821,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapMessages(self):
     """HTML for messages."""
@@ -2839,7 +2839,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapQuery(self):
     """HTML for all control widgets on the page."""
@@ -2861,7 +2861,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapReport(self, report, kind):
     """HTML for the report of add / del actions."""
@@ -2896,7 +2896,7 @@ 

Methods

Expand source code -Browse git +Browse git
def wrapScope(self):
     """HTML for the scope widget.
diff --git a/tf/browser/ner/helpers.html b/tf/browser/ner/helpers.html
index a15d9c719..a7f01b255 100644
--- a/tf/browser/ner/helpers.html
+++ b/tf/browser/ner/helpers.html
@@ -35,7 +35,7 @@ 

Module tf.browser.ner.helpers

Expand source code -Browse git +Browse git
"""Auxiliary functions.
 
@@ -47,6 +47,7 @@ 

Module tf.browser.ner.helpers

import re import unicodedata +from ...core.helpers import console from ..html import H from .settings import STYLES @@ -55,9 +56,15 @@

Module tf.browser.ner.helpers

WHITE_RE = re.compile(r"""\s+""", re.S) NON_WORD = re.compile(r"""\W+""", re.S) -CUT_OFF = 20 +PART_CUT_OFF = 8 """Maximum length of parts of entity identifiers.""" +PREFIX_PART = 5 +SUFFIX_PART = PART_CUT_OFF - PREFIX_PART - 1 + +CUT_OFF = 40 +"""Maximum length of entity identifiers.""" + TOKEN_RE = re.compile(r"""\w+|\W""") @@ -98,6 +105,26 @@

Module tf.browser.ner.helpers

return tuple(t for t in result if t != " ") +def fromTokens(tokens, spaceEscaped=False): + """The inverse of `toTokens()`. + + Doing first toTokens and then fromTokens is idempotent. + So if you have to revert back from tokens to text, + make sure that you have done a combo of toTokens and + fromTokens first. + You can use `tnorm()` for that. + """ + return " ".join( + tuple(t.replace(" ", "_") for t in tokens) if spaceEscaped else tokens + ) + + +def tnorm(text, spaceEscaped=False): + return fromTokens( + toTokens(text, spaceEscaped=spaceEscaped), spaceEscaped=spaceEscaped + ) + + def toAscii(text): """Transforms a text with diacritical marks into a plain ASCII text. @@ -136,17 +163,17 @@

Module tf.browser.ner.helpers

n = 0 for part in parts: - if len(part) > CUT_OFF: - part = part[0:CUT_OFF] + if len(part) > PART_CUT_OFF: + part = part[0:PREFIX_PART] + "~" + part[-SUFFIX_PART:] nPart = len(part) - if n + nPart > CUT_OFF: - break - result.append(part) n += nPart + if n > CUT_OFF: + break + return ".".join(result) @@ -289,7 +316,24 @@

Module tf.browser.ner.helpers

if path in instructions: return path - return ()
+ return () + + +def reportName(eidkind, otherName, name): + if toId(otherName) == toId(name): + severity = "minor" + error = False + else: + severity = "major" + error = True + + console( + f"{severity} name variant for {eidkind}:\n" + f" first occurrence: '{otherName}'" + f" versus this sheet: '{name}'\n", + error=error, + ) + console(f" will use the first name for {eidkind}")
@@ -299,6 +343,10 @@

Global variables

var CUT_OFF
+

Maximum length of entity identifiers.

+
+
var PART_CUT_OFF
+

Maximum length of parts of entity identifiers.

var TO_ASCII_DEF
@@ -332,7 +380,7 @@

Returns

Expand source code -Browse git +Browse git
def findCompile(bFind, bFindC):
     """Compiles a regular expression out of a search pattern.
@@ -365,6 +413,35 @@ 

Returns

return (bFind, bFindRe, errorMsg)
+
+def fromTokens(tokens, spaceEscaped=False) +
+
+

The inverse of toTokens().

+

Doing first toTokens and then fromTokens is idempotent. +So if you have to revert back from tokens to text, +make sure that you have done a combo of toTokens and +fromTokens first. +You can use tnorm() for that.

+
+ +Expand source code +Browse git + +
def fromTokens(tokens, spaceEscaped=False):
+    """The inverse of `toTokens()`.
+
+    Doing first toTokens and then fromTokens is idempotent.
+    So if you have to revert back from tokens to text,
+    make sure that you have done a combo of toTokens and
+    fromTokens first.
+    You can use `tnorm()` for that.
+    """
+    return " ".join(
+        tuple(t.replace(" ", "_") for t in tokens) if spaceEscaped else tokens
+    )
+
+
def getPath(heading, instructions)
@@ -373,7 +450,7 @@

Returns

Expand source code -Browse git +Browse git
def getPath(heading, instructions):
     for n in range(len(heading), 0, -1):
@@ -402,7 +479,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def makeCss(features, keywordFeatures):
     """Generates CSS for the tool.
@@ -471,7 +548,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def normalize(text):
     """Normalize white-space in a text."""
@@ -494,7 +571,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def repIdent(features, vals, active=""):
     """Represents an identifier in HTML.
@@ -529,7 +606,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def repSummary(keywordFeatures, vals, active=""):
     """Represents an keyword value in HTML.
@@ -551,6 +628,49 @@ 

Parameters

)
+
+def reportName(eidkind, otherName, name) +
+
+
+
+ +Expand source code +Browse git + +
def reportName(eidkind, otherName, name):
+    if toId(otherName) == toId(name):
+        severity = "minor"
+        error = False
+    else:
+        severity = "major"
+        error = True
+
+    console(
+        f"{severity} name variant for {eidkind}:\n"
+        f"  first occurrence:            '{otherName}'"
+        f"  versus this sheet:           '{name}'\n",
+        error=error,
+    )
+    console(f"  will use the first name for {eidkind}")
+
+
+
+def tnorm(text, spaceEscaped=False) +
+
+
+
+ +Expand source code +Browse git + +
def tnorm(text, spaceEscaped=False):
+    return fromTokens(
+        toTokens(text, spaceEscaped=spaceEscaped), spaceEscaped=spaceEscaped
+    )
+
+
def toAscii(text)
@@ -563,7 +683,7 @@

Parameters

Expand source code -Browse git +Browse git
def toAscii(text):
     """Transforms a text with diacritical marks into a plain ASCII text.
@@ -589,7 +709,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def toId(text):
     """Transforms text to an identifier string.
@@ -612,7 +732,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def toSmallId(text, transform={}):
     """Transforms text to a smaller identifier string.
@@ -629,17 +749,17 @@ 

Parameters

n = 0 for part in parts: - if len(part) > CUT_OFF: - part = part[0:CUT_OFF] + if len(part) > PART_CUT_OFF: + part = part[0:PREFIX_PART] + "~" + part[-SUFFIX_PART:] nPart = len(part) - if n + nPart > CUT_OFF: - break - result.append(part) n += nPart + if n > CUT_OFF: + break + return ".".join(result)
@@ -659,7 +779,7 @@

Parameters

Expand source code -Browse git +Browse git
def toTokens(text, spaceEscaped=False):
     """Split a text into tokens.
@@ -686,7 +806,7 @@ 

Parameters

Expand source code -Browse git +Browse git
def valRep(features, fVals):
     """HTML representation of an entity as a sequence of `feat=val` strings."""
@@ -763,17 +883,21 @@ 

Index

  • Global variables

  • Functions

    • findCompile
    • +
    • fromTokens
    • getPath
    • makeCss
    • normalize
    • repIdent
    • repSummary
    • +
    • reportName
    • +
    • tnorm
    • toAscii
    • toId
    • toSmallId
    • diff --git a/tf/browser/ner/match.html b/tf/browser/ner/match.html index be79b5396..9aa47a309 100644 --- a/tf/browser/ner/match.html +++ b/tf/browser/ner/match.html @@ -34,7 +34,7 @@

      Module tf.browser.ner.match

      Expand source code -Browse git +Browse git
      """Match functions.
       
      @@ -43,10 +43,10 @@ 

      Module tf.browser.ner.match

      """ from .settings import NONE -from .helpers import getPath +from .helpers import getPath, fromTokens -def occMatch(getTokens, getHeadings, buckets, instructions): +def occMatch(getTokens, getHeadings, buckets, instructions, spaceEscaped): """Finds the occurrences of multiple sequences of tokens in a single bucket. Parameters @@ -66,9 +66,7 @@

      Module tf.browser.ner.match

      `sheet`: The information about the triggers; - `qSeqs`: The plain set of triggers; each trigger is a token sequence; - - `qMap`: A compilation of all triggers into a mapping so that you can + `tPos`: A compilation of all triggers into a mapping so that you can read off, given a position and a token, the set of all triggers that have that token at that position. @@ -80,14 +78,15 @@

      Module tf.browser.ner.match

      # at that position results = {} + shown = False for b in buckets: heading = getHeadings(b) path = getPath(heading, instructions) data = instructions[path] - qMap = data["qMap"] + tPos = data["tPos"] + tMap = data["tMap"] idMap = data["idMap"] - nameMap = data["nameMap"] # compile the bucket into logical tokens bTokensAll = getTokens(b) @@ -109,6 +108,9 @@

      Module tf.browser.ner.match

      bStrings = tuple(bStrings) nBStrings = len(bStrings) + if not shown and heading[0] == "4" and heading[1] == "48": + shown = True + # perform the search i = 0 @@ -120,7 +122,7 @@

      Module tf.browser.ner.match

      while i + j < nBStrings: k = i + j sj = bStrings[k] - newCandidates = qMap.get(j, {}).get(sj, set()) + newCandidates = tPos.get(j, {}).get(sj, set()) if candidateMatches is None: candidateMatches = newCandidates @@ -138,14 +140,14 @@

      Module tf.browser.ner.match

      if len(resultMatches): resultMatch = resultMatches[0] + trigger = fromTokens(resultMatch, spaceEscaped=spaceEscaped) + tPath = tMap[trigger] firstT = bStringFirst[i] lastT = bStringLast[i + m] slots = tuple(range(firstT, lastT + 1)) - eidkind = idMap[resultMatch] - name = nameMap[eidkind] - dest = results.setdefault(eidkind, {}).setdefault(path, {}) - dest["name"] = name - destHits = dest.setdefault("hits", {}).setdefault(resultMatch, []) + eidkind = idMap[trigger] + dest = results.setdefault(eidkind, {}).setdefault(trigger, {}) + destHits = dest.setdefault(tPath, []) destHits.append(slots) break @@ -200,7 +202,7 @@

      Module tf.browser.ner.match

      nTokens = len(qTokens) for i, s in enumerate(bStrings): - if qTokens != bStrings[i:i + nTokens]: + if qTokens != bStrings[i : i + nTokens]: continue firstT = bStringFirst[i] @@ -447,7 +449,7 @@

      Returns

      Expand source code -Browse git +Browse git
      def entityMatch(
           entityIndex,
      @@ -639,7 +641,7 @@ 

      Returns

      -def occMatch(getTokens, getHeadings, buckets, instructions) +def occMatch(getTokens, getHeadings, buckets, instructions, spaceEscaped)

      Finds the occurrences of multiple sequences of tokens in a single bucket.

      @@ -659,8 +661,7 @@

      Parameters

      at parent keys. The value at a key is a dict with keys:

      sheet: The information about the triggers;

      -

      qSeqs: The plain set of triggers; each trigger is a token sequence;

      -

      qMap: A compilation of all triggers into a mapping so that you can

      +

      tPos: A compilation of all triggers into a mapping so that you can

      read off, given a position and a token, the set of all triggers that have that token at that position.

      @@ -668,9 +669,9 @@

      Parameters

      Expand source code -Browse git +Browse git -
      def occMatch(getTokens, getHeadings, buckets, instructions):
      +
      def occMatch(getTokens, getHeadings, buckets, instructions, spaceEscaped):
           """Finds the occurrences of multiple sequences of tokens in a single bucket.
       
           Parameters
      @@ -690,9 +691,7 @@ 

      Parameters

      `sheet`: The information about the triggers; - `qSeqs`: The plain set of triggers; each trigger is a token sequence; - - `qMap`: A compilation of all triggers into a mapping so that you can + `tPos`: A compilation of all triggers into a mapping so that you can read off, given a position and a token, the set of all triggers that have that token at that position. @@ -704,14 +703,15 @@

      Parameters

      # at that position results = {} + shown = False for b in buckets: heading = getHeadings(b) path = getPath(heading, instructions) data = instructions[path] - qMap = data["qMap"] + tPos = data["tPos"] + tMap = data["tMap"] idMap = data["idMap"] - nameMap = data["nameMap"] # compile the bucket into logical tokens bTokensAll = getTokens(b) @@ -733,6 +733,9 @@

      Parameters

      bStrings = tuple(bStrings) nBStrings = len(bStrings) + if not shown and heading[0] == "4" and heading[1] == "48": + shown = True + # perform the search i = 0 @@ -744,7 +747,7 @@

      Parameters

      while i + j < nBStrings: k = i + j sj = bStrings[k] - newCandidates = qMap.get(j, {}).get(sj, set()) + newCandidates = tPos.get(j, {}).get(sj, set()) if candidateMatches is None: candidateMatches = newCandidates @@ -762,14 +765,14 @@

      Parameters

      if len(resultMatches): resultMatch = resultMatches[0] + trigger = fromTokens(resultMatch, spaceEscaped=spaceEscaped) + tPath = tMap[trigger] firstT = bStringFirst[i] lastT = bStringLast[i + m] slots = tuple(range(firstT, lastT + 1)) - eidkind = idMap[resultMatch] - name = nameMap[eidkind] - dest = results.setdefault(eidkind, {}).setdefault(path, {}) - dest["name"] = name - destHits = dest.setdefault("hits", {}).setdefault(resultMatch, []) + eidkind = idMap[trigger] + dest = results.setdefault(eidkind, {}).setdefault(trigger, {}) + destHits = dest.setdefault(tPath, []) destHits.append(slots) break @@ -802,7 +805,7 @@

      Parameters

      Expand source code -Browse git +Browse git
      def occMatchOld(getTokens, b, qSeqs, results):
           """Finds the occurrences of multiple sequences of tokens in a single bucket.
      @@ -849,7 +852,7 @@ 

      Parameters

      nTokens = len(qTokens) for i, s in enumerate(bStrings): - if qTokens != bStrings[i:i + nTokens]: + if qTokens != bStrings[i : i + nTokens]: continue firstT = bStringFirst[i] diff --git a/tf/browser/ner/ner.html b/tf/browser/ner/ner.html index 763ade47c..77cb185ea 100644 --- a/tf/browser/ner/ner.html +++ b/tf/browser/ner/ner.html @@ -196,7 +196,7 @@

      Inspection

      Expand source code -Browse git +Browse git
      """API for rule-based entity marking.
       
      @@ -505,89 +505,104 @@ 

      Inspection

      app.indent(reset=True) app.info("Looking up occurrences of many candidates ...") self.findOccs() - app.info("Done") - - def showInventory(self, expanded=False, localOnly=False): - """Shows the inventory. + inventory = self.inventory + nEnt = len(inventory) + totalHits = sum( + sum( + sum(len(x) for x in pathData.values()) + for pathData in triggerData.values() + ) + for triggerData in inventory.values() + ) + console(f"{totalHits} for {nEnt} entities") - The surface forms in the inventory are put into the context of the entities - of which they are surface forms. - """ + def showInventory(self, expanded=False, localOnly=False, missingOnly=False): + """Shows the inventory.""" if not self.properlySetup: return + Trig = self.Trig + nameMap = Trig.nameMap inventory = self.inventory + instructions = self.instructions - nEnt = len(inventory) - totalHits = 0 + if not missingOnly: + i = 0 - headLine = "{totalHits} x of {nEnt} entities" - lines = [] + for eidkind, triggerData in sorted(inventory.items()): + i += 1 + if not expanded and i > 20: + break - n = 0 + entityHits = sum( + sum(len(x) for x in pathData.values()) + for pathData in triggerData.values() + ) + if localOnly: + localHits = sum( + sum(len(x) for (path, x) in pathData.items() if path != ()) + for pathData in triggerData.values() + ) + if localHits == 0: + continue - for (eid, kind), data in sorted(inventory.items()): - if localOnly and all(path == () for path in data): - continue + name = nameMap[eidkind][0] + console(f"{entityHits} x '{name}'") - n += 1 + for trigger, pathData in sorted(triggerData.items()): + triggerHits = sum(len(x) for x in pathData.values()) + console(f" {triggerHits} x {trigger}") - entityHits = 0 + for path, occs in sorted(pathData.items()): + pathHits = len(occs) + pathRep = ".".join(path) + console(f" {pathHits} x from [{pathRep}]") - entHeadLine = "{entityHits} x {kind} {eid}" - eLines = [] + instructions = self.instructions + allTriggers = set() + notFound = [] - isOnePath = len(data) == 1 + for (path, data) in instructions.items(): + sheet = data["sheet"] + tMap = data["tMap"] - for path, info in sorted(data.items()): - name = info["name"] - pathRep = ".".join(path) - localHeadLine = ( - f"[{pathRep}]: {name}" - if isOnePath - else "{localHits} x [{pathRep}]: {name}" - ) - llines = [] + for (eidkind, triggers) in sheet.items(): + for trigger in triggers: + tPath = tMap[trigger] + allTriggers.add((eidkind, trigger, tPath)) - hits = info["hits"] - localHits = 0 + i = 0 - isOneQ = len(hits) == 1 + for e in sorted(allTriggers): + i += 1 + if not expanded and i > 20: + break - for q, occs in sorted(hits.items()): - qRep = "(" + " ".join(q) + ")" - nOccs = len(occs) - localHits += nOccs + (eidkind, trigger, tPath) = e + entInfo = inventory.get(eidkind, None) - if isOneQ: - localHeadLine += f": {nOccs} x {qRep}" - else: - llines.append(f" {nOccs} x {qRep}") + if entInfo is None: + notFound.append(("E", e)) + continue - entityHits += localHits + triggerInfo = entInfo.get(trigger, None) - if isOnePath: - entHeadLine += localHeadLine - else: - eLines.append( - localHeadLine.format( - pathRep=pathRep, name=name, localHits=localHits - ) - ) - eLines.extend(llines) + if triggerInfo is None: + notFound.append(("T", e)) + continue - totalHits += entityHits + pathInfo = triggerInfo.get(tPath, None) - if expanded or n <= 10: - lines.append( - entHeadLine.format(kind=kind, eid=eid, entityHits=entityHits) - ) - lines.extend(eLines) + if pathInfo is None: + notFound.append(("P", e)) - console(headLine.format(nEnt=nEnt, totalHits=totalHits)) + if len(notFound) == 0: + console("Found matches for all triggers") + else: + console(f"{len(notFound)} triggers have no match:") - for line in lines: - console(line) + for (label, (eidkind, trigger, tPath)) in notFound: + console(f"{label} '{nameMap[eidkind][0]}' as '{trigger}' in {tPath}") def markEntities(self): """Marks up the members of the inventory as entities. @@ -674,7 +689,7 @@

      Parameters

      Expand source code -Browse git +Browse git
      class NER(Annotate):
           def __init__(self, app):
      @@ -752,89 +767,104 @@ 

      Parameters

      app.indent(reset=True) app.info("Looking up occurrences of many candidates ...") self.findOccs() - app.info("Done") - - def showInventory(self, expanded=False, localOnly=False): - """Shows the inventory. + inventory = self.inventory + nEnt = len(inventory) + totalHits = sum( + sum( + sum(len(x) for x in pathData.values()) + for pathData in triggerData.values() + ) + for triggerData in inventory.values() + ) + console(f"{totalHits} for {nEnt} entities") - The surface forms in the inventory are put into the context of the entities - of which they are surface forms. - """ + def showInventory(self, expanded=False, localOnly=False, missingOnly=False): + """Shows the inventory.""" if not self.properlySetup: return + Trig = self.Trig + nameMap = Trig.nameMap inventory = self.inventory + instructions = self.instructions - nEnt = len(inventory) - totalHits = 0 + if not missingOnly: + i = 0 - headLine = "{totalHits} x of {nEnt} entities" - lines = [] + for eidkind, triggerData in sorted(inventory.items()): + i += 1 + if not expanded and i > 20: + break - n = 0 + entityHits = sum( + sum(len(x) for x in pathData.values()) + for pathData in triggerData.values() + ) + if localOnly: + localHits = sum( + sum(len(x) for (path, x) in pathData.items() if path != ()) + for pathData in triggerData.values() + ) + if localHits == 0: + continue - for (eid, kind), data in sorted(inventory.items()): - if localOnly and all(path == () for path in data): - continue + name = nameMap[eidkind][0] + console(f"{entityHits} x '{name}'") - n += 1 + for trigger, pathData in sorted(triggerData.items()): + triggerHits = sum(len(x) for x in pathData.values()) + console(f" {triggerHits} x {trigger}") - entityHits = 0 + for path, occs in sorted(pathData.items()): + pathHits = len(occs) + pathRep = ".".join(path) + console(f" {pathHits} x from [{pathRep}]") - entHeadLine = "{entityHits} x {kind} {eid}" - eLines = [] + instructions = self.instructions + allTriggers = set() + notFound = [] - isOnePath = len(data) == 1 + for (path, data) in instructions.items(): + sheet = data["sheet"] + tMap = data["tMap"] - for path, info in sorted(data.items()): - name = info["name"] - pathRep = ".".join(path) - localHeadLine = ( - f"[{pathRep}]: {name}" - if isOnePath - else "{localHits} x [{pathRep}]: {name}" - ) - llines = [] + for (eidkind, triggers) in sheet.items(): + for trigger in triggers: + tPath = tMap[trigger] + allTriggers.add((eidkind, trigger, tPath)) - hits = info["hits"] - localHits = 0 + i = 0 - isOneQ = len(hits) == 1 + for e in sorted(allTriggers): + i += 1 + if not expanded and i > 20: + break - for q, occs in sorted(hits.items()): - qRep = "(" + " ".join(q) + ")" - nOccs = len(occs) - localHits += nOccs + (eidkind, trigger, tPath) = e + entInfo = inventory.get(eidkind, None) - if isOneQ: - localHeadLine += f": {nOccs} x {qRep}" - else: - llines.append(f" {nOccs} x {qRep}") + if entInfo is None: + notFound.append(("E", e)) + continue - entityHits += localHits + triggerInfo = entInfo.get(trigger, None) - if isOnePath: - entHeadLine += localHeadLine - else: - eLines.append( - localHeadLine.format( - pathRep=pathRep, name=name, localHits=localHits - ) - ) - eLines.extend(llines) + if triggerInfo is None: + notFound.append(("T", e)) + continue - totalHits += entityHits + pathInfo = triggerInfo.get(tPath, None) - if expanded or n <= 10: - lines.append( - entHeadLine.format(kind=kind, eid=eid, entityHits=entityHits) - ) - lines.extend(eLines) + if pathInfo is None: + notFound.append(("P", e)) - console(headLine.format(nEnt=nEnt, totalHits=totalHits)) + if len(notFound) == 0: + console("Found matches for all triggers") + else: + console(f"{len(notFound)} triggers have no match:") - for line in lines: - console(line) + for (label, (eidkind, trigger, tPath)) in notFound: + console(f"{label} '{nameMap[eidkind][0]}' as '{trigger}' in {tPath}") def markEntities(self): """Marks up the members of the inventory as entities. @@ -928,7 +958,7 @@

      Parameters

      Expand source code -Browse git +Browse git
      def bakeEntities(self, versionExtension="e"):
           """Bakes the entities of the current set as nodes into a new TF data source.
      @@ -955,7 +985,7 @@ 

      Parameters

      Expand source code -Browse git +Browse git
      def makeInventory(self):
           """Explores the corpus for the surface forms mentioned in the instructions.
      @@ -978,7 +1008,16 @@ 

      Parameters

      app.indent(reset=True) app.info("Looking up occurrences of many candidates ...") self.findOccs() - app.info("Done")
      + inventory = self.inventory + nEnt = len(inventory) + totalHits = sum( + sum( + sum(len(x) for x in pathData.values()) + for pathData in triggerData.values() + ) + for triggerData in inventory.values() + ) + console(f"{totalHits} for {nEnt} entities")
      @@ -993,7 +1032,7 @@

      Parameters

      Expand source code -Browse git +Browse git
      def markEntities(self):
           """Marks up the members of the inventory as entities.
      @@ -1058,7 +1097,7 @@ 

      Parameters

      Expand source code -Browse git +Browse git
      def readInstructions(self, sheetName):
           """Reads the trigger specifications.
      @@ -1089,98 +1128,102 @@ 

      Parameters

      -def showInventory(self, expanded=False, localOnly=False) +def showInventory(self, expanded=False, localOnly=False, missingOnly=False)
      -

      Shows the inventory.

      -

      The surface forms in the inventory are put into the context of the entities -of which they are surface forms.

      +

      Shows the inventory.

      Expand source code -Browse git +Browse git -
      def showInventory(self, expanded=False, localOnly=False):
      -    """Shows the inventory.
      -
      -    The surface forms in the inventory are put into the context of the entities
      -    of which they are surface forms.
      -    """
      +
      def showInventory(self, expanded=False, localOnly=False, missingOnly=False):
      +    """Shows the inventory."""
           if not self.properlySetup:
               return
       
      +    Trig = self.Trig
      +    nameMap = Trig.nameMap
           inventory = self.inventory
      +    instructions = self.instructions
       
      -    nEnt = len(inventory)
      -    totalHits = 0
      +    if not missingOnly:
      +        i = 0
       
      -    headLine = "{totalHits} x of {nEnt} entities"
      -    lines = []
      +        for eidkind, triggerData in sorted(inventory.items()):
      +            i += 1
      +            if not expanded and i > 20:
      +                break
       
      -    n = 0
      +            entityHits = sum(
      +                sum(len(x) for x in pathData.values())
      +                for pathData in triggerData.values()
      +            )
      +            if localOnly:
      +                localHits = sum(
      +                    sum(len(x) for (path, x) in pathData.items() if path != ())
      +                    for pathData in triggerData.values()
      +                )
      +                if localHits == 0:
      +                    continue
       
      -    for (eid, kind), data in sorted(inventory.items()):
      -        if localOnly and all(path == () for path in data):
      -            continue
      +            name = nameMap[eidkind][0]
      +            console(f"{entityHits} x '{name}'")
       
      -        n += 1
      +            for trigger, pathData in sorted(triggerData.items()):
      +                triggerHits = sum(len(x) for x in pathData.values())
      +                console(f"    {triggerHits} x {trigger}")
       
      -        entityHits = 0
      +                for path, occs in sorted(pathData.items()):
      +                    pathHits = len(occs)
      +                    pathRep = ".".join(path)
      +                    console(f"        {pathHits} x from [{pathRep}]")
       
      -        entHeadLine = "{entityHits} x {kind} {eid}"
      -        eLines = []
      +    instructions = self.instructions
      +    allTriggers = set()
      +    notFound = []
       
      -        isOnePath = len(data) == 1
      +    for (path, data) in instructions.items():
      +        sheet = data["sheet"]
      +        tMap = data["tMap"]
       
      -        for path, info in sorted(data.items()):
      -            name = info["name"]
      -            pathRep = ".".join(path)
      -            localHeadLine = (
      -                f"[{pathRep}]: {name}"
      -                if isOnePath
      -                else "{localHits} x [{pathRep}]: {name}"
      -            )
      -            llines = []
      +        for (eidkind, triggers) in sheet.items():
      +            for trigger in triggers:
      +                tPath = tMap[trigger]
      +                allTriggers.add((eidkind, trigger, tPath))
       
      -            hits = info["hits"]
      -            localHits = 0
      +    i = 0
       
      -            isOneQ = len(hits) == 1
      +    for e in sorted(allTriggers):
      +        i += 1
      +        if not expanded and i > 20:
      +            break
       
      -            for q, occs in sorted(hits.items()):
      -                qRep = "(" + " ".join(q) + ")"
      -                nOccs = len(occs)
      -                localHits += nOccs
      +        (eidkind, trigger, tPath) = e
      +        entInfo = inventory.get(eidkind, None)
       
      -                if isOneQ:
      -                    localHeadLine += f": {nOccs} x {qRep}"
      -                else:
      -                    llines.append(f"    {nOccs} x {qRep}")
      +        if entInfo is None:
      +            notFound.append(("E", e))
      +            continue
       
      -            entityHits += localHits
      +        triggerInfo = entInfo.get(trigger, None)
       
      -            if isOnePath:
      -                entHeadLine += localHeadLine
      -            else:
      -                eLines.append(
      -                    localHeadLine.format(
      -                        pathRep=pathRep, name=name, localHits=localHits
      -                    )
      -                )
      -            eLines.extend(llines)
      +        if triggerInfo is None:
      +            notFound.append(("T", e))
      +            continue
       
      -        totalHits += entityHits
      +        pathInfo = triggerInfo.get(tPath, None)
       
      -        if expanded or n <= 10:
      -            lines.append(
      -                entHeadLine.format(kind=kind, eid=eid, entityHits=entityHits)
      -            )
      -            lines.extend(eLines)
      +        if pathInfo is None:
      +            notFound.append(("P", e))
       
      -    console(headLine.format(nEnt=nEnt, totalHits=totalHits))
      +    if len(notFound) == 0:
      +        console("Found matches for all triggers")
      +    else:
      +        console(f"{len(notFound)} triggers have no match:")
       
      -    for line in lines:
      -        console(line)
      + for (label, (eidkind, trigger, tPath)) in notFound: + console(f"{label} '{nameMap[eidkind][0]}' as '{trigger}' in {tPath}")
  • diff --git a/tf/browser/ner/request.html b/tf/browser/ner/request.html index 1edf973f4..304bf5e78 100644 --- a/tf/browser/ner/request.html +++ b/tf/browser/ner/request.html @@ -34,7 +34,7 @@

    Module tf.browser.ner.request

    Expand source code -Browse git +Browse git
    """Auxiliary functions for managing request data.
     
    @@ -375,7 +375,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Request(Form):
         def __init__(self):
    @@ -693,7 +693,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def adaptValSelect(self):
         """Adapts the values contained in `valSelect` after a modification action.
    @@ -754,7 +754,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def findSetup(self):
         """Compiles the filter pattern into a regular expression.
    @@ -803,7 +803,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def getFormData(self):
         """Get form data.
    @@ -885,7 +885,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def initVars(self):
         """Initializes the computation of the new page.
    diff --git a/tf/browser/ner/serve.html b/tf/browser/ner/serve.html
    index d6608319c..be9a2bb01 100644
    --- a/tf/browser/ner/serve.html
    +++ b/tf/browser/ner/serve.html
    @@ -36,7 +36,7 @@ 

    Module tf.browser.ner.serve

    Expand source code -Browse git +Browse git
    """Main controller for Flask
     
    @@ -405,7 +405,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def serveNer(web):
         """Main controller to render a full page.
    @@ -437,7 +437,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def serveNerContext(web, node):
         """Controller to render a portion of a page.
    @@ -479,7 +479,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Serve(Request, Fragments):
         def __init__(self, web):
    @@ -800,7 +800,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def actionsFull(self):
         """Carries out requested actions before building the full page.
    @@ -826,7 +826,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def actionsLean(self, node):
         """Carries out requested actions before building a portion of the page.
    @@ -868,7 +868,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def getBuckets(self, noFind=False, node=None):
         """Fetch a selection of buckets from the corpus.
    @@ -956,7 +956,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setHandling(self):
         """Carries out the set-related actions before composing the page.
    @@ -1021,7 +1021,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setupFull(self):
         """Prepares to serve a complete page.
    @@ -1050,7 +1050,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setupLean(self):
         """Prepares to update a portion of the page.
    @@ -1075,7 +1075,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def updateHandling(self):
         """Carries out modification actions in the current annotation set.
    @@ -1148,7 +1148,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def wrapFull(self):
         """Builds the full page.
    @@ -1194,7 +1194,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def wrapLean(self):
         """Builds a portion of the page.
    diff --git a/tf/browser/ner/sets.html b/tf/browser/ner/sets.html
    index 132eee29c..dd87aba76 100644
    --- a/tf/browser/ner/sets.html
    +++ b/tf/browser/ner/sets.html
    @@ -36,7 +36,7 @@ 

    Module tf.browser.ner.sets

    Expand source code -Browse git +Browse git
    """Annotation set management.
     
    @@ -382,7 +382,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Sets(Data):
         def __init__(self, data=None):
    @@ -705,7 +705,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def getSetData(self):
         """Deliver the data of the current set.
    @@ -727,7 +727,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def readSets(self):
         """Read the list current annotation sets (again).
    @@ -748,7 +748,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def resetSet(self):
         """Clear the current annotation set.
    @@ -802,7 +802,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setDel(self, delSet):
         """Remove a named set.
    @@ -865,7 +865,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setDup(self, dupSet):
         """Duplicates the current set to a set with a new name.
    @@ -942,7 +942,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setMove(self, moveSet):
         """Renames a named set.
    @@ -1012,7 +1012,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setSet(self, newAnnoSet):
         """Switch to a named annotation set.
    diff --git a/tf/browser/ner/settings.html b/tf/browser/ner/settings.html
    index e20867674..edb81cd36 100644
    --- a/tf/browser/ner/settings.html
    +++ b/tf/browser/ner/settings.html
    @@ -34,7 +34,7 @@ 

    Module tf.browser.ner.settings

    Expand source code -Browse git +Browse git
    """Corpus dependent setup of the annotation tool.
     
    @@ -393,7 +393,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Settings:
         def __init__(self):
    @@ -455,7 +455,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def console(self, msg, **kwargs):
         """Print something to the output.
    diff --git a/tf/browser/ner/show.html b/tf/browser/ner/show.html
    index cbae760f5..110b9bd8f 100644
    --- a/tf/browser/ner/show.html
    +++ b/tf/browser/ner/show.html
    @@ -34,7 +34,7 @@ 

    Module tf.browser.ner.show

    Expand source code -Browse git +Browse git
    """Rendering of corpus extracts with annotations.
     
    @@ -449,7 +449,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Show:
         def showEntityOverview(self):
    @@ -888,7 +888,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def showContent(
         self,
    @@ -1159,7 +1159,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def showEntities(
         self, activeEntity=None, sortKey=None, sortDir=None, cutOffFreq=None
    @@ -1297,7 +1297,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def showEntityOverview(self):
         """Generates HTML for an overview of the entities.
    diff --git a/tf/browser/ner/triggers.html b/tf/browser/ner/triggers.html
    index b4016607c..8e4ec20a3 100644
    --- a/tf/browser/ner/triggers.html
    +++ b/tf/browser/ner/triggers.html
    @@ -31,13 +31,12 @@ 

    Module tf.browser.ner.triggers

    Expand source code -Browse git +Browse git
    import collections
     import re
    -from copy import deepcopy
     
    -from .helpers import normalize, toSmallId, toTokens
    +from .helpers import tnorm, normalize, toId, toSmallId, toTokens
     from ...core.helpers import console
     from ...core.files import dirContents
     
    @@ -59,6 +58,13 @@ 

    Module tf.browser.ner.triggers

    defaultValues = settings.defaultValues self.defaultKind = defaultValues.get(kindFeature, "") + self.nameMap = {} + """Will contain a mapping from entities to names. + + The entities are keyed by their (eid, kind) tuple. + The values are names plus the sheet where they are first defined. + """ + self.instructions = None """Will contain the information in a spreadsheet for marking up entities.""" @@ -67,6 +73,8 @@

    Module tf.browser.ner.triggers

    defaultKind = self.defaultKind transform = self.transform sheetDir = self.sheetDir + nameMap = self.nameMap + spaceEscaped = self.spaceEscaped sheetPath = f"{sheetDir}/{sheetRela}.xlsx" @@ -78,8 +86,7 @@

    Module tf.browser.ner.triggers

    sheet = {} - nameFirstRow = {} - eidFirstRow = {} + idFirstRow = {} for r, row in enumerate(ws.rows): if r in {0, 1}: @@ -87,19 +94,23 @@

    Module tf.browser.ner.triggers

    if not any(c.value for c in row): continue - (name, kind, synonymStr) = (normalize(row[i].value or "") for i in range(3)) - synonyms = ( + (name, kind, triggerStr) = (normalize(row[i].value or "") for i in range(3)) + triggers = ( set() - if not synonymStr - else {y for x in synonymStr.split(";") if (y := normalize(x)) != ""} + if not triggerStr + else { + y + for x in triggerStr.split(";") + if (y := tnorm(x, spaceEscaped=spaceEscaped)) != "" + } ) if not name: - name = synonyms[0] if synonyms else "" + name = list(triggers)[0] if triggers else "" if name == "": if kind: console( f"{sheetRela} row {r + 1:>3}: {kind}: " - "no entity name and no synonyms" + "no entity name and no triggers" ) continue else: @@ -115,27 +126,57 @@

    Module tf.browser.ner.triggers

    f"no kind name, supplied {defaultKind}" ) - fr = nameFirstRow.get(name, None) - nameFirstRow[name] = r + 1 + eid = toSmallId(name, transform=transform) + eidkind = (eid, kind) + firstRowEid = idFirstRow.get((eidkind), None) - if fr is not None: - console( - f"{sheetRela} row {r + 1:>3}: " - f"Name already seen in row {fr}: {name}" - ) - continue + if firstRowEid is None: + idFirstRow[eidkind] = (r, name) + sheet[eidkind] = triggers - eid = toSmallId(name, transform=transform) - fr = eidFirstRow.get(eid, None) + prev = nameMap.get(eidkind, None) + + if prev is None: + nameMap[eidkind] = (name, sheetRela) + else: + (prevName, prevSheet) = prev + + if prevName != name: + if toId(prevName) == toId(name): + severity = "minor" + error = False + else: + severity = "major" + error = True + + console( + f"{severity} name variant for {eidkind}:\n" + f" in {prevSheet:<30} : '{prevName}'\n" + f" in {sheetRela:<30} : '{name}'", + error=error, + ) + console(f" will use '{prevName}' for {eidkind}") + + else: + (firstRow, firstName) = firstRowEid + if firstName == name: + severity = "identical" + error = False + elif toId(firstName) == toId(name): + severity = "minor variant in" + error = False + else: + severity = "major variant in" + error = True - if fr is not None: console( - f"{sheetRela} row {r + 1:>3}: " - f"Eid already seen in row {fr}: {eid}" + f"{severity} name for {eidkind}:\n" + f" in {firstRow + 1:<3} : '{firstName}'\n" + f" in {r + 1:<3} : '{name}'\n", + error=error, ) - continue - - sheet[eid] = dict(name=name, kind=kind, occspecs=synonyms) + console(f" will merge triggers {triggers} with {sheet[eidkind]}") + sheet[eidkind] |= triggers return sheet @@ -186,227 +227,294 @@

    Module tf.browser.ner.triggers

    sheetMain = self.readXls(sheetName) sheetSubdirs = self.readDir(sheetName, 1) - self.rawInfo = dict(main=sheetMain, sdr=sheetSubdirs) + self.raw = dict(main=sheetMain, sdr=sheetSubdirs) self.compile() def compile(self): spaceEscaped = self.spaceEscaped - rawInfo = self.rawInfo + raw = self.raw sheetName = self.sheetName + nameMap = self.nameMap - sheetMain = rawInfo["main"] - sheetTweaked = rawInfo["sdr"] + sheetMain = raw["main"] + sheetTweaked = raw["sdr"] - compiled = {"": dict(sheet=sheetMain)} - self.compiled = compiled - instructions = {} - self.instructions = instructions + # combine the info in ranged sheets into single number sheets + + combined = dict(sheet=sheetMain, tweaks={}) + self.combined = combined - def compileDir(parentSheet, sdr, dest): - ranged = sdr.get("rng", {}) - single = sdr.get("sng", {}) - subdirs = sdr.get("sdr", {}) + def combineDir(data, dest): + ranged = data.get("rng", {}) + single = data.get("sng", {}) + subdirs = data.get("sdr", {}) for (start, end), sheet in sorted(ranged.items()): for i in range(start, end + 1): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) - ) - parentCopy = dest["tweaks"][i]["sheet"] - - for eid, info in sheet.items(): - parentCopy[eid] = info + updateDest = dest.setdefault(i, {}).setdefault("sheet", {}) + for eidkind, triggers in sheet.items(): + updateDest[eidkind] = triggers for i, sheet in single.items(): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) - ) - parentCopy = dest["tweaks"][i]["sheet"] - - for eid, info in sheet.items(): - parentCopy[eid] = info + updateDest = dest.setdefault(i, {}).setdefault("sheet", {}) + for eidkind, triggers in sheet.items(): + updateDest[eidkind] = triggers for i, tweaks in subdirs.items(): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) + updateDest = dest.setdefault(i, {}).setdefault("tweaks", {}) + combineDir(tweaks, updateDest) + + combineDir(sheetTweaked, combined["tweaks"]) + + # compile the info in tweaked sheets into complete sheets + # by applying overrides to copies of parent sheets; + # also collect additional data for the later computations: + # tMap: + # remembers for each trigger the path to the spreadsheet + # that provides the definition used in this sheet + + compiled = {} + self.compiled = compiled + + def compileSheet(path, parentData, data, dest): + parentSheet = parentData["sheet"] + sheet = data["sheet"] + newSheet = {} + dest["sheet"] = newSheet + parentTMap = parentData.get("tMap", {}) + newTMap = {} + dest["tMap"] = newTMap + + for eidkind, triggers in parentSheet.items(): + newSheet[eidkind] = triggers + + for trigger, p in parentTMap.items(): + newTMap[trigger] = p + + for eidkind, triggers in sheet.items(): + newSheet[eidkind] = triggers + + for trigger in triggers: + newTMap[trigger] = tuple(str(k) for k in path) + + def compileDir(path, parentData, data, dest): + if "sheet" in data: + compileSheet(path, parentData, data, dest) + parentData = dict(sheet=dest["sheet"], tMap=dest["tMap"]) + + tweaks = data.get("tweaks", {}) + tweakDest = dest.setdefault("tweaks", {}) + + for k in sorted(tweaks): + compileDir( + path + (k,), parentData, tweaks[k], tweakDest.setdefault(k, {}) ) - parentCopy = dest["tweaks"][i]["sheet"] - compileDir(parentCopy, tweaks, dest["tweaks"][i]) - compileDir(sheetMain, sheetTweaked, compiled) + compileDir((), combined, combined, compiled) + + # Now we have complete sheets for every context, the inheritance is resolved. + # We perform additional checks. + # We then generate instructions that will drive the search process. + # The instructions are stored in a dict, keyed by the path for which + # the instructions are valid. + + instructions = {} + self.instructions = instructions diags = set() - def prepareSheet(path, sheet): + def prepareSheet(path, info): + sheet = info["sheet"] + tMap = info["tMap"] sheetRep = sheetName if path == () else ".".join(path) - console(f"Checking {sheetRep}") - namesByOcc = collections.defaultdict(list) - qSeqs = set() - qMap = collections.defaultdict(lambda: collections.defaultdict(set)) - idMap = {} - nameMap = {} + triggerSet = set() + tPos = collections.defaultdict(lambda: collections.defaultdict(set)) + idMap = collections.defaultdict(list) - data = dict( - sheet=sheet, qSeqs=qSeqs, qMap=qMap, idMap=idMap, nameMap=nameMap - ) + data = dict(sheet=sheet, tPos=tPos, tMap=tMap) instructions[path] = data - for eid, info in sheet.items(): - name = info["name"] - kind = info["kind"] - occspecs = info["occspecs"] + for eidkind, triggers in sheet.items(): + for trigger in triggers: + triggerT = toTokens(trigger, spaceEscaped=spaceEscaped) + triggerSet.add(triggerT) + idMap[trigger].append(eidkind) + + for triggerT in triggerSet: + for i, token in enumerate(triggerT): + tPos[i][token].add(triggerT) + + nEnt = len(sheet) + nTriggers = sum(len(triggers) for triggers in sheet.values()) + noTriggers = sum(1 for triggers in sheet.values() if len(triggers) == 0) + noTrigMsg = ( + "" + if noTriggers == 0 + else f", {noTriggers} without triggers;" + ) - nameMap[(eid, kind)] = name + ambi = 0 + msgs = [] - for occspec in occspecs: - namesByOcc[occspec].append(name) - qTokens = toTokens(occspec, spaceEscaped=spaceEscaped) - qSeqs.add(qTokens) - idMap[qTokens] = (eid, kind) + for trigger, eidkinds in sorted(idMap.items()): + if len(eidkinds) == 1: + continue - for qTokens in qSeqs: - for i, qToken in enumerate(qTokens): - qMap[i][qToken].add(qTokens) + diag = (trigger, tuple(eidkinds)) - nEid = len(sheet) - nOcc = sum(len(info["occspecs"]) for info in sheet.values()) - noOccs = sum(1 for info in sheet.values() if len(info["occspecs"]) == 0) - console(f" {nEid} entities with {nOcc} occurrence specs") - console(f" {noOccs} entities do not have occurrence specifiers") + if diag not in diags: + diags.add(diag) + msgs.append(f""" trigger '{trigger}' used for:""") - nm = 0 + for eidkind in eidkinds: + msgs.append(f"\t{nameMap[eidkind][0]}") - for occSpec, names in sorted(namesByOcc.items()): - if len(names) == 1: - continue + ambi += 1 - diag = (occSpec, tuple(names)) - if diag not in diags: - diags.add(diag) - console(f""""{occSpec}" used for:""") - for name in names: - console(f"\t{name}") - nm += 1 + ambiMsg = "" if ambi == 0 else f", {ambi} ambiguous" - if nm == 0: - console(" All occurrence specifiers are unambiguous") - else: - console(f" {nm} occurrence specifiers are ambiguous") - - def prepareTweaks(path, tweaks): - for i in sorted(tweaks): - newPath = path + (str(i),) - subTweaks = tweaks[i] - prepareSheet(newPath, subTweaks["sheet"]) - - if "tweaks" in subTweaks: - prepareTweaks(newPath, subTweaks["tweaks"]) - - prepareSheet((), compiled[""]["sheet"]) - prepareTweaks((), compiled.get("tweaks", {})) - - def showInheritance(self): - compiled = self.compiled - - def showSheet(parentSheet, sheet, tab): - allKeys = set(sheet) | set(parentSheet) - - console(f"{tab} sheet with {len(allKeys)} keys") - - for eid in allKeys: - info = sheet.get(eid, {}) - parentInfo = parentSheet.get(eid, {}) - name = info.get("name", None) - parentName = parentInfo.get("name", None) - kind = info.get("kind", None) - parentKind = parentInfo.get("kind", None) - occspecs = info.get("occspecs", None) - parentOccspecs = parentInfo.get("occspecs", None) - - diffName = parentName != name - diffKind = parentKind != kind - diffOccspecs = parentOccspecs != occspecs - - if diffName or diffKind or diffOccspecs: - nameRep = ( - f"{parentName or 'ø'} => {name or 'ø'}" - if diffName - else f"{name}" - ) - kindRep = ( - f"{parentKind or 'ø'} => {kind or 'ø'}" - if diffKind - else f"{kind}" - ) - occspecsRep = ( - f"{parentOccspecs or 'ø'} => {occspecs or 'ø'}" - if diffOccspecs - else f"{occspecs}" - ) + sheetMsg = f"Check {sheetRep}" + entMsg = f"Entities: {nEnt} {noTrigMsg}" + triggerMsg = f"Triggers: {nTriggers} {ambiMsg}" - console(f"{tab} '{eid}': {nameRep}, {kindRep}, {occspecsRep}") + console(f"{sheetMsg:<25}: {entMsg:<35} {triggerMsg}") - def showDir(parentSheet, tweaks, level): - tab = " " * level + if len(msgs): + console("\n".join(msgs)) - for i in sorted(tweaks): - console(f"{tab}{i}") + data["idMap"] = { + trigger: eidkinds[0] for (trigger, eidkinds) in idMap.items() + } - data = tweaks[i] + def prepareDir(path, data): + if "sheet" in data: + prepareSheet(path, data) - thisSheet = data["sheet"] - showSheet(parentSheet, thisSheet, tab) + tweaks = data.get("tweaks", {}) - if "tweaks" in data: - showDir(thisSheet, data["tweaks"], level + 1) + for k in sorted(tweaks): + prepareDir(path + (str(k),), tweaks[k]) - mainSheet = compiled[""]["sheet"] - showSheet(mainSheet, mainSheet, "") - showDir(mainSheet, compiled["tweaks"], 0) + prepareDir((), compiled) - def showRawInfo(self, main=False): - rawInfo = self.rawInfo + def showRaw(self, main=False): + nameMap = self.nameMap + src = self.raw def showSheet(sheet, tab): - for eid in sorted(sheet): - info = sheet[eid] - name = info["name"] - kind = info["kind"] - occspecs = info["occspecs"] - occspecsRep = "|".join( - c for c in sorted(occspecs, key=lambda x: (-len(x), x)) + for eidkind, triggers in sorted(sheet.items()): + (name, sheetRela) = nameMap[eidkind] + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) ) - console(f"{tab} {eid} {kind} {name} T {occspecsRep}") + console(f"{tab} '{name}' {eidkind} : {triggerRep}") console(f"{tab} ---") def showDir(head, tweaks, level): - console("\n") - tab = " " * level console(f"{tab}{head}") - sng = tweaks.get("sng", {}) - for k in sorted(sng): - console(f"{tab}{k}.xslx") - showSheet(sng[k], tab) - rng = tweaks.get("rng", {}) for b, e in sorted(rng): - console(f"{tab}{b}-{e}.xslx") + console(f"{tab} {b}-{e}.xslx") showSheet(rng[(b, e)], tab) + sng = tweaks.get("sng", {}) + for k in sorted(sng): + console(f"{tab} {k}.xslx") + showSheet(sng[k], tab) + sdr = tweaks.get("sdr", {}) + for k in sorted(sdr): showDir(k, sdr[k], level + 1) - console("\n") - if main: - showSheet(rawInfo["main"], "") + showSheet(src["main"], "") + + showDir("", src["sdr"], 0) + + def showCombined(self, main=False): + nameMap = self.nameMap + src = self.combined + + def showSheet(sheet, tab): + for eidkind, triggers in sorted(sheet.items()): + (name, sheetRela) = nameMap[eidkind] + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) + ) + console(f"{tab} '{name}' {eidkind} : {triggerRep}") + console(f"{tab} ---") + + def showDir(head, data, level): + tab = " " * level + console(f"{tab}{head}") - showDir("", rawInfo["sdr"], 0)
    + if "sheet" in data: + if main or level > 0: + showSheet(data["sheet"], tab) + + tweaks = data.get("tweaks", {}) + + for k in sorted(tweaks): + showDir(k, tweaks[k], level + 1) + + showDir("", src, 0) + + def showCompiled(self, main=False): + nameMap = self.nameMap + src = self.compiled + + def showSheet(data, tab): + sheet = data["sheet"] + tMap = data["tMap"] + + for eidkind, triggers in sorted(sheet.items()): + triggerSources = {tMap[t] for t in triggers} + nTriggers = len(triggers) + + if not main and (nTriggers == 0 or triggerSources == {()}): + continue + + (name, sheetRela) = nameMap[eidkind] + + if nTriggers == 0: + triggerInfo = "X" + else: + sourceRep = ( + "X" + if len(triggerSources) == 0 + else list(list(triggerSources)[0]) + ) + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) + ) + triggerInfo = f"{sourceRep} => {triggerRep}" + + console(f"{tab} '{name}' {eidkind} : {triggerInfo}") + console(f"{tab} ---") + + def showDir(head, data, level): + tab = " " * level + console(f"{tab}{head}") + + if "sheet" in data: + if main or level > 0: + showSheet(data, tab) + + tweaks = data.get("tweaks", {}) + + for k in sorted(tweaks): + showDir(k, tweaks[k], level + 1) + + showDir("", src, 0) + + def showInstructions(self): + instructions = self.instructions + console("\n".join(f"{path}" for path in instructions))
    @@ -427,7 +535,7 @@

    Classes

    Expand source code -Browse git +Browse git
    class Triggers:
         def __init__(self, Ner):
    @@ -442,6 +550,13 @@ 

    Classes

    defaultValues = settings.defaultValues self.defaultKind = defaultValues.get(kindFeature, "") + self.nameMap = {} + """Will contain a mapping from entities to names. + + The entities are keyed by their (eid, kind) tuple. + The values are names plus the sheet where they are first defined. + """ + self.instructions = None """Will contain the information in a spreadsheet for marking up entities.""" @@ -450,6 +565,8 @@

    Classes

    defaultKind = self.defaultKind transform = self.transform sheetDir = self.sheetDir + nameMap = self.nameMap + spaceEscaped = self.spaceEscaped sheetPath = f"{sheetDir}/{sheetRela}.xlsx" @@ -461,8 +578,7 @@

    Classes

    sheet = {} - nameFirstRow = {} - eidFirstRow = {} + idFirstRow = {} for r, row in enumerate(ws.rows): if r in {0, 1}: @@ -470,19 +586,23 @@

    Classes

    if not any(c.value for c in row): continue - (name, kind, synonymStr) = (normalize(row[i].value or "") for i in range(3)) - synonyms = ( + (name, kind, triggerStr) = (normalize(row[i].value or "") for i in range(3)) + triggers = ( set() - if not synonymStr - else {y for x in synonymStr.split(";") if (y := normalize(x)) != ""} + if not triggerStr + else { + y + for x in triggerStr.split(";") + if (y := tnorm(x, spaceEscaped=spaceEscaped)) != "" + } ) if not name: - name = synonyms[0] if synonyms else "" + name = list(triggers)[0] if triggers else "" if name == "": if kind: console( f"{sheetRela} row {r + 1:>3}: {kind}: " - "no entity name and no synonyms" + "no entity name and no triggers" ) continue else: @@ -498,27 +618,57 @@

    Classes

    f"no kind name, supplied {defaultKind}" ) - fr = nameFirstRow.get(name, None) - nameFirstRow[name] = r + 1 + eid = toSmallId(name, transform=transform) + eidkind = (eid, kind) + firstRowEid = idFirstRow.get((eidkind), None) - if fr is not None: - console( - f"{sheetRela} row {r + 1:>3}: " - f"Name already seen in row {fr}: {name}" - ) - continue + if firstRowEid is None: + idFirstRow[eidkind] = (r, name) + sheet[eidkind] = triggers - eid = toSmallId(name, transform=transform) - fr = eidFirstRow.get(eid, None) + prev = nameMap.get(eidkind, None) + + if prev is None: + nameMap[eidkind] = (name, sheetRela) + else: + (prevName, prevSheet) = prev + + if prevName != name: + if toId(prevName) == toId(name): + severity = "minor" + error = False + else: + severity = "major" + error = True + + console( + f"{severity} name variant for {eidkind}:\n" + f" in {prevSheet:<30} : '{prevName}'\n" + f" in {sheetRela:<30} : '{name}'", + error=error, + ) + console(f" will use '{prevName}' for {eidkind}") + + else: + (firstRow, firstName) = firstRowEid + if firstName == name: + severity = "identical" + error = False + elif toId(firstName) == toId(name): + severity = "minor variant in" + error = False + else: + severity = "major variant in" + error = True - if fr is not None: console( - f"{sheetRela} row {r + 1:>3}: " - f"Eid already seen in row {fr}: {eid}" + f"{severity} name for {eidkind}:\n" + f" in {firstRow + 1:<3} : '{firstName}'\n" + f" in {r + 1:<3} : '{name}'\n", + error=error, ) - continue - - sheet[eid] = dict(name=name, kind=kind, occspecs=synonyms) + console(f" will merge triggers {triggers} with {sheet[eidkind]}") + sheet[eidkind] |= triggers return sheet @@ -569,227 +719,294 @@

    Classes

    sheetMain = self.readXls(sheetName) sheetSubdirs = self.readDir(sheetName, 1) - self.rawInfo = dict(main=sheetMain, sdr=sheetSubdirs) + self.raw = dict(main=sheetMain, sdr=sheetSubdirs) self.compile() def compile(self): spaceEscaped = self.spaceEscaped - rawInfo = self.rawInfo + raw = self.raw sheetName = self.sheetName + nameMap = self.nameMap - sheetMain = rawInfo["main"] - sheetTweaked = rawInfo["sdr"] + sheetMain = raw["main"] + sheetTweaked = raw["sdr"] - compiled = {"": dict(sheet=sheetMain)} - self.compiled = compiled - instructions = {} - self.instructions = instructions + # combine the info in ranged sheets into single number sheets - def compileDir(parentSheet, sdr, dest): - ranged = sdr.get("rng", {}) - single = sdr.get("sng", {}) - subdirs = sdr.get("sdr", {}) + combined = dict(sheet=sheetMain, tweaks={}) + self.combined = combined + + def combineDir(data, dest): + ranged = data.get("rng", {}) + single = data.get("sng", {}) + subdirs = data.get("sdr", {}) for (start, end), sheet in sorted(ranged.items()): for i in range(start, end + 1): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) - ) - parentCopy = dest["tweaks"][i]["sheet"] - - for eid, info in sheet.items(): - parentCopy[eid] = info + updateDest = dest.setdefault(i, {}).setdefault("sheet", {}) + for eidkind, triggers in sheet.items(): + updateDest[eidkind] = triggers for i, sheet in single.items(): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) - ) - parentCopy = dest["tweaks"][i]["sheet"] - - for eid, info in sheet.items(): - parentCopy[eid] = info + updateDest = dest.setdefault(i, {}).setdefault("sheet", {}) + for eidkind, triggers in sheet.items(): + updateDest[eidkind] = triggers for i, tweaks in subdirs.items(): - dest.setdefault("tweaks", {}).setdefault( - i, dict(sheet=deepcopy(parentSheet)) + updateDest = dest.setdefault(i, {}).setdefault("tweaks", {}) + combineDir(tweaks, updateDest) + + combineDir(sheetTweaked, combined["tweaks"]) + + # compile the info in tweaked sheets into complete sheets + # by applying overrides to copies of parent sheets; + # also collect additional data for the later computations: + # tMap: + # remembers for each trigger the path to the spreadsheet + # that provides the definition used in this sheet + + compiled = {} + self.compiled = compiled + + def compileSheet(path, parentData, data, dest): + parentSheet = parentData["sheet"] + sheet = data["sheet"] + newSheet = {} + dest["sheet"] = newSheet + parentTMap = parentData.get("tMap", {}) + newTMap = {} + dest["tMap"] = newTMap + + for eidkind, triggers in parentSheet.items(): + newSheet[eidkind] = triggers + + for trigger, p in parentTMap.items(): + newTMap[trigger] = p + + for eidkind, triggers in sheet.items(): + newSheet[eidkind] = triggers + + for trigger in triggers: + newTMap[trigger] = tuple(str(k) for k in path) + + def compileDir(path, parentData, data, dest): + if "sheet" in data: + compileSheet(path, parentData, data, dest) + parentData = dict(sheet=dest["sheet"], tMap=dest["tMap"]) + + tweaks = data.get("tweaks", {}) + tweakDest = dest.setdefault("tweaks", {}) + + for k in sorted(tweaks): + compileDir( + path + (k,), parentData, tweaks[k], tweakDest.setdefault(k, {}) ) - parentCopy = dest["tweaks"][i]["sheet"] - compileDir(parentCopy, tweaks, dest["tweaks"][i]) - compileDir(sheetMain, sheetTweaked, compiled) + compileDir((), combined, combined, compiled) + + # Now we have complete sheets for every context, the inheritance is resolved. + # We perform additional checks. + # We then generate instructions that will drive the search process. + # The instructions are stored in a dict, keyed by the path for which + # the instructions are valid. + + instructions = {} + self.instructions = instructions diags = set() - def prepareSheet(path, sheet): + def prepareSheet(path, info): + sheet = info["sheet"] + tMap = info["tMap"] sheetRep = sheetName if path == () else ".".join(path) - console(f"Checking {sheetRep}") - namesByOcc = collections.defaultdict(list) - qSeqs = set() - qMap = collections.defaultdict(lambda: collections.defaultdict(set)) - idMap = {} - nameMap = {} + triggerSet = set() + tPos = collections.defaultdict(lambda: collections.defaultdict(set)) + idMap = collections.defaultdict(list) - data = dict( - sheet=sheet, qSeqs=qSeqs, qMap=qMap, idMap=idMap, nameMap=nameMap - ) + data = dict(sheet=sheet, tPos=tPos, tMap=tMap) instructions[path] = data - for eid, info in sheet.items(): - name = info["name"] - kind = info["kind"] - occspecs = info["occspecs"] + for eidkind, triggers in sheet.items(): + for trigger in triggers: + triggerT = toTokens(trigger, spaceEscaped=spaceEscaped) + triggerSet.add(triggerT) + idMap[trigger].append(eidkind) + + for triggerT in triggerSet: + for i, token in enumerate(triggerT): + tPos[i][token].add(triggerT) + + nEnt = len(sheet) + nTriggers = sum(len(triggers) for triggers in sheet.values()) + noTriggers = sum(1 for triggers in sheet.values() if len(triggers) == 0) + noTrigMsg = ( + "" + if noTriggers == 0 + else f", {noTriggers} without triggers;" + ) - nameMap[(eid, kind)] = name + ambi = 0 + msgs = [] - for occspec in occspecs: - namesByOcc[occspec].append(name) - qTokens = toTokens(occspec, spaceEscaped=spaceEscaped) - qSeqs.add(qTokens) - idMap[qTokens] = (eid, kind) + for trigger, eidkinds in sorted(idMap.items()): + if len(eidkinds) == 1: + continue - for qTokens in qSeqs: - for i, qToken in enumerate(qTokens): - qMap[i][qToken].add(qTokens) + diag = (trigger, tuple(eidkinds)) - nEid = len(sheet) - nOcc = sum(len(info["occspecs"]) for info in sheet.values()) - noOccs = sum(1 for info in sheet.values() if len(info["occspecs"]) == 0) - console(f" {nEid} entities with {nOcc} occurrence specs") - console(f" {noOccs} entities do not have occurrence specifiers") + if diag not in diags: + diags.add(diag) + msgs.append(f""" trigger '{trigger}' used for:""") - nm = 0 + for eidkind in eidkinds: + msgs.append(f"\t{nameMap[eidkind][0]}") - for occSpec, names in sorted(namesByOcc.items()): - if len(names) == 1: - continue + ambi += 1 - diag = (occSpec, tuple(names)) - if diag not in diags: - diags.add(diag) - console(f""""{occSpec}" used for:""") - for name in names: - console(f"\t{name}") - nm += 1 + ambiMsg = "" if ambi == 0 else f", {ambi} ambiguous" - if nm == 0: - console(" All occurrence specifiers are unambiguous") - else: - console(f" {nm} occurrence specifiers are ambiguous") - - def prepareTweaks(path, tweaks): - for i in sorted(tweaks): - newPath = path + (str(i),) - subTweaks = tweaks[i] - prepareSheet(newPath, subTweaks["sheet"]) - - if "tweaks" in subTweaks: - prepareTweaks(newPath, subTweaks["tweaks"]) - - prepareSheet((), compiled[""]["sheet"]) - prepareTweaks((), compiled.get("tweaks", {})) - - def showInheritance(self): - compiled = self.compiled - - def showSheet(parentSheet, sheet, tab): - allKeys = set(sheet) | set(parentSheet) - - console(f"{tab} sheet with {len(allKeys)} keys") - - for eid in allKeys: - info = sheet.get(eid, {}) - parentInfo = parentSheet.get(eid, {}) - name = info.get("name", None) - parentName = parentInfo.get("name", None) - kind = info.get("kind", None) - parentKind = parentInfo.get("kind", None) - occspecs = info.get("occspecs", None) - parentOccspecs = parentInfo.get("occspecs", None) - - diffName = parentName != name - diffKind = parentKind != kind - diffOccspecs = parentOccspecs != occspecs - - if diffName or diffKind or diffOccspecs: - nameRep = ( - f"{parentName or 'ø'} => {name or 'ø'}" - if diffName - else f"{name}" - ) - kindRep = ( - f"{parentKind or 'ø'} => {kind or 'ø'}" - if diffKind - else f"{kind}" - ) - occspecsRep = ( - f"{parentOccspecs or 'ø'} => {occspecs or 'ø'}" - if diffOccspecs - else f"{occspecs}" - ) + sheetMsg = f"Check {sheetRep}" + entMsg = f"Entities: {nEnt} {noTrigMsg}" + triggerMsg = f"Triggers: {nTriggers} {ambiMsg}" - console(f"{tab} '{eid}': {nameRep}, {kindRep}, {occspecsRep}") + console(f"{sheetMsg:<25}: {entMsg:<35} {triggerMsg}") - def showDir(parentSheet, tweaks, level): - tab = " " * level + if len(msgs): + console("\n".join(msgs)) - for i in sorted(tweaks): - console(f"{tab}{i}") + data["idMap"] = { + trigger: eidkinds[0] for (trigger, eidkinds) in idMap.items() + } - data = tweaks[i] + def prepareDir(path, data): + if "sheet" in data: + prepareSheet(path, data) - thisSheet = data["sheet"] - showSheet(parentSheet, thisSheet, tab) + tweaks = data.get("tweaks", {}) - if "tweaks" in data: - showDir(thisSheet, data["tweaks"], level + 1) + for k in sorted(tweaks): + prepareDir(path + (str(k),), tweaks[k]) - mainSheet = compiled[""]["sheet"] - showSheet(mainSheet, mainSheet, "") - showDir(mainSheet, compiled["tweaks"], 0) + prepareDir((), compiled) - def showRawInfo(self, main=False): - rawInfo = self.rawInfo + def showRaw(self, main=False): + nameMap = self.nameMap + src = self.raw def showSheet(sheet, tab): - for eid in sorted(sheet): - info = sheet[eid] - name = info["name"] - kind = info["kind"] - occspecs = info["occspecs"] - occspecsRep = "|".join( - c for c in sorted(occspecs, key=lambda x: (-len(x), x)) + for eidkind, triggers in sorted(sheet.items()): + (name, sheetRela) = nameMap[eidkind] + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) ) - console(f"{tab} {eid} {kind} {name} T {occspecsRep}") + console(f"{tab} '{name}' {eidkind} : {triggerRep}") console(f"{tab} ---") def showDir(head, tweaks, level): - console("\n") - tab = " " * level console(f"{tab}{head}") - sng = tweaks.get("sng", {}) - for k in sorted(sng): - console(f"{tab}{k}.xslx") - showSheet(sng[k], tab) - rng = tweaks.get("rng", {}) for b, e in sorted(rng): - console(f"{tab}{b}-{e}.xslx") + console(f"{tab} {b}-{e}.xslx") showSheet(rng[(b, e)], tab) + sng = tweaks.get("sng", {}) + for k in sorted(sng): + console(f"{tab} {k}.xslx") + showSheet(sng[k], tab) + sdr = tweaks.get("sdr", {}) + for k in sorted(sdr): showDir(k, sdr[k], level + 1) - console("\n") - if main: - showSheet(rawInfo["main"], "") + showSheet(src["main"], "") - showDir("", rawInfo["sdr"], 0)
    + showDir("", src["sdr"], 0) + + def showCombined(self, main=False): + nameMap = self.nameMap + src = self.combined + + def showSheet(sheet, tab): + for eidkind, triggers in sorted(sheet.items()): + (name, sheetRela) = nameMap[eidkind] + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) + ) + console(f"{tab} '{name}' {eidkind} : {triggerRep}") + console(f"{tab} ---") + + def showDir(head, data, level): + tab = " " * level + console(f"{tab}{head}") + + if "sheet" in data: + if main or level > 0: + showSheet(data["sheet"], tab) + + tweaks = data.get("tweaks", {}) + + for k in sorted(tweaks): + showDir(k, tweaks[k], level + 1) + + showDir("", src, 0) + + def showCompiled(self, main=False): + nameMap = self.nameMap + src = self.compiled + + def showSheet(data, tab): + sheet = data["sheet"] + tMap = data["tMap"] + + for eidkind, triggers in sorted(sheet.items()): + triggerSources = {tMap[t] for t in triggers} + nTriggers = len(triggers) + + if not main and (nTriggers == 0 or triggerSources == {()}): + continue + + (name, sheetRela) = nameMap[eidkind] + + if nTriggers == 0: + triggerInfo = "X" + else: + sourceRep = ( + "X" + if len(triggerSources) == 0 + else list(list(triggerSources)[0]) + ) + triggerRep = "|".join( + t for t in sorted(triggers, key=lambda x: (-len(x), x)) + ) + triggerInfo = f"{sourceRep} => {triggerRep}" + + console(f"{tab} '{name}' {eidkind} : {triggerInfo}") + console(f"{tab} ---") + + def showDir(head, data, level): + tab = " " * level + console(f"{tab}{head}") + + if "sheet" in data: + if main or level > 0: + showSheet(data, tab) + + tweaks = data.get("tweaks", {}) + + for k in sorted(tweaks): + showDir(k, tweaks[k], level + 1) + + showDir("", src, 0) + + def showInstructions(self): + instructions = self.instructions + console("\n".join(f"{path}" for path in instructions))

    Instance variables

    @@ -797,6 +1014,12 @@

    Instance variables

    Will contain the information in a spreadsheet for marking up entities.

    +
    var nameMap
    +
    +

    Will contain a mapping from entities to names.

    +

    The entities are keyed by their (eid, kind) tuple. +The values are names plus the sheet where they are first defined.

    +

    Methods

    @@ -808,125 +1031,176 @@

    Methods

    Expand source code -Browse git +Browse git
    def compile(self):
         spaceEscaped = self.spaceEscaped
    -    rawInfo = self.rawInfo
    +    raw = self.raw
         sheetName = self.sheetName
    +    nameMap = self.nameMap
     
    -    sheetMain = rawInfo["main"]
    -    sheetTweaked = rawInfo["sdr"]
    +    sheetMain = raw["main"]
    +    sheetTweaked = raw["sdr"]
     
    -    compiled = {"": dict(sheet=sheetMain)}
    -    self.compiled = compiled
    -    instructions = {}
    -    self.instructions = instructions
    +    # combine the info in ranged sheets into single number sheets
     
    -    def compileDir(parentSheet, sdr, dest):
    -        ranged = sdr.get("rng", {})
    -        single = sdr.get("sng", {})
    -        subdirs = sdr.get("sdr", {})
    +    combined = dict(sheet=sheetMain, tweaks={})
    +    self.combined = combined
    +
    +    def combineDir(data, dest):
    +        ranged = data.get("rng", {})
    +        single = data.get("sng", {})
    +        subdirs = data.get("sdr", {})
     
             for (start, end), sheet in sorted(ranged.items()):
                 for i in range(start, end + 1):
    -                dest.setdefault("tweaks", {}).setdefault(
    -                    i, dict(sheet=deepcopy(parentSheet))
    -                )
    -                parentCopy = dest["tweaks"][i]["sheet"]
    -
    -                for eid, info in sheet.items():
    -                    parentCopy[eid] = info
    +                updateDest = dest.setdefault(i, {}).setdefault("sheet", {})
    +                for eidkind, triggers in sheet.items():
    +                    updateDest[eidkind] = triggers
     
             for i, sheet in single.items():
    -            dest.setdefault("tweaks", {}).setdefault(
    -                i, dict(sheet=deepcopy(parentSheet))
    -            )
    -            parentCopy = dest["tweaks"][i]["sheet"]
    -
    -            for eid, info in sheet.items():
    -                parentCopy[eid] = info
    +            updateDest = dest.setdefault(i, {}).setdefault("sheet", {})
    +            for eidkind, triggers in sheet.items():
    +                updateDest[eidkind] = triggers
     
             for i, tweaks in subdirs.items():
    -            dest.setdefault("tweaks", {}).setdefault(
    -                i, dict(sheet=deepcopy(parentSheet))
    +            updateDest = dest.setdefault(i, {}).setdefault("tweaks", {})
    +            combineDir(tweaks, updateDest)
    +
    +    combineDir(sheetTweaked, combined["tweaks"])
    +
    +    # compile the info in tweaked sheets into complete sheets
    +    # by applying overrides to copies of parent sheets;
    +    # also collect additional data for the later computations:
    +    # tMap:
    +    #   remembers for each trigger the path to the spreadsheet
    +    #   that provides the definition used in this sheet
    +
    +    compiled = {}
    +    self.compiled = compiled
    +
    +    def compileSheet(path, parentData, data, dest):
    +        parentSheet = parentData["sheet"]
    +        sheet = data["sheet"]
    +        newSheet = {}
    +        dest["sheet"] = newSheet
    +        parentTMap = parentData.get("tMap", {})
    +        newTMap = {}
    +        dest["tMap"] = newTMap
    +
    +        for eidkind, triggers in parentSheet.items():
    +            newSheet[eidkind] = triggers
    +
    +        for trigger, p in parentTMap.items():
    +            newTMap[trigger] = p
    +
    +        for eidkind, triggers in sheet.items():
    +            newSheet[eidkind] = triggers
    +
    +            for trigger in triggers:
    +                newTMap[trigger] = tuple(str(k) for k in path)
    +
    +    def compileDir(path, parentData, data, dest):
    +        if "sheet" in data:
    +            compileSheet(path, parentData, data, dest)
    +            parentData = dict(sheet=dest["sheet"], tMap=dest["tMap"])
    +
    +        tweaks = data.get("tweaks", {})
    +        tweakDest = dest.setdefault("tweaks", {})
    +
    +        for k in sorted(tweaks):
    +            compileDir(
    +                path + (k,), parentData, tweaks[k], tweakDest.setdefault(k, {})
                 )
    -            parentCopy = dest["tweaks"][i]["sheet"]
    -            compileDir(parentCopy, tweaks, dest["tweaks"][i])
     
    -    compileDir(sheetMain, sheetTweaked, compiled)
    +    compileDir((), combined, combined, compiled)
    +
    +    # Now we have complete sheets for every context, the inheritance is resolved.
    +    # We perform additional checks.
    +    # We then generate instructions that will drive the search process.
    +    # The instructions are stored in a dict, keyed by the path for which
    +    # the instructions are valid.
    +
    +    instructions = {}
    +    self.instructions = instructions
     
         diags = set()
     
    -    def prepareSheet(path, sheet):
    +    def prepareSheet(path, info):
    +        sheet = info["sheet"]
    +        tMap = info["tMap"]
             sheetRep = sheetName if path == () else ".".join(path)
    -        console(f"Checking {sheetRep}")
     
    -        namesByOcc = collections.defaultdict(list)
    -        qSeqs = set()
    -        qMap = collections.defaultdict(lambda: collections.defaultdict(set))
    -        idMap = {}
    -        nameMap = {}
    +        triggerSet = set()
    +        tPos = collections.defaultdict(lambda: collections.defaultdict(set))
    +        idMap = collections.defaultdict(list)
     
    -        data = dict(
    -            sheet=sheet, qSeqs=qSeqs, qMap=qMap, idMap=idMap, nameMap=nameMap
    -        )
    +        data = dict(sheet=sheet, tPos=tPos, tMap=tMap)
     
             instructions[path] = data
     
    -        for eid, info in sheet.items():
    -            name = info["name"]
    -            kind = info["kind"]
    -            occspecs = info["occspecs"]
    +        for eidkind, triggers in sheet.items():
    +            for trigger in triggers:
    +                triggerT = toTokens(trigger, spaceEscaped=spaceEscaped)
    +                triggerSet.add(triggerT)
    +                idMap[trigger].append(eidkind)
    +
    +        for triggerT in triggerSet:
    +            for i, token in enumerate(triggerT):
    +                tPos[i][token].add(triggerT)
    +
    +        nEnt = len(sheet)
    +        nTriggers = sum(len(triggers) for triggers in sheet.values())
    +        noTriggers = sum(1 for triggers in sheet.values() if len(triggers) == 0)
    +        noTrigMsg = (
    +            ""
    +            if noTriggers == 0
    +            else f", {noTriggers} without triggers;"
    +        )
    +
    +        ambi = 0
    +        msgs = []
    +
    +        for trigger, eidkinds in sorted(idMap.items()):
    +            if len(eidkinds) == 1:
    +                continue
     
    -            nameMap[(eid, kind)] = name
    +            diag = (trigger, tuple(eidkinds))
     
    -            for occspec in occspecs:
    -                namesByOcc[occspec].append(name)
    -                qTokens = toTokens(occspec, spaceEscaped=spaceEscaped)
    -                qSeqs.add(qTokens)
    -                idMap[qTokens] = (eid, kind)
    +            if diag not in diags:
    +                diags.add(diag)
    +                msgs.append(f"""  trigger '{trigger}' used for:""")
     
    -        for qTokens in qSeqs:
    -            for i, qToken in enumerate(qTokens):
    -                qMap[i][qToken].add(qTokens)
    +                for eidkind in eidkinds:
    +                    msgs.append(f"\t{nameMap[eidkind][0]}")
     
    -        nEid = len(sheet)
    -        nOcc = sum(len(info["occspecs"]) for info in sheet.values())
    -        noOccs = sum(1 for info in sheet.values() if len(info["occspecs"]) == 0)
    -        console(f"  {nEid} entities with {nOcc} occurrence specs")
    -        console(f"  {noOccs} entities do not have occurrence specifiers")
    +            ambi += 1
     
    -        nm = 0
    +        ambiMsg = "" if ambi == 0 else f", {ambi} ambiguous"
     
    -        for occSpec, names in sorted(namesByOcc.items()):
    -            if len(names) == 1:
    -                continue
    +        sheetMsg = f"Check {sheetRep}"
    +        entMsg = f"Entities: {nEnt} {noTrigMsg}"
    +        triggerMsg = f"Triggers: {nTriggers} {ambiMsg}"
     
    -            diag = (occSpec, tuple(names))
    -            if diag not in diags:
    -                diags.add(diag)
    -                console(f""""{occSpec}" used for:""")
    -                for name in names:
    -                    console(f"\t{name}")
    -            nm += 1
    +        console(f"{sheetMsg:<25}: {entMsg:<35} {triggerMsg}")
     
    -        if nm == 0:
    -            console("  All occurrence specifiers are unambiguous")
    -        else:
    -            console(f"  {nm} occurrence specifiers are ambiguous")
    +        if len(msgs):
    +            console("\n".join(msgs))
    +
    +        data["idMap"] = {
    +            trigger: eidkinds[0] for (trigger, eidkinds) in idMap.items()
    +        }
     
    -    def prepareTweaks(path, tweaks):
    -        for i in sorted(tweaks):
    -            newPath = path + (str(i),)
    -            subTweaks = tweaks[i]
    -            prepareSheet(newPath, subTweaks["sheet"])
    +    def prepareDir(path, data):
    +        if "sheet" in data:
    +            prepareSheet(path, data)
     
    -            if "tweaks" in subTweaks:
    -                prepareTweaks(newPath, subTweaks["tweaks"])
    +        tweaks = data.get("tweaks", {})
     
    -    prepareSheet((), compiled[""]["sheet"])
    -    prepareTweaks((), compiled.get("tweaks", {}))
    + for k in sorted(tweaks): + prepareDir(path + (str(k),), tweaks[k]) + + prepareDir((), compiled)
    @@ -937,7 +1211,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def read(self, sheetName):
         self.sheetName = sheetName
    @@ -945,7 +1219,7 @@ 

    Methods

    sheetMain = self.readXls(sheetName) sheetSubdirs = self.readDir(sheetName, 1) - self.rawInfo = dict(main=sheetMain, sdr=sheetSubdirs) + self.raw = dict(main=sheetMain, sdr=sheetSubdirs) self.compile()
    @@ -957,7 +1231,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def readDir(self, sheetRela, level):
         sheetDir = self.sheetDir
    @@ -1009,13 +1283,15 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def readXls(self, sheetRela):
         loadXls = self.loadXls
         defaultKind = self.defaultKind
         transform = self.transform
         sheetDir = self.sheetDir
    +    nameMap = self.nameMap
    +    spaceEscaped = self.spaceEscaped
     
         sheetPath = f"{sheetDir}/{sheetRela}.xlsx"
     
    @@ -1027,8 +1303,7 @@ 

    Methods

    sheet = {} - nameFirstRow = {} - eidFirstRow = {} + idFirstRow = {} for r, row in enumerate(ws.rows): if r in {0, 1}: @@ -1036,19 +1311,23 @@

    Methods

    if not any(c.value for c in row): continue - (name, kind, synonymStr) = (normalize(row[i].value or "") for i in range(3)) - synonyms = ( + (name, kind, triggerStr) = (normalize(row[i].value or "") for i in range(3)) + triggers = ( set() - if not synonymStr - else {y for x in synonymStr.split(";") if (y := normalize(x)) != ""} + if not triggerStr + else { + y + for x in triggerStr.split(";") + if (y := tnorm(x, spaceEscaped=spaceEscaped)) != "" + } ) if not name: - name = synonyms[0] if synonyms else "" + name = list(triggers)[0] if triggers else "" if name == "": if kind: console( f"{sheetRela} row {r + 1:>3}: {kind}: " - "no entity name and no synonyms" + "no entity name and no triggers" ) continue else: @@ -1064,152 +1343,220 @@

    Methods

    f"no kind name, supplied {defaultKind}" ) - fr = nameFirstRow.get(name, None) - nameFirstRow[name] = r + 1 + eid = toSmallId(name, transform=transform) + eidkind = (eid, kind) + firstRowEid = idFirstRow.get((eidkind), None) + + if firstRowEid is None: + idFirstRow[eidkind] = (r, name) + sheet[eidkind] = triggers + + prev = nameMap.get(eidkind, None) + + if prev is None: + nameMap[eidkind] = (name, sheetRela) + else: + (prevName, prevSheet) = prev + + if prevName != name: + if toId(prevName) == toId(name): + severity = "minor" + error = False + else: + severity = "major" + error = True + + console( + f"{severity} name variant for {eidkind}:\n" + f" in {prevSheet:<30} : '{prevName}'\n" + f" in {sheetRela:<30} : '{name}'", + error=error, + ) + console(f" will use '{prevName}' for {eidkind}") + + else: + (firstRow, firstName) = firstRowEid + if firstName == name: + severity = "identical" + error = False + elif toId(firstName) == toId(name): + severity = "minor variant in" + error = False + else: + severity = "major variant in" + error = True - if fr is not None: console( - f"{sheetRela} row {r + 1:>3}: " - f"Name already seen in row {fr}: {name}" + f"{severity} name for {eidkind}:\n" + f" in {firstRow + 1:<3} : '{firstName}'\n" + f" in {r + 1:<3} : '{name}'\n", + error=error, ) - continue + console(f" will merge triggers {triggers} with {sheet[eidkind]}") + sheet[eidkind] |= triggers - eid = toSmallId(name, transform=transform) - fr = eidFirstRow.get(eid, None) + return sheet
    +
    + +
    +def showCombined(self, main=False) +
    +
    +
    +
    + +Expand source code +Browse git + +
    def showCombined(self, main=False):
    +    nameMap = self.nameMap
    +    src = self.combined
     
    -        if fr is not None:
    -            console(
    -                f"{sheetRela} row {r + 1:>3}: "
    -                f"Eid already seen in row {fr}: {eid}"
    +    def showSheet(sheet, tab):
    +        for eidkind, triggers in sorted(sheet.items()):
    +            (name, sheetRela) = nameMap[eidkind]
    +            triggerRep = "|".join(
    +                t for t in sorted(triggers, key=lambda x: (-len(x), x))
                 )
    -            continue
    +            console(f"{tab}  '{name}' {eidkind} : {triggerRep}")
    +        console(f"{tab}  ---")
     
    -        sheet[eid] = dict(name=name, kind=kind, occspecs=synonyms)
    +    def showDir(head, data, level):
    +        tab = "  " * level
    +        console(f"{tab}{head}")
     
    -    return sheet
    + if "sheet" in data: + if main or level > 0: + showSheet(data["sheet"], tab) + + tweaks = data.get("tweaks", {}) + + for k in sorted(tweaks): + showDir(k, tweaks[k], level + 1) + + showDir("", src, 0)
    -
    -def showInheritance(self) +
    +def showCompiled(self, main=False)
    Expand source code -Browse git +Browse git -
    def showInheritance(self):
    -    compiled = self.compiled
    -
    -    def showSheet(parentSheet, sheet, tab):
    -        allKeys = set(sheet) | set(parentSheet)
    -
    -        console(f"{tab}  sheet with {len(allKeys)} keys")
    -
    -        for eid in allKeys:
    -            info = sheet.get(eid, {})
    -            parentInfo = parentSheet.get(eid, {})
    -            name = info.get("name", None)
    -            parentName = parentInfo.get("name", None)
    -            kind = info.get("kind", None)
    -            parentKind = parentInfo.get("kind", None)
    -            occspecs = info.get("occspecs", None)
    -            parentOccspecs = parentInfo.get("occspecs", None)
    -
    -            diffName = parentName != name
    -            diffKind = parentKind != kind
    -            diffOccspecs = parentOccspecs != occspecs
    -
    -            if diffName or diffKind or diffOccspecs:
    -                nameRep = (
    -                    f"{parentName or 'ø'} => {name or 'ø'}"
    -                    if diffName
    -                    else f"{name}"
    -                )
    -                kindRep = (
    -                    f"{parentKind or 'ø'} => {kind or 'ø'}"
    -                    if diffKind
    -                    else f"{kind}"
    +
    def showCompiled(self, main=False):
    +    nameMap = self.nameMap
    +    src = self.compiled
    +
    +    def showSheet(data, tab):
    +        sheet = data["sheet"]
    +        tMap = data["tMap"]
    +
    +        for eidkind, triggers in sorted(sheet.items()):
    +            triggerSources = {tMap[t] for t in triggers}
    +            nTriggers = len(triggers)
    +
    +            if not main and (nTriggers == 0 or triggerSources == {()}):
    +                continue
    +
    +            (name, sheetRela) = nameMap[eidkind]
    +
    +            if nTriggers == 0:
    +                triggerInfo = "X"
    +            else:
    +                sourceRep = (
    +                    "X"
    +                    if len(triggerSources) == 0
    +                    else list(list(triggerSources)[0])
                     )
    -                occspecsRep = (
    -                    f"{parentOccspecs or 'ø'} => {occspecs or 'ø'}"
    -                    if diffOccspecs
    -                    else f"{occspecs}"
    +                triggerRep = "|".join(
    +                    t for t in sorted(triggers, key=lambda x: (-len(x), x))
                     )
    +                triggerInfo = f"{sourceRep} => {triggerRep}"
     
    -                console(f"{tab}  '{eid}': {nameRep}, {kindRep}, {occspecsRep}")
    +            console(f"{tab}  '{name}' {eidkind} : {triggerInfo}")
    +        console(f"{tab}  ---")
     
    -    def showDir(parentSheet, tweaks, level):
    +    def showDir(head, data, level):
             tab = "  " * level
    +        console(f"{tab}{head}")
     
    -        for i in sorted(tweaks):
    -            console(f"{tab}{i}")
    -
    -            data = tweaks[i]
    +        if "sheet" in data:
    +            if main or level > 0:
    +                showSheet(data, tab)
     
    -            thisSheet = data["sheet"]
    -            showSheet(parentSheet, thisSheet, tab)
    +        tweaks = data.get("tweaks", {})
     
    -            if "tweaks" in data:
    -                showDir(thisSheet, data["tweaks"], level + 1)
    +        for k in sorted(tweaks):
    +            showDir(k, tweaks[k], level + 1)
     
    -    mainSheet = compiled[""]["sheet"]
    -    showSheet(mainSheet, mainSheet, "")
    -    showDir(mainSheet, compiled["tweaks"], 0)
    + showDir("", src, 0)
    +
    +
    +
    +def showInstructions(self) +
    +
    +
    +
    + +Expand source code +Browse git + +
    def showInstructions(self):
    +    instructions = self.instructions
    +    console("\n".join(f"{path}" for path in instructions))
    -
    -def showRawInfo(self, main=False) +
    +def showRaw(self, main=False)
    Expand source code -Browse git +Browse git -
    def showRawInfo(self, main=False):
    -    rawInfo = self.rawInfo
    +
    def showRaw(self, main=False):
    +    nameMap = self.nameMap
    +    src = self.raw
     
         def showSheet(sheet, tab):
    -        for eid in sorted(sheet):
    -            info = sheet[eid]
    -            name = info["name"]
    -            kind = info["kind"]
    -            occspecs = info["occspecs"]
    -            occspecsRep = "|".join(
    -                c for c in sorted(occspecs, key=lambda x: (-len(x), x))
    +        for eidkind, triggers in sorted(sheet.items()):
    +            (name, sheetRela) = nameMap[eidkind]
    +            triggerRep = "|".join(
    +                t for t in sorted(triggers, key=lambda x: (-len(x), x))
                 )
    -            console(f"{tab}  {eid} {kind} {name} T {occspecsRep}")
    +            console(f"{tab}  '{name}' {eidkind} : {triggerRep}")
             console(f"{tab}  ---")
     
         def showDir(head, tweaks, level):
    -        console("\n")
    -
             tab = "  " * level
             console(f"{tab}{head}")
     
    -        sng = tweaks.get("sng", {})
    -        for k in sorted(sng):
    -            console(f"{tab}{k}.xslx")
    -            showSheet(sng[k], tab)
    -
             rng = tweaks.get("rng", {})
             for b, e in sorted(rng):
    -            console(f"{tab}{b}-{e}.xslx")
    +            console(f"{tab}  {b}-{e}.xslx")
                 showSheet(rng[(b, e)], tab)
     
    +        sng = tweaks.get("sng", {})
    +        for k in sorted(sng):
    +            console(f"{tab}  {k}.xslx")
    +            showSheet(sng[k], tab)
    +
             sdr = tweaks.get("sdr", {})
    +
             for k in sorted(sdr):
                 showDir(k, sdr[k], level + 1)
     
    -        console("\n")
    -
         if main:
    -        showSheet(rawInfo["main"], "")
    +        showSheet(src["main"], "")
     
    -    showDir("", rawInfo["sdr"], 0)
    + showDir("", src["sdr"], 0)
    @@ -1286,11 +1633,14 @@

  • compile
  • instructions
  • +
  • nameMap
  • read
  • readDir
  • readXls
  • -
  • showInheritance
  • -
  • showRawInfo
  • +
  • showCombined
  • +
  • showCompiled
  • +
  • showInstructions
  • +
  • showRaw
  • diff --git a/tf/browser/ner/web.html b/tf/browser/ner/web.html index ba37f092c..5fe2892a8 100644 --- a/tf/browser/ner/web.html +++ b/tf/browser/ner/web.html @@ -34,7 +34,7 @@

    Module tf.browser.ner.web

    Expand source code -Browse git +Browse git
    """Flask sub web app in the TF browser.
     
    @@ -169,7 +169,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def factory(web):
         """A sub web app, to be inserted into the TF browser web app.
    diff --git a/tf/browser/serve.html b/tf/browser/serve.html
    index 2e6227124..a5b1682ca 100644
    --- a/tf/browser/serve.html
    +++ b/tf/browser/serve.html
    @@ -37,7 +37,7 @@ 

    Dress TF nodes up for serving
    Expand source code -Browse git +Browse git
    """
     # Dress TF nodes up for serving on the web
    @@ -531,7 +531,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def serveAll(web, anything):
         aContext = web.context
    @@ -662,7 +662,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def serveDownload(web, jobOnly):
         aContext = web.context
    @@ -761,7 +761,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def serveExport(web):
         aContext = web.context
    @@ -835,7 +835,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def servePassage(web, getx=None):
         kernelApi = web.kernelApi
    @@ -885,7 +885,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def serveQuery(web, getx=None, asDict=False):
         kernelApi = web.kernelApi
    @@ -978,7 +978,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def serveTable(web, kind, getx=None, asDict=False):
         kernelApi = web.kernelApi
    diff --git a/tf/browser/servelib.html b/tf/browser/servelib.html
    index f4ba15d25..8d091f293 100644
    --- a/tf/browser/servelib.html
    +++ b/tf/browser/servelib.html
    @@ -39,7 +39,7 @@ 

    About

    Expand source code -Browse git +Browse git
    """
     # Common Server Related Functions
    @@ -320,7 +320,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def batchAround(nResults, position, batch):
         halfBatch = int((batch + 1) / 2)
    @@ -342,7 +342,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getAbout(colophon, header, provenance, form):
         return f"""
    @@ -396,7 +396,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getFormData(interfaceDefaults):
         """Get form data.
    @@ -557,7 +557,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getInt(x, default=1):
         if len(x) > 15:
    @@ -575,7 +575,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def zipTables(csvs, tupleResultsX, queryResultsX, about, form):
         appName = form["appName"]
    diff --git a/tf/browser/start.html b/tf/browser/start.html
    index 9e7a9c247..d34e2d070 100644
    --- a/tf/browser/start.html
    +++ b/tf/browser/start.html
    @@ -89,7 +89,7 @@ 

    Implementation notes

    Expand source code -Browse git +Browse git
    """
     # Start the TF browser
    @@ -368,7 +368,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def bMsg(url):
         return f"\n\tOpen a webbrowser and navigate to url {url}\n"
    @@ -382,7 +382,7 @@

    Functions

    Expand source code -Browse git +Browse git
    def main(cargs=sys.argv[1:]):
         console(BANNER)
    @@ -441,7 +441,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def startBrowser(url, forceChrome, debug):
         opened = False
    diff --git a/tf/browser/web.html b/tf/browser/web.html
    index bbfdc6898..639ba40a9 100644
    --- a/tf/browser/web.html
    +++ b/tf/browser/web.html
    @@ -114,7 +114,7 @@ 

    JavaScript

    Expand source code -Browse git +Browse git
    """
     # Web interface
    @@ -407,7 +407,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def factory(web):
         app = Flask(__name__)
    @@ -495,7 +495,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def runWeb(webapp, debug, portWeb):
         run_simple(
    @@ -519,7 +519,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def setup(debug, *args):
         appSpecs = argApp(args, False)
    @@ -595,7 +595,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Web:
         def __init__(self, kernelApi):
    @@ -619,7 +619,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def console(self, msg):
         if self.debug:
    diff --git a/tf/browser/wrap.html b/tf/browser/wrap.html
    index e49b1fd03..5ccb8f978 100644
    --- a/tf/browser/wrap.html
    +++ b/tf/browser/wrap.html
    @@ -33,7 +33,7 @@ 

    Wrap material into HTML

    Expand source code -Browse git +Browse git
    """
     # Wrap material into HTML
    @@ -592,7 +592,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def pageLinks(nResults, position, spread=10):
         """Provide navigation links for results sets, big or small.
    @@ -675,7 +675,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def passageLinks(passages, sec0Type, sec0, sec1, tillLevel):
         """Provide navigation links for passages,
    @@ -728,7 +728,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def wrapColorMap(form):
         """Wraps the color map for query result highlighting into HTML.
    @@ -813,7 +813,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def wrapEColorMap(form):
         """Wraps the edge color map for edge highlighting into HTML.
    @@ -922,7 +922,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def wrapOptions(context, form):
         """Wraps the boolean options, including the app-specific ones, into HTML."""
    @@ -962,7 +962,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def wrapProvenance(form, provenance, setNames):
         utc_offset_sec = time.altzone if time.localtime().tm_isdst else time.timezone
    @@ -1138,7 +1138,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def wrapSelect(option, allowedValues, value, group, item, multiple):
         """Provides a buttoned chooser for the node types.
    diff --git a/tf/capable.html b/tf/capable.html
    index 2ee821716..e541fe1a0 100644
    --- a/tf/capable.html
    +++ b/tf/capable.html
    @@ -86,7 +86,7 @@ 

    Optional dependencies

    Expand source code -Browse git +Browse git
    """Dependency management.
     
    @@ -500,7 +500,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Capable:
         """Import modules for back-end communication if possible.
    @@ -615,7 +615,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def can(self, extra):
         if extra in {"github", "gitlab"}:
    @@ -646,7 +646,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def load(self, module):
         modules = self.modules
    @@ -671,7 +671,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def loadFrom(self, module, *members):
         loaded = self.load(module)
    @@ -692,7 +692,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def tryImport(self, *extras):
         backendProviders = self.backendProviders
    @@ -771,7 +771,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class CheckImport:
         def __init__(self, *modules, optional=False):
    @@ -969,7 +969,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def importGet(self):
         """Delivers the imported modules.
    @@ -1008,7 +1008,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def importOK(self, hint=False):
         """Reports the result of the import attempts.
    diff --git a/tf/cheatsheet.html b/tf/cheatsheet.html
    index 0685ccf6d..d989d482e 100644
    --- a/tf/cheatsheet.html
    +++ b/tf/cheatsheet.html
    @@ -1661,7 +1661,7 @@ 

    Command-line tools

    Expand source code -Browse git +Browse git
    """
     .. include:: docs/main/cheatsheet.md
    diff --git a/tf/clean.html b/tf/clean.html
    index c873bc300..b7bea8190 100644
    --- a/tf/clean.html
    +++ b/tf/clean.html
    @@ -40,7 +40,7 @@ 

    Clean

    Expand source code -Browse git +Browse git
    """
     # Clean
    @@ -207,7 +207,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def clean(tfd=True, backend=None, dry=True, specific=None, current=False):
         """Clean up older compressed `.tfx` files.
    @@ -293,7 +293,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def err(msg):
         """Write to standard error output immediately."""
    @@ -309,7 +309,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def out(msg):
         """Write to standard normal output immediately."""
    diff --git a/tf/client/index.html b/tf/client/index.html
    index 10d956a0a..0891d3f93 100644
    --- a/tf/client/index.html
    +++ b/tf/client/index.html
    @@ -57,7 +57,7 @@ 

    Acknowledgments

    Expand source code -Browse git +Browse git
    """
     # Layered Search
    diff --git a/tf/client/make/build.html b/tf/client/make/build.html
    index 52be73291..9b59a2609 100644
    --- a/tf/client/make/build.html
    +++ b/tf/client/make/build.html
    @@ -81,7 +81,7 @@ 

    Commands

    Expand source code -Browse git +Browse git
    """
     # Usage
    @@ -1497,7 +1497,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def console(*args, error=False):
         device = sys.stderr if error else sys.stdout
    @@ -1513,7 +1513,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def invertMap(legend):
         return (
    @@ -1533,7 +1533,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         Args = readArgsLegacy()
    @@ -1594,7 +1594,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def makeSearchClients(dataset, folder, appFolder, backend=None, dataDir=None):
         DEBUG_STATE = "off"
    @@ -1640,7 +1640,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def readArgsLegacy():
         class Args:
    @@ -1753,7 +1753,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Make:
         def __init__(
    @@ -2862,7 +2862,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def adjustDebug(self):
         C = self.C
    @@ -2894,7 +2894,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def adjustVersion(self):
         C = self.C
    @@ -2917,7 +2917,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def compress(self, data):
         sets = {}
    @@ -2944,7 +2944,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def config(self):
         C = self.C
    @@ -3220,7 +3220,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def doCommand(self, command):
         if command == "serve":
    @@ -3257,7 +3257,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def dumpConfig(self):
         C = self.C
    @@ -3283,7 +3283,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def dumpCorpus(self):
         C = self.C
    @@ -3412,7 +3412,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def getAllClients(self):
         C = self.C
    @@ -3437,7 +3437,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def getDebugs(self):
         C = self.C
    @@ -3470,7 +3470,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def importMake(self, c=None):
         client = self.client
    @@ -3510,7 +3510,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def incVersion(self):
         C = self.C
    @@ -3530,7 +3530,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def loadTf(self):
         C = self.C
    @@ -3552,7 +3552,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def make(self):
         self.makeConfig()
    @@ -3586,7 +3586,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeClient(self):
         """
    @@ -3670,7 +3670,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeClientSettings(self):
         C = self.C
    @@ -3814,7 +3814,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeCombined(self):
         C = self.C
    @@ -3884,7 +3884,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeConfig(self):
         if not getattr(self, "A", None):
    @@ -3902,7 +3902,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeCorpus(self):
         if not getattr(self, "A", None):
    @@ -3929,7 +3929,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeHtml(self):
         C = self.C
    @@ -4010,7 +4010,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeLinks(self):
         C = self.C
    @@ -4041,7 +4041,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def publish(self, allClients=True):
         C = self.C
    @@ -4074,7 +4074,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def replaceDebug(self, mask, value):
         def subVersion(match):
    @@ -4091,7 +4091,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def serve(self):
         dataset = self.dataset
    @@ -4134,7 +4134,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def ship(self, publish=True):
         self.adjustVersion()
    @@ -4155,7 +4155,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def showDebug(self):
         debugInfo = self.getDebugs()
    @@ -4175,7 +4175,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def showVersion(self):
         C = self.C
    @@ -4192,7 +4192,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def zipApp(self):
         C = self.C
    diff --git a/tf/client/make/gh.html b/tf/client/make/gh.html
    index 1b698cf45..18768b884 100644
    --- a/tf/client/make/gh.html
    +++ b/tf/client/make/gh.html
    @@ -31,7 +31,7 @@ 

    Module tf.client.make.gh

    Expand source code -Browse git +Browse git
    import sys
     import os
    @@ -210,7 +210,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def console(*args):
         sys.stdout.write(" ".join(args) + "\n")
    @@ -225,7 +225,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def deploy(org, repo):
         (result, error) = _ghp_import()
    diff --git a/tf/client/make/help.html b/tf/client/make/help.html
    index 9c9f7e52f..11cb2fabe 100644
    --- a/tf/client/make/help.html
    +++ b/tf/client/make/help.html
    @@ -31,7 +31,7 @@ 

    Module tf.client.make.help

    Expand source code -Browse git +Browse git
    HELP = """
     tf-make [--backend={backend} {org}/{repo} serve {folder}
    diff --git a/tf/client/make/index.html b/tf/client/make/index.html
    index 3b82ca818..8593a2a74 100644
    --- a/tf/client/make/index.html
    +++ b/tf/client/make/index.html
    @@ -32,7 +32,7 @@ 

    Module tf.client.make

    Expand source code -Browse git +Browse git
    """
     The search app make program
    diff --git a/tf/convert/addnlp.html b/tf/convert/addnlp.html
    index bbb74ab36..f0bd7e32d 100644
    --- a/tf/convert/addnlp.html
    +++ b/tf/convert/addnlp.html
    @@ -114,7 +114,7 @@ 

    Examples

    Expand source code -Browse git +Browse git
    """Add data from an NLP pipeline.
     
    @@ -1760,7 +1760,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         (good, tasks, params, flags) = readArgs("tf-addnlp", HELP, TASKS, PARAMS, FLAGS)
    @@ -1859,7 +1859,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class NLPipeline(CheckImport):
         def __init__(
    @@ -3296,7 +3296,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def generatePlain(self):
         """Generates a plain text out of a data source.
    @@ -3529,7 +3529,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getElementInfo(self, verbose=None):
         """Analyse the schema.
    @@ -3653,7 +3653,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def ingest(
         self,
    @@ -4176,7 +4176,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def ingestNlpOutput(self, positions, tkStream, sentenceStream, entityStream):
         """Ingests NLP output such as tokens in a dataset. Tokens become the new slots.
    @@ -4511,7 +4511,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def lingo(self, *args, **kwargs):
         if not self.importOK():
    @@ -4541,7 +4541,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def loadApp(self, app=None, verbose=None):
         """Loads a given TF app or loads the TF app based on the working directory.
    @@ -4650,7 +4650,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def task(
         self,
    diff --git a/tf/convert/app/app.html b/tf/convert/app/app.html
    index 7701cb473..a97d0aa71 100644
    --- a/tf/convert/app/app.html
    +++ b/tf/convert/app/app.html
    @@ -31,7 +31,7 @@ 

    Module tf.convert.app.app

    Expand source code -Browse git +Browse git
    import types
     from tf.advanced.app import App
    @@ -91,7 +91,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def fmt_layout(app, n, **kwargs):
         return app._wrapHtml(n)
    @@ -146,7 +146,7 @@

    Parameters

    Expand source code -Browse git +Browse git
    class TfApp(App):
         def __init__(app, *args, **kwargs):
    diff --git a/tf/convert/helpers.html b/tf/convert/helpers.html
    index 62a5c5623..ee9814dce 100644
    --- a/tf/convert/helpers.html
    +++ b/tf/convert/helpers.html
    @@ -31,7 +31,7 @@ 

    Module tf.convert.helpers

    Expand source code -Browse git +Browse git
    import re
     from textwrap import dedent
    @@ -835,7 +835,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def checkModel(kind, thisModel, verbose):
         modelDefault = (
    @@ -925,7 +925,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getWhites(text):
         match = W_BEFORE.match(text)
    @@ -997,7 +997,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def lookupSource(cv, cur, tokenAsSlot, specs):
         """Looks up information from the current XML stack.
    @@ -1116,7 +1116,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def matchModel(properties, tag, atts):
         if tag == properties["element"]:
    @@ -1144,7 +1144,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def repTokens(tokens):
         text = []
    @@ -1161,7 +1161,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setUp(kind):
         helpText = f"""
    @@ -1214,7 +1214,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def tokenize(line):
         tokens = []
    @@ -1242,7 +1242,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def tweakTrans(
         template,
    diff --git a/tf/convert/index.html b/tf/convert/index.html
    index 252171fce..2c7d0ac8b 100644
    --- a/tf/convert/index.html
    +++ b/tf/convert/index.html
    @@ -39,7 +39,7 @@ 

    Various forms of data interchange

    Expand source code -Browse git +Browse git
    """
     # Various forms of data interchange
    diff --git a/tf/convert/makewatm.html b/tf/convert/makewatm.html
    index c022c5b6c..f2317a828 100644
    --- a/tf/convert/makewatm.html
    +++ b/tf/convert/makewatm.html
    @@ -31,7 +31,7 @@ 

    Module tf.convert.makewatm

    Expand source code -Browse git +Browse git
    import sys
     from textwrap import dedent
    @@ -515,7 +515,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class MakeWATM:
         """Base class for running conversions to WATM.
    @@ -939,7 +939,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def doTask_page2tf(self):
         good = self.good
    @@ -996,7 +996,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def doTask_tei2tf(self):
         good = self.good
    @@ -1086,7 +1086,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def doTask_watm(self):
         good = self.good
    @@ -1130,7 +1130,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def doTask_watms(self):
         good = self.good
    @@ -1160,7 +1160,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def main(self, cmdLine=None, cargs=sys.argv[1:]):
         FLAGS = self.FLAGS
    @@ -1232,7 +1232,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def prepareRun(self, tasks):
         return
    @@ -1246,7 +1246,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def run(self, tasks):
         TASKS = self.TASKS
    @@ -1269,7 +1269,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def setOptions(
         self,
    diff --git a/tf/convert/mql.html b/tf/convert/mql.html
    index 1fe46e6b3..c12da6839 100644
    --- a/tf/convert/mql.html
    +++ b/tf/convert/mql.html
    @@ -140,7 +140,7 @@ 

    Naming of features in MQL

    Expand source code -Browse git +Browse git
    """
     # MQL
    @@ -1223,7 +1223,7 @@ 

    See Also

    Expand source code -Browse git +Browse git
    def exportMQL(app, mqlDb, exportDir=None):
         """Exports the complete TF dataset into single MQL database.
    @@ -1340,7 +1340,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def importMQL(mqlFile, saveDir, silent=None, slotType=None, otext=None, meta=None):
         """Converts an MQL database dump to a TF dataset.
    @@ -1426,7 +1426,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def makeuni(match):
         """Make proper UNICODE of a text that contains byte escape codes
    @@ -1444,7 +1444,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def parseMql(mqlFile, tmObj):
         info = tmObj.info
    @@ -1658,7 +1658,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def tfFromData(tmObj, objectTypes, tables, nodeF, edgeF, slotType, otext, meta):
         info = tmObj.info
    @@ -1787,7 +1787,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def tfFromMql(mqlFile, tmObj, slotType=None, otext=None, meta=None):
         """Generate TF from MQL
    @@ -1819,7 +1819,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def uni(line):
         return uniscan.sub(makeuni, line)
    @@ -1839,7 +1839,7 @@

    Classes

    Expand source code -Browse git +Browse git
    class MQL:
         def __init__(self, app, mqlDb, exportDir, silent=SILENT_D):
    @@ -2240,7 +2240,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def write(self):
         silent = self.silent
    diff --git a/tf/convert/pagexml.html b/tf/convert/pagexml.html
    index 1eb0342f6..14f9e3b9c 100644
    --- a/tf/convert/pagexml.html
    +++ b/tf/convert/pagexml.html
    @@ -31,7 +31,7 @@ 

    Module tf.convert.pagexml

    Expand source code -Browse git +Browse git
    import sys
     from subprocess import run
    @@ -1113,7 +1113,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def diverge(cv, s, rtx, rsp, ltx, lsp):
         if ltx != rtx:
    @@ -1130,7 +1130,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def emptySlot(cv):
         s = cv.slot()
    @@ -1145,7 +1145,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def linebreakSlot(cv):
         s = cv.slot()
    @@ -1160,7 +1160,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         (good, tasks, params, flags) = readArgs(
    @@ -1183,7 +1183,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def setUp():
         helpText = """
    @@ -1234,7 +1234,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def tokenLogic(cv, s, token, hangover, isFirst, isSecondLast, isLast):
         (rtx, rsp) = token
    @@ -1299,7 +1299,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def walkObject(cv, cur, xObj):
         """Internal function to deal with a single element.
    @@ -1488,7 +1488,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class PageXML(CheckImport):
         def __init__(
    @@ -2367,7 +2367,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def appTask(self):
         """Implementation of the "app" task.
    @@ -2551,7 +2551,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def browseTask(self):
         """Implementation of the "browse" task.
    @@ -2615,7 +2615,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def convertTask(self):
         """Implementation of the "convert" task.
    @@ -2698,7 +2698,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getConverter(self, doc):
         """Initializes a converter.
    @@ -2737,7 +2737,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getDirector(self, doc, docMeta, pageSource, pageFiles):
         """Factory for the director function.
    @@ -2823,7 +2823,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def loadTask(self):
         """Implementation of the "load" task.
    @@ -2914,7 +2914,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def task(
         self,
    diff --git a/tf/convert/pandas.html b/tf/convert/pandas.html
    index 975ff7348..551eab2bf 100644
    --- a/tf/convert/pandas.html
    +++ b/tf/convert/pandas.html
    @@ -61,7 +61,7 @@ 

    Examples

    Expand source code -Browse git +Browse git
    """
     # Export a TF dataset to a `pandas` data frame.
    @@ -440,7 +440,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def exportPandas(app, inTypes=None, exportDir=None):
         """Export a currently loaded TF dataset to `pandas`.
    diff --git a/tf/convert/recorder.html b/tf/convert/recorder.html
    index 8e6544cf0..af5946cb4 100644
    --- a/tf/convert/recorder.html
    +++ b/tf/convert/recorder.html
    @@ -185,7 +185,7 @@ 

    Usage

    Expand source code -Browse git +Browse git
    """
     # Recorder
    @@ -964,7 +964,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Recorder:
         def __init__(self, api=None):
    @@ -1633,7 +1633,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def add(self, string, empty=ZWJ):
         """Add text to the accumulator.
    @@ -1671,7 +1671,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def end(self, n):
         """End a node.
    @@ -1722,7 +1722,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def iPositions(self, byType=False, logical=True, asEntries=False):
         """Get the character positions as mapping from nodes.
    @@ -1830,7 +1830,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeFeatures(self, featurePath, headers=True):
         """Read a tab-separated file of annotation data and convert it to features.
    @@ -1935,7 +1935,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def positions(self, byType=False, simple=False):
         """Get the node positions as mapping from character positions.
    @@ -2098,7 +2098,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def rPositions(self, acceptMaterialOutsideNodes=False):
         """Get the first textual position for each node
    @@ -2267,7 +2267,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def read(self, textPath, posPath=None):
         """Read recorder information from disk.
    @@ -2317,7 +2317,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def start(self, n):
         """Start a node.
    @@ -2345,7 +2345,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def text(self):
         """Get the accumulated text.
    @@ -2404,7 +2404,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def write(
         self, textPath, inverted=False, posPath=None, byType=False, optimize=True
    diff --git a/tf/convert/tei.html b/tf/convert/tei.html
    index 471370471..7ba7e9087 100644
    --- a/tf/convert/tei.html
    +++ b/tf/convert/tei.html
    @@ -452,7 +452,7 @@ 

    Examples

    Expand source code -Browse git +Browse git
    """
     # TEI import
    @@ -5118,7 +5118,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getRefs(tag, atts, xmlFile):
         refAtt = REFERENCING.get(tag, None)
    @@ -5148,7 +5148,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         (good, tasks, params, flags) = readArgs(
    @@ -5171,7 +5171,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def makeCssInfo():
         """Make the CSS info for the style sheet."""
    @@ -5319,7 +5319,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class TEI(CheckImport):
         def __init__(
    @@ -9141,7 +9141,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def appTask(self, tokenBased=False):
         """Implementation of the "app" task.
    @@ -9530,7 +9530,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def browseTask(self):
         """Implementation of the "browse" task.
    @@ -9598,7 +9598,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def checkTask(self):
         """Implementation of the "check" task.
    @@ -10318,7 +10318,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def convertTask(self):
         """Implementation of the "convert" task.
    @@ -10405,7 +10405,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getConverter(self):
         """Initializes a converter.
    @@ -10446,7 +10446,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getDirector(self):
         """Factory for the director function.
    @@ -12078,7 +12078,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getParser(self):
         """Configure the LXML parser.
    @@ -12113,7 +12113,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getSwitches(self, xmlPath):
         verbose = self.verbose
    @@ -12179,7 +12179,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getXML(self):
         """Make an inventory of the TEI source files.
    @@ -12277,7 +12277,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def loadTask(self):
         """Implementation of the "load" task.
    @@ -12335,7 +12335,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def readSchemas(self):
         schemaDir = self.schemaDir
    @@ -12419,7 +12419,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def task(
         self,
    diff --git a/tf/convert/tf.html b/tf/convert/tf.html
    index b7f708fcc..4eb4f25b2 100644
    --- a/tf/convert/tf.html
    +++ b/tf/convert/tf.html
    @@ -32,7 +32,7 @@ 

    Raw, unoptimised data from TF files<
    Expand source code -Browse git +Browse git
    """
     # Raw, unoptimised data from TF files
    @@ -419,7 +419,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def explode(inPath, outPath):
         """Explodes `.tf` files into non-optimised `.tf` files without metadata.
    diff --git a/tf/convert/variants.html b/tf/convert/variants.html
    index 05d063f85..d4c3ba1cf 100644
    --- a/tf/convert/variants.html
    +++ b/tf/convert/variants.html
    @@ -38,7 +38,7 @@ 

    Variants

    Expand source code -Browse git +Browse git
    """
     # Variants
    @@ -676,7 +676,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Variants:
         def __init__(self, cv, cur, baseWitness, sentType, checkPunc, addWarning, addError):
    @@ -1215,7 +1215,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def checkSent(self, trans, punc):
         """Checks whether there is a "sentence" boundary at this point.
    @@ -1263,7 +1263,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def collectWitnesses(self, node):
         """Collect all witnesses.
    @@ -1333,7 +1333,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def endApp(self, tag):
         """Actions at the end of `app`- `lem`- and `rdg`-elements.
    @@ -1393,7 +1393,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def endSent(self):
         """Ends a "sentence" if there is a current sentence.
    @@ -1432,7 +1432,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def initApps(self):
         """Initialize app- processing and witness collection.
    @@ -1461,7 +1461,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def resetApps(self):
         """Initialize app- and "sentence" processing.
    @@ -1504,7 +1504,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def startApp(self, tag, atts):
         """Actions at the start of `app`- `lem`- and `rdg`-elements.
    @@ -1585,7 +1585,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def startSent(self):
         """Starts a "sentence" if there is no current sentence.
    diff --git a/tf/convert/walker.html b/tf/convert/walker.html
    index c9b8dc258..714aa4679 100644
    --- a/tf/convert/walker.html
    +++ b/tf/convert/walker.html
    @@ -157,7 +157,7 @@ 

    Action methods

    Expand source code -Browse git +Browse git
    """
     # Walker
    @@ -1971,7 +1971,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class CV:
         S = "slot"
    @@ -3653,7 +3653,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def active(self, node):
         """Returns whether a node is currently active.
    @@ -3707,7 +3707,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def activeNodes(self, nTypes=None):
         """The currently active nodes, i.e. the embedders.
    @@ -3755,7 +3755,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def activeTypes(self):
         """The node types of the currently active nodes, i.e. the embedders.
    @@ -3799,7 +3799,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def delete(self, node):
         """**deletes** a node.
    @@ -3867,7 +3867,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def edge(self, nodeFrom, nodeTo, **features):
         """Adds **edge features**.
    @@ -3932,7 +3932,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def feature(self, node, **features):
         """Adds **node features**.
    @@ -3982,7 +3982,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def features(self):
         """Gets the list of all features.
    @@ -4030,7 +4030,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def get(self, feature, *args):
         """Retrieves feature values.
    @@ -4102,7 +4102,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def link(self, node, slots):
         """Links the given, existing slots to a node.
    @@ -4166,7 +4166,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def linked(self, node):
         """Returns the slots `ss` to which a node is currently linked.
    @@ -4227,7 +4227,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def meta(self, feat, **metadata):
         """Adds, modifies, deletes metadata fields of features.
    @@ -4330,7 +4330,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def node(self, nType, slots=None):
         """Makes a non-slot node and return the handle to it in `n`.
    @@ -4448,7 +4448,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def occurs(self, feat):
         """Whether the feature `featureName` occurs in the resulting data so far.
    @@ -4512,7 +4512,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def resume(self, node):
         """**resumes** a node.
    @@ -4588,7 +4588,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def slot(self, key=None):
         """Makes a slot node and return the handle to it in `n`.
    @@ -4680,7 +4680,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def stop(self, msg):
         """Stops the director. No further input will be read.
    @@ -4735,7 +4735,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def terminate(self, node):
         """**terminates** a node.
    @@ -4850,7 +4850,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def walk(
         self,
    diff --git a/tf/convert/watm.html b/tf/convert/watm.html
    index 57c6c6f79..1fe74d124 100644
    --- a/tf/convert/watm.html
    +++ b/tf/convert/watm.html
    @@ -589,7 +589,7 @@ 

    Caveat

    Expand source code -Browse git +Browse git
    """Export to Web Annotation Text Model
     
    @@ -3106,7 +3106,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getResultDir(baseDir, headPart, version, prod):
         """Determines the directory for the resulting WATM.
    @@ -3223,7 +3223,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def rep(status):
         """Represent a boolean status for a message to the console.
    @@ -3279,7 +3279,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class WATM:
         """The export machinery is exposed as a class, wrapped around a TF dataset."""
    @@ -4899,7 +4899,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    @staticmethod
     def numEqual(nTF, nWA, silent):
    @@ -4948,7 +4948,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    @staticmethod
     def strEqual(tf, wa, silent):
    @@ -5020,7 +5020,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeAnno(self):
         """Make all annotations.
    @@ -5238,7 +5238,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeText(self):
         """Creates the text data.
    @@ -5328,7 +5328,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mkAnno(self, kind, ns, body, target):
         """Make a single annotation and return its id.
    @@ -5374,7 +5374,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testAll(self, condensed=False):
         """Test all aspects of the WATM conversion.
    @@ -5458,7 +5458,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testAttributes(self):
         """Test the attributes.
    @@ -5691,7 +5691,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testEdges(self):
         """Test the edges.
    @@ -5892,7 +5892,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testElements(self):
         """Test the elements.
    @@ -6084,7 +6084,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testExtra(self):
         """Test the extra data for on-the-fly annotations.
    @@ -6186,7 +6186,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testSetup(self):
         """Prepare the tests.
    @@ -6359,7 +6359,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def testText(self):
         """Test the text.
    @@ -6438,7 +6438,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def writeAll(self, prod=False, resultVersion=None):
         """Write text and annotation data to disk.
    @@ -6678,7 +6678,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class WATMS:
         """Export corpora that are divided over multiple TF datasets.
    @@ -6838,7 +6838,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def produce(self, doc=None, prod=False):
         """Convert all relevant TF datasets.
    diff --git a/tf/convert/xml.html b/tf/convert/xml.html
    index 4aa449921..be371565f 100644
    --- a/tf/convert/xml.html
    +++ b/tf/convert/xml.html
    @@ -135,7 +135,7 @@ 

    Examples

    Expand source code -Browse git +Browse git
    """
     # XML import
    @@ -1399,7 +1399,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         (good, tasks, params, flags) = readArgs(
    @@ -1539,7 +1539,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class XML(CheckImport):
         def __init__(
    @@ -2613,7 +2613,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def appTask(self, tokenBased=False):
         """Implementation of the "app" task.
    @@ -2862,7 +2862,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def browseTask(self):
         """Implementation of the "browse" task.
    @@ -2928,7 +2928,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def checkTask(self):
         """Implementation of the "check" task.
    @@ -3175,7 +3175,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def convertTask(self):
         """Implementation of the "convert" task.
    @@ -3213,7 +3213,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getConverter(self):
         """Initializes a converter.
    @@ -3245,7 +3245,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getParser(self):
         """Configure the LXML parser.
    @@ -3288,7 +3288,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getXML(self):
         """Make an inventory of the XML source files.
    @@ -3348,7 +3348,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def loadTask(self):
         """Implementation of the "load" task.
    @@ -3432,7 +3432,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def task(
         self,
    diff --git a/tf/convert/xmlCustom.html b/tf/convert/xmlCustom.html
    index 356c68f41..4856f183a 100644
    --- a/tf/convert/xmlCustom.html
    +++ b/tf/convert/xmlCustom.html
    @@ -31,7 +31,7 @@ 

    Module tf.convert.xmlCustom

    Expand source code -Browse git +Browse git
    import re
     from io import BytesIO
    @@ -384,7 +384,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def convertTaskDefault(etree):
         if etree is None:
    @@ -482,7 +482,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getDirector(self, etree):
         """Factory for the director function.
    diff --git a/tf/core/api.html b/tf/core/api.html
    index 26ffdf014..2f7b9aac1 100644
    --- a/tf/core/api.html
    +++ b/tf/core/api.html
    @@ -33,7 +33,7 @@ 

    The core API of TF.

    Expand source code -Browse git +Browse git
    """
     # The core API of TF.
    @@ -639,7 +639,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def addLocality(api):
         api.L = Locality(api)
    @@ -654,7 +654,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def addNodes(api):
         api.N = Nodes(api)
    @@ -669,7 +669,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def addOtype(api):
         setattr(api.F.otype, "all", tuple(o[0] for o in api.C.levels.data))
    @@ -686,7 +686,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def addSearch(api, silent=SILENT_D):
         silent = silentConvert(silent)
    @@ -702,7 +702,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def addText(api):
         api.T = Text(api)
    @@ -723,7 +723,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Api:
         def __init__(self, TF):
    @@ -1250,7 +1250,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def Call(self):
         """Returns a sorted list of all usable, loaded computed data names."""
    @@ -1279,7 +1279,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def Cs(self, fName, warn=True):
         """Get the computed data sub API.
    @@ -1321,7 +1321,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def Eall(self, warp=True):
         """Returns a sorted list of all usable, loaded edge feature names.
    @@ -1356,7 +1356,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def Es(self, fName, warn=True):
         """Get the edge feature sub API.
    @@ -1398,7 +1398,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def Fall(self, warp=True):
         """Returns a sorted list of all usable, loaded node feature names.
    @@ -1433,7 +1433,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def Fs(self, fName, warn=True):
         """Get the node feature sub API.
    @@ -1484,7 +1484,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def ensureLoaded(self, features):
         """Checks if features are loaded and if not loads them.
    @@ -1552,7 +1552,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def footprint(self, recompute=False, bySize=True):
         """Computes the memory footprint in RAM of the loaded TF data.
    @@ -1673,7 +1673,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def isLoaded(
         self, features=None, pretty=True, valueType=True, path=False, meta="description"
    @@ -1951,7 +1951,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def makeAvailableIn(self, scope):
         """Exports members of the API to the global namespace.
    diff --git a/tf/core/command.html b/tf/core/command.html
    index 5e95585ec..99978ecc5 100644
    --- a/tf/core/command.html
    +++ b/tf/core/command.html
    @@ -31,7 +31,7 @@ 

    Module tf.core.command

    Expand source code -Browse git +Browse git
    import sys
     from textwrap import dedent
    @@ -250,7 +250,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def readArgs(
         command, descr, possibleTasks, possibleParams, possibleFlags, notInAll=set()
    diff --git a/tf/core/computed.html b/tf/core/computed.html
    index 8cc0ba7a8..2cc0cafa2 100644
    --- a/tf/core/computed.html
    +++ b/tf/core/computed.html
    @@ -52,7 +52,7 @@ 

    Pre-computed data components

    Expand source code -Browse git +Browse git
    """
     # Pre-computed data components
    @@ -117,7 +117,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Computed:
         """Provides access to pre-computed data.
    @@ -138,7 +138,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Computeds:
         pass
    diff --git a/tf/core/data.html b/tf/core/data.html index 748878d11..490e10d2f 100644 --- a/tf/core/data.html +++ b/tf/core/data.html @@ -31,7 +31,7 @@

    Module tf.core.data

    Expand source code -Browse git +Browse git
    import array
     import gc
    @@ -775,7 +775,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Data:
         def __init__(
    @@ -1466,7 +1466,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def cleanDataBin(self):
         fileRemove(self.binPath)
    @@ -1483,7 +1483,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def load(self, metaOnly=False, silent=SILENT_D, _withGc=True):
         """Load a feature.
    @@ -1604,7 +1604,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def save(self, overwrite=False, nodeRanges=False, silent=SILENT_D):
         silent = silentConvert(silent)
    @@ -1627,7 +1627,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def unload(self):
         self.data = None
    diff --git a/tf/core/edgefeature.html b/tf/core/edgefeature.html
    index 6b3517c1e..b6ae90fb8 100644
    --- a/tf/core/edgefeature.html
    +++ b/tf/core/edgefeature.html
    @@ -46,7 +46,7 @@ 

    Module tf.core.edgefeature

    Expand source code -Browse git +Browse git
    """
     Mappings from edges to values.
    @@ -347,7 +347,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class EdgeFeature:
         """Provides access to (edge) feature data.
    @@ -672,7 +672,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def b(self, n):
         """Query *both* incoming edges to, and outgoing edges from a node.
    @@ -783,7 +783,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def f(self, n):
         """Get outgoing edges *from* a node.
    @@ -848,7 +848,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def freqList(self, nodeTypesFrom=None, nodeTypesTo=None):
         """Frequency list of the values of this feature.
    @@ -925,7 +925,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def items(self):
         """A generator that yields the items of the feature, seen as a mapping.
    @@ -971,7 +971,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def t(self, n):
         """Get incoming edges *to* a node.
    @@ -1018,7 +1018,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    class EdgeFeatures:
         pass
    diff --git a/tf/core/fabric.html b/tf/core/fabric.html index 349b783aa..c65e6df79 100644 --- a/tf/core/fabric.html +++ b/tf/core/fabric.html @@ -41,7 +41,7 @@

    Expand source code -Browse git +Browse git
    """
     # `FabricCore`
    @@ -1205,7 +1205,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    class FabricCore:
         """Initialize the core API for a corpus.
    @@ -2189,7 +2189,7 @@ 

    See Also

    Expand source code -Browse git +Browse git
    def clearCache(self):
         """Clears the cache of compiled TF data.
    @@ -2254,7 +2254,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def explore(self, silent=SILENT_D, show=True):
         """Makes categorization of all features in the dataset.
    @@ -2363,7 +2363,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def load(self, features, add=False, silent=SILENT_D):
         """Loads features from disk into RAM memory.
    @@ -2541,7 +2541,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def loadAll(self, silent=SILENT_D):
         """Load all loadable features.
    @@ -2642,7 +2642,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def save(
         self,
    diff --git a/tf/core/files.html b/tf/core/files.html
    index 4d2140ae4..870fa3224 100644
    --- a/tf/core/files.html
    +++ b/tf/core/files.html
    @@ -31,7 +31,7 @@ 

    Module tf.core.files

    Expand source code -Browse git +Browse git
    import os
     import yaml
    @@ -881,7 +881,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def abspath(path):
         return normpath(os.path.abspath(path))
    @@ -912,7 +912,7 @@

    Returns

    Expand source code -Browse git +Browse git
    def annotateDir(app, tool):
         """Return the input and output directories for a specific annotation tool.
    @@ -994,7 +994,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def backendRep(be, kind, default=None):
         """Various back-end dependent values.
    @@ -1118,7 +1118,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def chDir(directory):
         """Change to other directory.
    @@ -1146,7 +1146,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def clearTree(path):
         """Remove all files from a directory, recursively, but leave subdirectories.
    @@ -1203,7 +1203,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirAllFiles(path, ignore=None):
         """Gets all the files found by `path`.
    @@ -1272,7 +1272,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirContents(path):
         """Gets the contents of a directory.
    @@ -1317,7 +1317,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirCopy(pathSrc, pathDst, noclobber=False):
         """Copies a directory if it exists as directory.
    @@ -1343,7 +1343,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirEmpty(target):
         target = normpath(target)
    @@ -1358,7 +1358,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirExists(path):
         """Whether a path exists as directory on the file system."""
    @@ -1381,7 +1381,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirMake(path):
         """Creates a directory if it does not already exist as directory."""
    @@ -1398,7 +1398,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirMove(pathSrc, pathDst):
         """Moves a directory if it exists as directory.
    @@ -1419,7 +1419,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirNm(path):
         """Get the directory part of a file name."""
    @@ -1434,7 +1434,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def dirRemove(path):
         """Removes a directory if it exists as directory."""
    @@ -1450,7 +1450,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def expandDir(obj, dirName):
         if dirName.startswith("~"):
    @@ -1470,7 +1470,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def expanduser(path):
         nPath = normpath(path)
    @@ -1490,7 +1490,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def extNm(path):
         """Get the extension part of a file name.
    @@ -1511,7 +1511,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileCopy(pathSrc, pathDst):
         """Copies a file if it exists as file.
    @@ -1531,7 +1531,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileExists(path):
         """Whether a path exists as file on the file system."""
    @@ -1547,7 +1547,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileMove(pathSrc, pathDst):
         """Moves a file if it exists as file.
    @@ -1567,7 +1567,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileNm(path):
         """Get the file part of a file name."""
    @@ -1585,7 +1585,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileOpen(*args, **kwargs):
         """Wrapper around `open()`, making sure `encoding="utf8" is passed.
    @@ -1608,7 +1608,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fileRemove(path):
         """Removes a file if it exists as file."""
    @@ -1629,7 +1629,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getCwd():
         """Get current directory.
    @@ -1671,7 +1671,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getLocation(targetDir=None):
         """Get back-end, org, repo, relative of directory.
    @@ -1752,7 +1752,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def initTree(path, fresh=False, gentle=False):
         """Make sure a directory exists, optionally clean it.
    @@ -1794,7 +1794,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def isDir(path):
         """Whether path exists and is a directory."""
    @@ -1809,7 +1809,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def isFile(path):
         """Whether path exists and is a file."""
    @@ -1824,7 +1824,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def normpath(path):
         if path is None:
    @@ -1841,7 +1841,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def prefixSlash(path):
         """Prefix a / before a path if it is non-empty and not already starts with it."""
    @@ -1856,7 +1856,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def readYaml(text=None, plain=False, asFile=None, preferTuples=True):
         kwargs = dict(Loader=yaml.FullLoader)
    @@ -1881,7 +1881,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def replaceExt(path, newExt):
         """Replace the extension of a path by another one. Specify it without dot."""
    @@ -1897,7 +1897,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setDir(obj):
         obj.homeDir = expanduser("~")
    @@ -1913,7 +1913,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def splitPath(path):
         """Split a file name in a directory part and a file part."""
    @@ -1929,7 +1929,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def str_presenter(dumper, data):
         """configures yaml for dumping multiline strings
    @@ -1949,7 +1949,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def stripExt(path):
         """Strip the extension of a file name, if there is one."""
    @@ -1966,7 +1966,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def unexpanduser(path):
         nPath = normpath(path)
    @@ -1984,7 +1984,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def writeYaml(data, asFile=None, sorted=False):
         kwargs = dict(allow_unicode=True, sort_keys=sorted)
    diff --git a/tf/core/generic.html b/tf/core/generic.html
    index d564825f6..e0f603390 100644
    --- a/tf/core/generic.html
    +++ b/tf/core/generic.html
    @@ -31,7 +31,7 @@ 

    Module tf.core.generic

    Expand source code -Browse git +Browse git
    class AttrDict(dict):
         """Turn a dict into an object with attributes.
    @@ -190,7 +190,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def deepAttrDict(info, preferTuples=False):
         """Turn a `dict` into an `AttrDict`, recursively.
    @@ -254,7 +254,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def deepdict(info):
         """Turns an `AttrDict` into a `dict`, recursively.
    @@ -304,7 +304,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def isIterable(value):
         """Whether a value is a non-string iterable.
    @@ -346,7 +346,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class AttrDict(dict):
         """Turn a dict into an object with attributes.
    @@ -401,7 +401,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def deepdict(self):
         return deepdict(self)
    diff --git a/tf/core/helpers.html b/tf/core/helpers.html index acf2bb914..57db45af7 100644 --- a/tf/core/helpers.html +++ b/tf/core/helpers.html @@ -31,7 +31,7 @@

    Module tf.core.helpers

    Expand source code -Browse git +Browse git
    import os
     import sys
    @@ -732,7 +732,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def camel(name):
         if not name:
    @@ -749,7 +749,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def check32():
         warn = ""
    @@ -770,7 +770,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def cleanName(name):
         clean = "".join(c if c in VALID else "_" for c in name)
    @@ -787,7 +787,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def collectFormats(config):
         featureSet = set()
    @@ -824,7 +824,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def console(*msg, error=False, newline=True):
         msg = " ".join(m if type(m) is str else repr(m) for m in msg)
    @@ -852,7 +852,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def deepSize(o, handlers={}, verbose=False, seen=None):
         """Returns the approximate memory footprint an object and all of its contents.
    @@ -911,7 +911,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def fitemize(value):
         if not value:
    @@ -931,7 +931,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def flattenToSet(features):
         theseFeatures = set()
    @@ -968,7 +968,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def formatMeta(featureMeta):
         """Reorder meta data.
    @@ -1017,7 +1017,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getAllRealFeatures(api):
         """Get all configuration features and all loaded node and edge features.
    @@ -1062,7 +1062,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def htmlEsc(val, math=False):
         """Escape certain HTML characters by HTML entities.
    @@ -1102,7 +1102,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def isClean(name):
         if name is None or len(name) == 0 or name[0] not in LETTER:
    @@ -1118,7 +1118,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def isInt(val):
         try:
    @@ -1136,7 +1136,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def itemize(string, sep=None):
         if not string:
    @@ -1154,7 +1154,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeExamples(nodeList):
         lN = len(nodeList)
    @@ -1177,7 +1177,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeIndex(data):
         inv = {}
    @@ -1194,7 +1194,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeInverse(data):
         inverse = {}
    @@ -1212,7 +1212,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeInverseVal(data):
         inverse = {}
    @@ -1232,7 +1232,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mathEsc(val):
         """Escape dollar signs to `<span>$</span>`.
    @@ -1260,7 +1260,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mdEsc(val, math=False):
         """Escape certain markdown characters.
    @@ -1300,7 +1300,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mdhtmlEsc(val, math=False):
         """Escape certain Markdown characters by HTML entities or span elements.
    @@ -1354,7 +1354,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mergeDict(source, overrides):
         """Merge overrides into a source dictionary recursively.
    @@ -1382,7 +1382,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def mergeDictOfSets(d1, d2):
         for n, ms in d2.items():
    @@ -1400,7 +1400,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def nbytes(by):
         units = ["B", "KB", "MB", "GB", "TB"]
    @@ -1421,7 +1421,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def pandasEsc(x):
         """Escapes the character that will be used as the `pandas` quote char.
    @@ -1446,7 +1446,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def project(iterableOfTuples, maxDimension):
         if maxDimension == 1:
    @@ -1462,7 +1462,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def rangesFromList(nodeList):  # the list must be sorted
         curstart = None
    @@ -1489,7 +1489,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def rangesFromSet(nodeSet):
         # ranges = []
    @@ -1531,7 +1531,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def run(cmdline, workDir=None):
         """Runs a shell command and returns all relevant info.
    @@ -1575,7 +1575,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setFromSpec(spec):
         covered = set()
    @@ -1601,7 +1601,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setFromStr(x):
         if x is None:
    @@ -1618,7 +1618,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def setFromValue(x, asInt=False):
         if x is None:
    @@ -1643,7 +1643,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def specFromRanges(ranges):  # ranges must be normalized
         return ",".join(
    @@ -1659,7 +1659,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def specFromRangesLogical(ranges):  # ranges must be normalized
         return [r[0] if r[0] == r[1] else [r[0], r[1]] for r in ranges]
    @@ -1673,7 +1673,7 @@

    Parameters

    Expand source code -Browse git +Browse git
    def tfFromValue(val):
         valTp = type(val)
    @@ -1699,7 +1699,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def tsvEsc(x):
         """Escapes a double quote for strings to be included in TSV data.
    @@ -1719,7 +1719,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def valueFromTf(tf):
         return "\\".join(
    @@ -1745,7 +1745,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def var(envVar):
         """Retrieves the value of an environment variable.
    @@ -1771,7 +1771,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def versionSort(x):
         parts = []
    @@ -1792,7 +1792,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def wrapMessages(messages):
         if type(messages) is str:
    @@ -1827,7 +1827,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def xmlEsc(val):
         """Escape certain HTML characters by XML entities.
    diff --git a/tf/core/index.html b/tf/core/index.html
    index ebfd8d3cd..dd3ab0478 100644
    --- a/tf/core/index.html
    +++ b/tf/core/index.html
    @@ -44,7 +44,7 @@ 

    Core API of TF

    Expand source code -Browse git +Browse git
    """
     # Core API of TF
    diff --git a/tf/core/locality.html b/tf/core/locality.html
    index 488b84e84..07c088763 100644
    --- a/tf/core/locality.html
    +++ b/tf/core/locality.html
    @@ -32,7 +32,7 @@ 

    Local navigation between nodes.

    Expand source code -Browse git +Browse git
    """
     # Local navigation between nodes.
    @@ -404,7 +404,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Locality:
         """Methods by which you can navigate from a node to its neighbourhood.
    @@ -742,7 +742,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def d(self, n, otype=None):
         """Produces an ordered tuple of *downward* nodes.
    @@ -836,7 +836,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def i(self, n, otype=None):
         """Produces an ordered tuple of *intersecting* nodes
    @@ -918,7 +918,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def n(self, n, otype=None):
         """Produces an ordered tuple of *next* nodes.
    @@ -994,7 +994,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def p(self, n, otype=None):
         """Produces an ordered tuple of *previous* nodes.
    @@ -1075,7 +1075,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def u(self, n, otype=None):
         """Produces an ordered tuple of *upward* nodes.
    diff --git a/tf/core/nodefeature.html b/tf/core/nodefeature.html
    index 660cdef4c..db058ff78 100644
    --- a/tf/core/nodefeature.html
    +++ b/tf/core/nodefeature.html
    @@ -41,7 +41,7 @@ 

    Mappings from nodes to values.

    Expand source code -Browse git +Browse git
    """
     # Mappings from nodes to values.
    @@ -197,7 +197,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class NodeFeature:
         """Provides access to (node) feature data.
    @@ -339,7 +339,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def freqList(self, nodeTypes=None):
         """Frequency list of the values of this feature.
    @@ -386,7 +386,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def items(self):
         """A generator that yields the items of the feature, seen as a mapping.
    @@ -427,7 +427,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def s(self, val):
         """Query all nodes having a specified feature value.
    @@ -475,7 +475,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def v(self, n):
         """Get the value of a feature for a node.
    @@ -506,7 +506,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    class NodeFeatures:
         pass
    diff --git a/tf/core/nodes.html b/tf/core/nodes.html index 2e362a24a..acea3e537 100644 --- a/tf/core/nodes.html +++ b/tf/core/nodes.html @@ -81,7 +81,7 @@

    Canonical Order

    Expand source code -Browse git +Browse git
    """
     # Node organization
    @@ -399,7 +399,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Nodes:
         def __init__(self, api):
    @@ -710,7 +710,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def makeSortKeyChunk(self):
         api = self.api
    @@ -802,7 +802,7 @@ 

    See Also

    Expand source code -Browse git +Browse git
    def sortNodes(self, nodeSet):
         """Delivers a tuple of nodes sorted by the *canonical ordering*.
    @@ -871,7 +871,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def walk(self, nodes=None, events=False):
         """Generates all nodes in the *canonical order*.
    diff --git a/tf/core/oslotsfeature.html b/tf/core/oslotsfeature.html
    index 6597c81bf..4af74e1a6 100644
    --- a/tf/core/oslotsfeature.html
    +++ b/tf/core/oslotsfeature.html
    @@ -35,7 +35,7 @@ 

    Access to oslots feature dat
    Expand source code -Browse git +Browse git
    """
     # Access to `oslots` feature data.
    @@ -120,7 +120,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class OslotsFeature:
         def __init__(self, api, metaData, data):
    @@ -196,7 +196,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def items(self):
         """A generator that yields the non-slot nodes with their slots.
    @@ -235,7 +235,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def s(self, n):
         """Get the slots of a (non-slot) node.
    diff --git a/tf/core/otypefeature.html b/tf/core/otypefeature.html
    index eb13d2a65..12e3624ca 100644
    --- a/tf/core/otypefeature.html
    +++ b/tf/core/otypefeature.html
    @@ -35,7 +35,7 @@ 

    Access to otype feature data.
    Expand source code -Browse git +Browse git
    """
     # Access to `otype` feature data.
    @@ -190,7 +190,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class OtypeFeature:
         def __init__(self, api, metaData, data):
    @@ -351,7 +351,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def items(self):
         """As in `tf.core.nodefeature.NodeFeature.items`."""
    @@ -392,7 +392,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def s(self, val):
         """Query all nodes having a specified node type.
    @@ -452,7 +452,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def sInterval(self, val):
         """The interval of nodes having a specified node type.
    @@ -498,7 +498,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def v(self, n):
         """Get the node type of a node.
    diff --git a/tf/core/prepare.html b/tf/core/prepare.html
    index 2231f3d6e..3fde4df54 100644
    --- a/tf/core/prepare.html
    +++ b/tf/core/prepare.html
    @@ -39,7 +39,7 @@ 

    Pre-compute data.

    Expand source code -Browse git +Browse git
    """
     # Pre-compute data.
    @@ -872,7 +872,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def boundary(info, error, otype, oslots, rank):
         """Computes boundary data.
    @@ -971,7 +971,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def characters(info, error, otext, tFormats, *tFeats):
         """Computes character data.
    @@ -1071,7 +1071,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def levDown(info, error, otype, levUp, rank):
         """Computes level-down data.
    @@ -1170,7 +1170,7 @@ 

    Warnings

    Expand source code -Browse git +Browse git
    def levUp(info, error, otype, oslots, rank):
         """Computes level-up data.
    @@ -1320,7 +1320,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def levels(info, error, otype, oslots, otext):
         """Computes level data.
    @@ -1472,7 +1472,7 @@ 

    See Also

    Expand source code -Browse git +Browse git
    def order(info, error, otype, oslots, levels):
         """Computes order data for the canonical ordering.
    @@ -1577,7 +1577,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def rank(info, error, otype, order):
         """Computes rank data.
    @@ -1664,7 +1664,7 @@ 

    Warnings

    Expand source code -Browse git +Browse git
    def sections(info, error, otype, oslots, otext, levUp, levels, *sFeats):
         """Computes section data.
    @@ -1852,7 +1852,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def structure(info, error, otype, oslots, otext, rank, levUp, *sFeats):
         """Computes structure data.
    diff --git a/tf/core/text.html b/tf/core/text.html
    index 19f033f74..9a2b806d3 100644
    --- a/tf/core/text.html
    +++ b/tf/core/text.html
    @@ -374,7 +374,7 @@ 

    The T.text() function

    Expand source code -Browse git +Browse git
    """
     # Text API
    @@ -1683,7 +1683,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Text:
         """Low level text representation, including section headings.
    @@ -2632,7 +2632,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def down(self, n):
         """Gives the children of a structural node.
    @@ -2704,7 +2704,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def headingFromNode(self, n):
         """Gives the full heading of a structural node.
    @@ -2776,7 +2776,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def nodeFromHeading(self, head):
         """Gives the node corresponding to a heading, provided it exists.
    @@ -2841,7 +2841,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def nodeFromSection(self, section, lang="en"):
         """Given a section tuple, return the node of it.
    @@ -2925,7 +2925,7 @@ 

    Warnings

    Expand source code -Browse git +Browse git
    def sectionFromNode(self, n, lastSlot=False, lang="en", fillup=False):
         """Gives the full heading of a section node.
    @@ -3024,7 +3024,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def sectionTuple(self, n, lastSlot=False, fillup=False):
         """Gives a tuple of nodes that correspond to a section.
    @@ -3129,7 +3129,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def splitDefaultFormat(self, tpl):
         api = self.api
    @@ -3152,7 +3152,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def splitFormat(self, tpl):
         api = self.api
    @@ -3186,7 +3186,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def structure(self, node=None):
         """Gives the structure of node and everything below it as a tuple.
    @@ -3239,7 +3239,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
        def structureInfo(self):
             """Gives a summary of how structure has been configured in the dataset.
    @@ -3334,7 +3334,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def structurePretty(self, node=None, fullHeading=False):
         """Gives the structure of node and everything below it as a string.
    @@ -3435,7 +3435,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
        def text(self, nodes, fmt=None, descend=None, func=None, explain=False, **kwargs):
             """Gives the text that corresponds to a bunch of nodes.
    @@ -3660,7 +3660,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def top(self):
         """Gives all top-level structural nodes in the dataset.
    @@ -3704,7 +3704,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def up(self, n):
         """Gives the parent of a structural node.
    diff --git a/tf/core/timestamp.html b/tf/core/timestamp.html
    index 110b8a6a5..157b9e82d 100644
    --- a/tf/core/timestamp.html
    +++ b/tf/core/timestamp.html
    @@ -34,7 +34,7 @@ 

    Timed messages

    Expand source code -Browse git +Browse git
    """
     # Timed messages
    @@ -414,7 +414,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def silentConvert(arg):
         if arg is None:
    @@ -476,7 +476,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Timestamp:
         def __init__(self, silent=SILENT_D, level=None):
    @@ -778,7 +778,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def cache(self, _asString=False):
         if _asString:
    @@ -824,7 +824,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def debug(self, msg, tm=True, nl=True, cache=0, force=False):
         """Sends a debug message to the standard output.
    @@ -879,7 +879,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def error(self, msg, tm=True, nl=True, cache=0, force=True):
         """Sends an warning message to the standard error.
    @@ -928,7 +928,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def indent(self, level=None, reset=False, _verbose=None):
         """Changes the indentation and timing of forthcoming messages.
    @@ -996,7 +996,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def info(self, msg, tm=True, nl=True, cache=0, force=False):
         """Sends an informational message to the standard output.
    @@ -1038,7 +1038,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def isSilent(self):
         """The current verbosity.
    @@ -1059,7 +1059,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def raw_msg(self, msg, tm=True, nl=True, cache=0, error=False):
         # cache is a list: append to cache, do not output anything
    @@ -1096,7 +1096,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def reset(self):
         self.log = []
    @@ -1115,7 +1115,7 @@

    Parameters

    Expand source code -Browse git +Browse git
    def setSilent(self, silent):
         """Set the verbosity.
    @@ -1138,7 +1138,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def silentOff(self):
         """Enable informational messages."""
    @@ -1160,7 +1160,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def silentOn(self, deep=False):
         """Suppress informational messages.
    @@ -1203,7 +1203,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def warning(self, msg, tm=True, nl=True, cache=0, force=False):
         """Sends an warning message to the standard output.
    diff --git a/tf/dataset/index.html b/tf/dataset/index.html
    index 50fbd1616..9095810ba 100644
    --- a/tf/dataset/index.html
    +++ b/tf/dataset/index.html
    @@ -43,7 +43,7 @@ 

    Dataset operations

    Expand source code -Browse git +Browse git
    """
     # Dataset operations
    diff --git a/tf/dataset/modify.html b/tf/dataset/modify.html
    index d60b439c4..9476620c9 100644
    --- a/tf/dataset/modify.html
    +++ b/tf/dataset/modify.html
    @@ -48,7 +48,7 @@ 

    Usage

    Expand source code -Browse git +Browse git
    """
     # Modify
    @@ -1881,7 +1881,7 @@ 

    Example

    Expand source code -Browse git +Browse git
    def modify(
         location,
    diff --git a/tf/dataset/nodemaps.html b/tf/dataset/nodemaps.html
    index fd2694740..9840073c9 100644
    --- a/tf/dataset/nodemaps.html
    +++ b/tf/dataset/nodemaps.html
    @@ -138,7 +138,7 @@ 

    Usage

    Expand source code -Browse git +Browse git
    """
     # Node maps
    @@ -893,7 +893,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Versions:
         def __init__(self, api, va, vb, silent=SILENT_D, slotMap=None):
    @@ -1459,7 +1459,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
        def caption(self, level, heading, good=None, newLine=True, continuation=False):
             silent = self.silent
    @@ -1535,7 +1535,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def exploreNodeMapping(self, nodeType):
         va = self.va
    @@ -1604,7 +1604,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def getDiagnosis(self, node=None, label=None):
         """Show the diagnosis of a mapping.
    @@ -1684,7 +1684,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def legend(self):
         """Show the labels and descriptions of the diagnosis classes.
    @@ -1708,7 +1708,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeNodeMapping(self, nodeType):
         edge = self.edge
    @@ -1799,7 +1799,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def makeVersionMapping(self):
         Fa = self.Fa
    @@ -1855,7 +1855,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def migrateFeatures(self, featureNames, silent=None, location=None):
         """Migrate features from one version to another based on a node map.
    @@ -2050,7 +2050,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def omapName(self):
         va = self.va
    @@ -2066,7 +2066,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def writeMap(self):
         TFb = self.TFb
    diff --git a/tf/fabric.html b/tf/fabric.html
    index e8119a2cc..4e0d43a4b 100644
    --- a/tf/fabric.html
    +++ b/tf/fabric.html
    @@ -52,7 +52,7 @@ 

    Fabri
    Expand source code -Browse git +Browse git
    """
     # `Fabric`
    @@ -346,7 +346,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Fabric(FabricCore):
         """Initialize the core API for a corpus.
    @@ -572,7 +572,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def collect(
         self,
    @@ -628,7 +628,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def extract(
         self, volumes=True, byTitle=True, silent=SILENT_D, overwrite=None, show=False
    @@ -675,7 +675,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def getVolumes(self):
         """Lists available volumes within the dataset.
    diff --git a/tf/index.html b/tf/index.html
    index b48235e88..bf7dbe1ee 100644
    --- a/tf/index.html
    +++ b/tf/index.html
    @@ -154,7 +154,7 @@ 

    More resources

    Expand source code -Browse git +Browse git
    """
     .. include:: docs/main/top.md
    diff --git a/tf/lib.html b/tf/lib.html
    index a4aa579ad..245728f13 100644
    --- a/tf/lib.html
    +++ b/tf/lib.html
    @@ -33,7 +33,7 @@ 

    Utility functions

    Expand source code -Browse git +Browse git
    """
     # Utility functions
    @@ -237,7 +237,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def readList(source):
         """Reads list of tuples from a TSV file.
    @@ -300,7 +300,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def readSets(source):
         """Reads a dictionary of named sets from file.
    @@ -370,7 +370,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def writeList(data, dest, intCols=None):
         """Writes a list of tuples sets to a TSV file.
    @@ -457,7 +457,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def writeSets(sets, dest):
         """Writes a dictionary of named sets to file.
    diff --git a/tf/parameters.html b/tf/parameters.html
    index 1e05cae70..26755542d 100644
    --- a/tf/parameters.html
    +++ b/tf/parameters.html
    @@ -33,7 +33,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    """
     # Parameters
    diff --git a/tf/search/graph.html b/tf/search/graph.html
    index 452fa73ec..d22975745 100644
    --- a/tf/search/graph.html
    +++ b/tf/search/graph.html
    @@ -32,7 +32,7 @@ 

    Graph oriented functions nee
    Expand source code -Browse git +Browse git
    """
     # Graph oriented functions needed for search
    @@ -290,7 +290,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def connectedness(searchExe):
         error = searchExe.api.TF.error
    @@ -342,7 +342,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def displayEdge(searchExe, e, dir, nodesSeen):
         info = searchExe.api.TF.info
    @@ -396,7 +396,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def displayNode(searchExe, q, pos2=False):
         info = searchExe.api.TF.info
    @@ -424,7 +424,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def displayPlan(searchExe, details=False):
         if not searchExe.good:
    @@ -497,7 +497,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def multiEdges(searchExe):
         relations = searchExe.relations
    diff --git a/tf/search/index.html b/tf/search/index.html
    index 70ada45a1..1e1178fc6 100644
    --- a/tf/search/index.html
    +++ b/tf/search/index.html
    @@ -37,7 +37,7 @@ 

    Guidance for searching

    Expand source code -Browse git +Browse git
    """
     # Guidance for searching
    diff --git a/tf/search/relations.html b/tf/search/relations.html
    index 76404fde1..ae9f1fe1c 100644
    --- a/tf/search/relations.html
    +++ b/tf/search/relations.html
    @@ -32,7 +32,7 @@ 

    Search by relational patter
    Expand source code -Browse git +Browse git
    """
     # Search by relational patterns between nodes
    @@ -1865,7 +1865,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def add_F_Relations(searchExe, varRels):
         relations = searchExe.relations
    @@ -1946,7 +1946,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def add_K_Relations(searchExe, varRels):
         relations = searchExe.relations
    @@ -1999,7 +1999,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def add_V_Relations(searchExe, varRels):
         relations = searchExe.relations
    @@ -2064,7 +2064,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def basicRelations(searchExe, api):
         C = api.C
    diff --git a/tf/search/search.html b/tf/search/search.html
    index 94523571c..64018d140 100644
    --- a/tf/search/search.html
    +++ b/tf/search/search.html
    @@ -32,7 +32,7 @@ 

    Search (top-level)

    Expand source code -Browse git +Browse git
    """
     # Search (top-level)
    @@ -596,7 +596,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Search:
         """ """
    @@ -1176,7 +1176,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def count(self, progress=None, limit=None):
         """Counts the results, with progress messages, optionally up to a limit.
    @@ -1278,7 +1278,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def fetch(self, limit=None, _msgCache=False):
         """Retrieves query results, up to a limit.
    @@ -1390,7 +1390,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def glean(self, tup):
         """Renders a single result into something human readable.
    @@ -1476,7 +1476,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def relationsLegend(self):
         """Dynamic info about the basic relations that can be used in templates.
    @@ -1547,7 +1547,7 @@ 

    Notes

    Expand source code -Browse git +Browse git
    def search(
         self,
    @@ -1657,7 +1657,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def showPlan(self, details=False):
         """Show the result of the latest study of a template.
    @@ -1734,7 +1734,7 @@ 

    See Also

    Expand source code -Browse git +Browse git
    def study(
         self,
    @@ -1917,7 +1917,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def tweakPerformance(self, silent=SILENT_D, **kwargs):
         """Tweak parameters that influence the search process.
    diff --git a/tf/search/searchexe.html b/tf/search/searchexe.html
    index 0912da7a8..2b24be5c7 100644
    --- a/tf/search/searchexe.html
    +++ b/tf/search/searchexe.html
    @@ -32,7 +32,7 @@ 

    Search execution management

    Expand source code -Browse git +Browse git
    """
     # Search execution management
    @@ -300,7 +300,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class SearchExe:
         perfDefaults = dict(
    @@ -553,7 +553,7 @@ 

    Static methods

    Expand source code -Browse git +Browse git
    @classmethod
     def setPerfParams(cls, params):
    @@ -571,7 +571,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def count(self, progress=None, limit=None):
         TF = self.api.TF
    @@ -637,7 +637,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def fetch(self, limit=None):
         api = self.api
    @@ -683,7 +683,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def search(self, limit=None):
         api = self.api
    @@ -703,7 +703,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def showOuterTemplate(self, _msgCache):
         error = self.api.TF.error
    @@ -724,7 +724,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def showPlan(self, details=False):
         displayPlan(self, details=details)
    @@ -738,7 +738,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def study(self, strategy=None):
         api = self.api
    diff --git a/tf/search/semantics.html b/tf/search/semantics.html
    index e77371c78..c9a6212a8 100644
    --- a/tf/search/semantics.html
    +++ b/tf/search/semantics.html
    @@ -32,7 +32,7 @@ 

    Semantics of search templates

    Expand source code -Browse git +Browse git
    """
     # Semantics of search templates
    @@ -566,7 +566,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def semantics(searchExe):
         if not searchExe.good:
    diff --git a/tf/search/spin.html b/tf/search/spin.html
    index d56a9c675..02a0e6023 100644
    --- a/tf/search/spin.html
    +++ b/tf/search/spin.html
    @@ -32,7 +32,7 @@ 

    Search pre-processing

    Expand source code -Browse git +Browse git
    """
     # Search pre-processing
    @@ -484,7 +484,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def estimateSpreads(searchExe, both=False):
         TRY_LIMIT_F = searchExe.perfParams["tryLimitFrom"]
    @@ -562,7 +562,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def spinAtoms(searchExe):
         qnodes = searchExe.qnodes
    @@ -578,7 +578,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def spinEdges(searchExe):
         qnodes = searchExe.qnodes
    diff --git a/tf/search/stitch.html b/tf/search/stitch.html
    index c744ef819..14d0054e0 100644
    --- a/tf/search/stitch.html
    +++ b/tf/search/stitch.html
    @@ -32,7 +32,7 @@ 

    Search result finding

    Expand source code -Browse git +Browse git
    """
     # Search result finding
    @@ -937,7 +937,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def setStrategy(searchExe, strategy, keep=False):
         error = searchExe.api.TF.error
    @@ -971,7 +971,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def stitch(searchExe):
         estimateSpreads(searchExe, both=True)
    diff --git a/tf/search/syntax.html b/tf/search/syntax.html
    index bca23d754..c909be80e 100644
    --- a/tf/search/syntax.html
    +++ b/tf/search/syntax.html
    @@ -32,7 +32,7 @@ 

    Syntax of search templates

    Expand source code -Browse git +Browse git
    """
     # Syntax of search templates
    @@ -730,7 +730,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def cleanParent(atom, parentName):
         (kind, data) = parseLine(atom)
    @@ -748,7 +748,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def deContext(quantifier, parentName):
         (quKind, quTemplates, ln) = quantifier
    @@ -804,7 +804,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def parseFeatureVals(searchExe, featStr, features, i, asEdge=False):
         if asEdge:
    @@ -879,7 +879,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def parseLine(line):
         for x in [True]:
    @@ -936,7 +936,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def syntax(searchExe):
         error = searchExe.api.TF.error
    diff --git a/tf/tools/checkdiffs.html b/tf/tools/checkdiffs.html
    index fc4e24b65..a8627ac3c 100644
    --- a/tf/tools/checkdiffs.html
    +++ b/tf/tools/checkdiffs.html
    @@ -31,7 +31,7 @@ 

    Module tf.tools.checkdiffs

    Expand source code -Browse git +Browse git
    import sys
     from itertools import zip_longest
    @@ -130,7 +130,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def checkDiffs(path1, path2):
         """Check differences between runs of TF generations.
    diff --git a/tf/tools/index.html b/tf/tools/index.html
    index a96cdcb60..3a11afe14 100644
    --- a/tf/tools/index.html
    +++ b/tf/tools/index.html
    @@ -32,7 +32,7 @@ 

    Module tf.tools

    Expand source code -Browse git +Browse git
    """Various tools for workflows around TF."""
    diff --git a/tf/tools/myspacy.html b/tf/tools/myspacy.html index 9c544ab54..ca7dfe7b4 100644 --- a/tf/tools/myspacy.html +++ b/tf/tools/myspacy.html @@ -41,7 +41,7 @@

    Module tf.tools.myspacy

    Expand source code -Browse git +Browse git
    """Get words and tokens from a plain text with the help of Spacy.
     
    @@ -484,7 +484,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def nlpOutput(text, lang="en", ner=False, parser=False):
         """Runs the Spacy NLP pipeline and delivers the results.
    @@ -554,7 +554,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Spacy(CheckImport):
         def __init__(self, lang=None, parser=False):
    @@ -885,7 +885,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getEntities(self):
         """Get the resulting named entities.
    @@ -949,7 +949,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getSentences(self):
         """Get the resulting sentences.
    @@ -1032,7 +1032,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getTokens(self):
         """Get the resulting tokens.
    @@ -1099,7 +1099,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def read(self, text):
         """Process a plain text.
    diff --git a/tf/tools/nbconvert.html b/tf/tools/nbconvert.html
    index 38489b7b1..167256c2b 100644
    --- a/tf/tools/nbconvert.html
    +++ b/tf/tools/nbconvert.html
    @@ -31,7 +31,7 @@ 

    Module tf.tools.nbconvert

    Expand source code -Browse git +Browse git
    import sys
     import re
    @@ -310,7 +310,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def convertDir(inputDir, outputDir):
         inPlace = outputDir == "-"
    @@ -409,7 +409,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         args = sys.argv[1:]
    @@ -428,7 +428,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def makeIndex(inputDir):
         htmlStart = dedent(
    @@ -536,7 +536,7 @@ 

    Index Mode

    Expand source code -Browse git +Browse git
    def task(*args):
         inputDir = args[0]
    diff --git a/tf/tools/pdocs.html b/tf/tools/pdocs.html
    index 2340e8d2d..5250dd07c 100644
    --- a/tf/tools/pdocs.html
    +++ b/tf/tools/pdocs.html
    @@ -31,7 +31,7 @@ 

    Module tf.tools.pdocs

    Expand source code -Browse git +Browse git
    import sys
     import os
    @@ -277,7 +277,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def console(*args):
         sys.stderr.write(" ".join(args) + "\n")
    @@ -292,7 +292,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def getCommand(pkg, asString=False):
         templateLoc = TEMPLATE_LOC.format(pkg)
    @@ -317,7 +317,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def pdoc3(pkg):
         """Build the docs into site."""
    @@ -346,7 +346,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def pdoc3serve(pkg):
         """Build the docs into site and serve them."""
    @@ -369,7 +369,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def servePdocs(pkg):
         run("python -m http.server 9000", cwd=SITE, shell=True)
    @@ -383,7 +383,7 @@

    Functions

    Expand source code -Browse git +Browse git
    def shipDocs(org, repo, pkg, pdoc=True):
         """Build the docs into site and ship them."""
    diff --git a/tf/tools/release.html b/tf/tools/release.html
    index 9929eb0d5..0e55236ab 100644
    --- a/tf/tools/release.html
    +++ b/tf/tools/release.html
    @@ -31,7 +31,7 @@ 

    Module tf.tools.release

    Expand source code -Browse git +Browse git
    import sys
     
    @@ -110,7 +110,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def makeRelease(org, repo, tag, name, msg, silent=True):
         ghPerson = var("GHPERS")
    diff --git a/tf/tools/xmlschema.html b/tf/tools/xmlschema.html
    index 94bcf4363..5b67e2452 100644
    --- a/tf/tools/xmlschema.html
    +++ b/tf/tools/xmlschema.html
    @@ -107,7 +107,7 @@ 

    As library

    Expand source code -Browse git +Browse git
    """
     ## Meaningful information from XML schemas.
    @@ -1180,7 +1180,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         A = Analysis()
    @@ -1209,7 +1209,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Analysis(CheckImport):
         @staticmethod
    @@ -1655,7 +1655,7 @@ 

    Static methods

    Expand source code -Browse git +Browse git
    @staticmethod
     def help():
    @@ -1696,7 +1696,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def analyser(self, baseSchema, override):
         """Initializes an analyser for a schema.
    @@ -1755,7 +1755,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def elements(self, baseSchema, override):
         """Makes a list of elements and their properties.
    @@ -1821,7 +1821,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def fromrelax(self, baseSchema, schemaOut):
         """Converts a RelaxNG schema to an XSD schema.
    @@ -1868,7 +1868,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getBaseSchema(self):
         """Get the base schema.
    @@ -1910,7 +1910,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getElementInfo(self, baseSchema, overrides, verbose=None):
         """Analyse the schema and its overrides.
    @@ -1970,7 +1970,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getModel(self, xmlContent):
         modelRe = self.modelRe
    @@ -2007,7 +2007,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def run(self):
         """Run a task specified by arguments on the command-line.
    @@ -2084,7 +2084,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def setModes(self, debug=False, verbose=-1):
         """Sets debug and verbose modes.
    @@ -2117,7 +2117,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def task(self, task, *args, verbose=None):
         """Implements a higher level task.
    @@ -2207,7 +2207,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def validate(self, schema, instances):
         """Validates an instance against a schema.
    @@ -2295,7 +2295,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    class Elements(CheckImport):
         types = set(
    @@ -2832,7 +2832,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    @staticmethod
     def eKey(x):
    @@ -2869,7 +2869,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    @staticmethod
     def repKind(k):
    @@ -2884,7 +2884,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    @staticmethod
     def repMixed(m):
    @@ -2914,7 +2914,7 @@ 

    Parameters

    Expand source code -Browse git +Browse git
    def configure(self, baseSchema, override=None, roots=None):
         """Configure for an XML schema and overrides
    @@ -3059,7 +3059,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getDefs(self, asTsv=False):
         """Delivers the analysis results.
    @@ -3118,7 +3118,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def interpret(self):
         """Reads the XSD and interprets the element definitions.
    @@ -3290,7 +3290,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def resolve(self, definitions):
         """Resolve indirections in the definitions.
    @@ -3359,7 +3359,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def showElems(self):
         """Shows the current state of definitions.
    @@ -3396,7 +3396,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def showOverrides(self):
         """Shows the overriding definitions."""
    @@ -3429,7 +3429,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def writeDefs(self, outputDir):
         """Writes the definitions of the elements to a file.
    diff --git a/tf/volumes/collect.html b/tf/volumes/collect.html
    index fd93c6e9e..9d2977acc 100644
    --- a/tf/volumes/collect.html
    +++ b/tf/volumes/collect.html
    @@ -54,7 +54,7 @@ 

    Usage

    Expand source code -Browse git +Browse git
    """
     # Collect
    @@ -1187,7 +1187,7 @@ 

    Example

    Expand source code -Browse git +Browse git
    def collect(
         volumes,
    diff --git a/tf/volumes/extract.html b/tf/volumes/extract.html
    index e0d95d7d0..56d4ea3e2 100644
    --- a/tf/volumes/extract.html
    +++ b/tf/volumes/extract.html
    @@ -40,7 +40,7 @@ 

    Usage

    Expand source code -Browse git +Browse git
    """
     # Extract
    @@ -949,7 +949,7 @@ 

    Example

    Expand source code -Browse git +Browse git
    def extract(
         workLocation,
    @@ -1625,7 +1625,7 @@ 

    Returns

    Expand source code -Browse git +Browse git
    def getVolumes(volumesLocation):
         """Lists volumes of a work that exist in a given directory.
    diff --git a/tf/volumes/index.html b/tf/volumes/index.html
    index 240e5dd7b..2e30689d6 100644
    --- a/tf/volumes/index.html
    +++ b/tf/volumes/index.html
    @@ -38,7 +38,7 @@ 

    Volume operations

    Expand source code -Browse git +Browse git
    """
     # Volume operations
    diff --git a/tf/writing/arabic.html b/tf/writing/arabic.html
    index 08d20aea8..5de7c2b91 100644
    --- a/tf/writing/arabic.html
    +++ b/tf/writing/arabic.html
    @@ -1019,7 +1019,7 @@ 

    See also

    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/arabic.md
    diff --git a/tf/writing/greek.html b/tf/writing/greek.html
    index 7181a2bd2..2e91bbde0 100644
    --- a/tf/writing/greek.html
    +++ b/tf/writing/greek.html
    @@ -33,7 +33,7 @@ 

    Greek characters

    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/greek.md
    diff --git a/tf/writing/hebrew.html b/tf/writing/hebrew.html
    index 2db390d78..b73cf8045 100644
    --- a/tf/writing/hebrew.html
    +++ b/tf/writing/hebrew.html
    @@ -1243,7 +1243,7 @@ 

    Text-critical

    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/hebrew.md
    diff --git a/tf/writing/index.html b/tf/writing/index.html
    index 4cc38e39e..bc36e8945 100644
    --- a/tf/writing/index.html
    +++ b/tf/writing/index.html
    @@ -79,7 +79,7 @@ 

    Writing systems support

    Expand source code -Browse git +Browse git
    """
     # Writing systems support
    diff --git a/tf/writing/neoaramaic.html b/tf/writing/neoaramaic.html
    index b7be2ca81..50eb39d71 100644
    --- a/tf/writing/neoaramaic.html
    +++ b/tf/writing/neoaramaic.html
    @@ -148,7 +148,7 @@ 

    Consonant phonem
    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/neoaramaic.md
    diff --git a/tf/writing/syriac.html b/tf/writing/syriac.html
    index 732c453d5..76e7a4bc5 100644
    --- a/tf/writing/syriac.html
    +++ b/tf/writing/syriac.html
    @@ -609,7 +609,7 @@ 

    Pericope markers

    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/syriac.md
    diff --git a/tf/writing/transcription.html b/tf/writing/transcription.html
    index d6844e08a..166bf582e 100644
    --- a/tf/writing/transcription.html
    +++ b/tf/writing/transcription.html
    @@ -56,7 +56,7 @@ 

    cld Neo Aramaic

    Expand source code -Browse git +Browse git
    """
     # Transcription
    @@ -1264,7 +1264,7 @@ 

    Classes

    Expand source code -Browse git +Browse git
    class Transcription:
         """Conversion between UNICODE and various transcriptions.
    @@ -2572,7 +2572,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def asciiFromArabic(word):
         return "".join(Transcription.arabicTransAscii.get(x, x) for x in word)
    @@ -2586,7 +2586,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def can_from_syriac(self, word):
         return all(c in self.syriac_mappingi for c in word if c != " ")
    @@ -2600,7 +2600,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def can_to_syriac(self, word):
         return all(
    @@ -2625,7 +2625,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def from_arabic(word):
         """
    @@ -2663,7 +2663,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def from_hebrew(self, word):
         """
    @@ -2703,7 +2703,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def from_syriac(self, word):
         """
    @@ -2741,7 +2741,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def from_ugaritic(word):
         """
    @@ -2772,7 +2772,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def latinFromArabic(word):
         return "".join(Transcription.arabicTransLatin.get(x, x) for x in word)
    @@ -2799,7 +2799,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def ph_simplify(pword):
         """
    @@ -2837,7 +2837,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def quranFromArabic(word):
         return "".join(Transcription.arabicTransQuran.get(x, x) for x in word)
    @@ -2851,7 +2851,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def standardFromArabic(word):
         return "".join(Transcription.arabicTransStandard.get(x, x) for x in word)
    @@ -2884,7 +2884,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def suffix_and_finales(word):
         """
    @@ -2970,7 +2970,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def suppress_space(word):
         """
    @@ -3006,7 +3006,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def sycSplitPunc(self):
         pass
    @@ -3027,7 +3027,7 @@

    Methods

    Expand source code -Browse git +Browse git
    def to_arabic(word):
         """
    @@ -3067,7 +3067,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_etcbc_c(word):
         """
    @@ -3116,7 +3116,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_etcbc_v(word):
         """
    @@ -3156,7 +3156,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_hebrew(word):
         """
    @@ -3198,7 +3198,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_hebrew_c(word):
         """
    @@ -3240,7 +3240,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_hebrew_v(word):
         """
    @@ -3282,7 +3282,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_hebrew_x(word):
         """
    @@ -3322,7 +3322,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_syriac(self, word):
         """
    @@ -3362,7 +3362,7 @@ 

    Methods

    Expand source code -Browse git +Browse git
    def to_ugaritic(word):
         """
    diff --git a/tf/writing/ugaritic.html b/tf/writing/ugaritic.html
    index ab66efc41..849c8552b 100644
    --- a/tf/writing/ugaritic.html
    +++ b/tf/writing/ugaritic.html
    @@ -352,7 +352,7 @@ 

    Letters and word separator

    Expand source code -Browse git +Browse git
    """
     .. include:: ../docs/writing/ugaritic.md
    diff --git a/tf/zip.html b/tf/zip.html
    index eebf869fe..baa6b4ad9 100644
    --- a/tf/zip.html
    +++ b/tf/zip.html
    @@ -31,7 +31,7 @@ 

    Module tf.zip

    Expand source code -Browse git +Browse git
    from .advanced.app import loadApp
     from .core.timestamp import DEEP
    @@ -85,7 +85,7 @@ 

    Functions

    Expand source code -Browse git +Browse git
    def main():
         """Makes a complete zip file.