{#- Text dashboard and shared structural/form/crosstab macros for Tabalyst Insights column pages. Every figure is in a table that reads without JavaScript. -#} {% macro lengths_block(lengths, name, library, chart_key='text-lengths') -%} {% if lengths %}

String lengths

Shortest
{{ lengths.min_length | count }}characters
Longest
{{ lengths.max_length | count }}characters
Mean
{{ lengths.mean_length }}
Median
{{ lengths.median_length }}{% if lengths.fixed %}fixed length{% endif %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The table below holds the same figures.

Lengths({{ lengths.rows | length }}{% if lengths.more %} of {{ lengths.rows | length + lengths.more }}{% endif %} distinct lengths, {{ lengths.count | count }} values)
{% for r in lengths.rows %}{% endfor %}
Length
Values
Share
Cumulative
{{ r.length }}{{ r.count }}{{ r.share }}{{ r.cumulative }}
{% if lengths.more %}

{{ lengths.more | count }} more lengths are in the report JSON.

{% endif %}
{% endif %} {%- endmacro %} {% macro patterns_block(patterns, name, library, chart_key='text-patterns') -%} {% if patterns %}

Patterns

{% for note in patterns.notes %}

{{ note }}

{% endfor %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The table below holds the same figures.

Patterns({{ patterns.rows | length }} patterns, {{ patterns.total_values | count }} values)
{% for r in patterns.rows %}{% endfor %}
Pattern
Family
Occurrences
Share
Distinct
Distinct share
{{ r.render }}{{ r.family }}{{ r.occurrences }}{{ r.share_occ }}{{ r.distinct }}{{ r.share_dist }}
{% endif %} {%- endmacro %} {% macro residuals_block(residuals, name, library, chart_key='text-residuals') -%} {% if residuals %}

Values left out (residuals)

{% if residuals.tables %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The tables below hold the same figures.

{% endif %} {% for tbl in residuals.tables %}
{{ tbl.title }}({{ tbl.occurrences }} occurrences, {{ tbl.distinct }} tracked{% if not tbl.complete %}, bounded{% endif %}) {% if tbl.untracked or tbl.too_long %}

{% if tbl.untracked %}{{ tbl.untracked | count }} occurrences untracked beyond limit. {% endif %}{% if tbl.too_long %}{{ tbl.too_long | count }} occurrences too long to list.{% endif %}

{% endif %} {% if tbl.reasons %}
{% for reason, cnt in tbl.reasons %}{% endfor %}
Reason
Occurrences
{{ reason }}{{ cnt }}
{% endif %} {% if tbl.rows %}
{% for r in tbl.rows %}{% endfor %}
Value
Occurrences
Share
First record
{{ r.value }}{{ r.count }}{{ r.share }}{{ r.first_record }}
{% endif %}
{% endfor %} {% if residuals.detectors %}
Replayed detectors({{ residuals.detectors | length }})
{% for det, elg, m, amb, inv, nm in residuals.detectors %}{% endfor %}
Detector
Eligible
Matched
Ambiguous
Invalid
Not matched
{{ det }}{{ elg }}{{ m }}{{ amb }}{{ inv }}{{ nm }}
{% endif %} {% endif %} {%- endmacro %} {% macro forms_block(forms, name, library, mask_chart_key='text-forms', class_chart_key='text-forms-classes') -%} {% if forms %}
Values
{{ forms.values | count }}
Distinct masks
{% if not forms.complete %}≥ {% endif %}{{ forms.forms | count }}min count {{ forms.min_count }}
Rare masks (< {{ forms.min_count }})
{{ forms.other_forms | count }}{{ forms.other_values }} values ({{ forms.other_share }})

Exposure masks the raw values. Only shape masks and closed detector classes with at least {{ forms.min_count }} occurrences are shown; rarer shapes are grouped together.

{% if forms.masks or forms.classes %} {% if forms.masks %}
Shape masks
{% endif %} {% if forms.classes %}
Classes ({{ forms.detector_label }})
{% endif %}

These charts need JavaScript and a network connection to load {{ library.name }}. The tables below hold the same figures.

{% endif %} {% if forms.masks %}
Shape masks({{ forms.masks | length }} listed)
{% for r in forms.masks %}{% endfor %}
Mask
Values
Share
{{ r.form }}{{ r.count }}{{ r.share }}
{% endif %} {% if forms.classes %}
Classes ({{ forms.detector_label }})({{ forms.classes | length }} listed)
{% for r in forms.classes %}{% endfor %} {% if forms.class_other != '0' %}{% endif %} {% if forms.class_unclassified != '0' %}{% endif %}
Class
Values
Share
{{ r.form }}{{ r.count }}{{ r.share }}
(other classes){{ forms.class_other }}-
(unclassified){{ forms.class_unclassified }}-
{% endif %} {% endif %} {%- endmacro %} {% macro duplicates_block(duplicates, name, library, chart_key='text-values') -%} {% if duplicates %}

Repeated values

Values read
{{ duplicates.values }}
Distinct
{{ duplicates.distinct }}
Repeated distinct
{{ duplicates.repeated_distinct }}{% if duplicates.unique %}all values distinct{% else %}{{ duplicates.redundant }} extra occurrences{% endif %}
{% for note in duplicates.notes %}

{{ note }}

{% endfor %} {% if duplicates.rows %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The table below holds the same figures.

Repeated values({{ duplicates.rows | length }}{% if duplicates.truncated %} top listed{% endif %})
{% for r in duplicates.rows %}{% endfor %}
Value
Occurrences
Extra copies
Share
First record
{{ r.value }}{{ r.count }}{{ r.extra }}{{ r.share }}{{ r.first_record }}
{% endif %} {% endif %} {%- endmacro %} {% macro crosstabs_block(crosstabs, name, library, chart_key='text-crosstab') -%} {% if crosstabs %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The tables below hold the same figures.

0 %}hidden{% endif %}>No comparable rows for this cross-tabulation.

{% for ct in crosstabs %}
{{ ct.category_display }} · {{ ct.feature_label }}({{ ct.counted | count }} of {{ ct.rows | count }} rows, purity {{ ct.purity_forward }})Cramér's V {{ ct.cramers_v }}{% if ct.corrected_v != '-' %} ({{ ct.corrected_v }} corrected){% endif %}{% if ct.association_note %}, {{ ct.association_note }}{% endif %}. Reverse purity {{ ct.purity_reverse }}, baseline {{ ct.baseline }}.{% for label, value in ct.left_out %} {{ label }}: {{ value }}.{% endfor %} {% if ct.table_rows %}
{% for h in ct.class_headers %}{% endfor %} {% for r in ct.table_rows %}{% for c in r.counts %}{% endfor %}{% endfor %}
Category
Rows
Classified
Coverage
Dominant
Purity
{{ h }}
{{ r.label }}{{ r.rows }}{{ r.classified }}{{ r.coverage }}{{ r.dominant }}{{ r.purity }}{{ c }}
{% else %}

No comparable rows for this cross-tabulation.

{% endif %}
{% endfor %} {% endif %} {%- endmacro %} {% macro text_sections(t, library, n_over='02', n_len='03', n_comp='04', n_val='05', n_forms='06', n_rel='07') -%}
{% set chart_note = namespace(shown=false) %} {% if t.has_overview %}

{{ n_over }} / Text overview

Text shape at a glance

Exact figures from the Scan and the second pass.

{% for label, value, sub, attn in t.kpis %}
{{ label }}
{{ value }}{% if sub %}{{ sub }}{% endif %}
{% endfor %}
{% if t.chips %}

{% for label, value in t.chips %}{{ label }} {{ value }}{% endfor %}

{% endif %}
{% endif %} {% if t.has_lengths_section %}

{{ n_len }} / Lengths & patterns

Lengths and structural patterns

Exact length counts and pattern coverage over {{ t.data.name }}.

{% if t.has_charts and not chart_note.shown %}{% set chart_note.shown = true %}

The charts load {{ library.name }} {{ library.version }} from a CDN; no data of the report leaves this page. The tables hold every figure and read without it.

{% endif %} {{ lengths_block(t.lengths, t.data.name, library, 'text-lengths') }} {{ patterns_block(t.patterns, t.data.name, library, 'text-patterns') }}
{% endif %} {% if t.has_composition %} {% set comp = t.composition %}

{{ n_comp }} / Text composition

Words, lines, digits and characters

Structural profile and character distribution of {{ t.data.name }}.

{% if t.has_charts and not chart_note.shown %}{% set chart_note.shown = true %}

The charts load {{ library.name }} {{ library.version }} from a CDN; no data of the report leaves this page. The tables hold every figure and read without it.

{% endif %} {% if comp.has_text_profile %}
Texts
{{ comp.texts }}{{ comp.characters }} chars
Words
{{ comp.words }}{{ comp.mean_words }} avg · {{ comp.word_range }}
Lines
{{ comp.lines }}max {{ comp.max_lines }} · {{ comp.multi_line }} multi-line
Digits
{{ comp.digits }}{{ comp.digit_share }} of characters
{% endif %} {% if comp.has_text_profile %}
{% endif %} {% if comp.has_characters %}
Unicode categories ({{ comp.char_distinct }} distinct chars)
{% endif %}

These charts need JavaScript and a network connection to load {{ library.name }}. The tables below hold the same figures.

{% if comp.word_buckets %}
Words per text({{ comp.word_buckets | length }} buckets)
{% for label, cnt, sh in comp.word_buckets %}{% endfor %}
Words
Texts
Share
{{ label }}{{ cnt }}{{ sh }}
{% endif %} {% if comp.line_buckets %}
Lines per text({{ comp.line_buckets | length }} buckets)
{% for label, cnt, sh in comp.line_buckets %}{% endfor %}
Lines
Texts
Share
{{ label }}{{ cnt }}{{ sh }}
{% endif %} {% if comp.digit_buckets %}
Texts by share of digits({{ comp.digit_buckets | length }} buckets)
{% for label, cnt, sh in comp.digit_buckets %}{% endfor %}
Digit share
Texts
Share
{{ label }}{{ cnt }}{{ sh }}
{% endif %} {% if comp.has_characters %}
Characters and Unicode families({{ comp.char_total }} chars in {{ comp.char_values }} values, {{ comp.char_distinct }} distinct) {% if comp.char_categories %}
{% for label, code, cnt, sh in comp.char_categories %}{% endfor %}
Category
Code
Occurrences
Share
{{ label }}{{ code }}{{ cnt }}{{ sh }}
{% endif %} {% if comp.char_tiles %}
{% for sym, cp, cname, cnt, sh in comp.char_tiles %}{% endfor %}
Symbol
Codepoint
Name
Occurrences
Share
{{ sym }}{{ cp }}{{ cname }}{{ cnt }}{{ sh }}
{% endif %}
{% endif %}
{% endif %} {% if t.has_values %} {% set v = t.values %}

{{ n_val }} / Values & residuals

Top values, repetitions and residuals

Frequent values, long-text fingerprints and values left out by patterns or detectors.

{% if t.has_charts and not chart_note.shown %}{% set chart_note.shown = true %}

The charts load {{ library.name }} {{ library.version }} from a CDN; no data of the report leaves this page. The tables hold every figure and read without it.

{% endif %} {% if v.frequencies %}

Most frequent values

This chart needs JavaScript and a network connection to load {{ library.name }}. The table below holds the same figures.

Top values({{ v.frequencies | length }} of {{ v.frequencies_distinct | count }} distinct, {{ v.frequencies_total | count }} total)
{% for r in v.frequencies %}{% endfor %}
Value
Type
Occurrences
Share
{{ r.value }}{{ r.native_type }}{{ r.count }}{{ r.share }}
{% endif %} {% if v.fingerprints_unique is not none %}

Long-text fingerprints ({{ v.fingerprints_bits }}-bit {{ v.fingerprints_algorithm }})

Values
{{ v.fingerprints_values | count }}
Distinct (fingerprint)
{{ v.fingerprints_distinct | count }}
Repeated texts
{{ v.fingerprints_repeated | count }}{% if v.fingerprints_unique %}all texts distinct{% else %}{{ v.fingerprints_redundant | count }} extra occurrences{% endif %}
{% if v.fingerprints %}

This chart needs JavaScript and a network connection to load {{ library.name }}. The table below holds the same figures.

Repeated digests({{ v.fingerprints | length }}{% if v.fingerprints_truncated %} top listed{% endif %})
{% for r in v.fingerprints %}{% endfor %}
Digest
Occurrences
Share
{{ r.short_digest }}{{ r.count }}{{ r.share }}
{% endif %} {% endif %} {% if not v.frequencies %}{{ duplicates_block(v.duplicates, t.data.name, library, 'text-values') }}{% else %}{{ duplicates_block(v.duplicates, t.data.name, library, 'text-dups') }}{% endif %} {{ residuals_block(v.residuals, t.data.name, library, 'text-residuals') }}
{% endif %} {% if t.has_forms %}

{{ n_forms }} / Sensitive forms

Masked forms and classes

Shape masks and closed detector classes without exposing any raw value.

{% if t.has_charts and not chart_note.shown %}{% set chart_note.shown = true %}

The charts load {{ library.name }} {{ library.version }} from a CDN; no data of the report leaves this page. The tables hold every figure and read without it.

{% endif %} {{ forms_block(t.forms, t.data.name, library) }}
{% endif %} {% if t.has_relations %}

{{ n_rel }} / Category cross-tabs

{{ t.data.name }} across categories

Structural features of {{ t.data.name }} crossed with category columns. Exact counts; shows association, not cause.

{% if t.has_charts and not chart_note.shown %}{% set chart_note.shown = true %}

The charts load {{ library.name }} {{ library.version }} from a CDN; no data of the report leaves this page. The tables hold every figure and read without it.

{% endif %} {{ crosstabs_block(t.crosstabs, t.data.name, library) }}
{% endif %} {%- endmacro %}