Document Workflow
Audit text metrics before publishing or comparing drafts
Turn requests for frequency, density, readability, sentiment, or similarity into reproducible contracts, then keep each score subordinate to language, context, and human evidence.
Written and tested by SimpleWebUtilsPublished: Reviewed:
How this workflow was checked
The Text Analysis Workbench check used the exact input from “Audit a repeated three-word phrase without crossing sentence boundaries”. After “Write the decision before choosing the metric” and “Record the counting contract”, we matched the resulting values or file against the documented output and inspected the risks described by “Comparing percentages from different denominators” and “Using readability as a content-quality target”.
The report separated phrase occurrences from eligible three-token windows, honored the NFKC, case, and number rules, and located each repetition without crossing a sentence boundary.
Problem
A request such as “check the keyword density,” “make this a grade-eight article,” or “tell me whether this review is negative” omits the choices that create the number. Characters may mean bytes, code points, or grapheme clusters; words depend on segmentation and case; keyword percentages use incompatible denominators; English readability formulas do not transfer to Korean or Japanese; a lexicon match is not emotion or intent; and normalization can erase a difference that matters. Without a written contract, two correct tools can disagree and an attractive score can replace the question that prompted it.
When to use this
- An editor wants to reduce repetition or compare terminology across two bounded drafts.
- A content review asks for keyword density but has not named token rules, phrase length, overlap, or denominator.
- A team wants an English readability baseline while understanding that formulas do not test comprehension or factual quality.
- Support or research staff need a transparent first pass over obvious English positive and negative words without claiming an AI emotion model.
- Two Unicode strings look alike or different and the decision depends on whether normalization, case, grapheme edits, or word-set overlap is the relevant identity.
Steps
- Step 1
Write the decision before choosing the metric
State what action could follow the result: revise a repeated term, verify a target phrase, compare two English versions, queue comments for human review, or detect whether a normalization policy explains a mismatch. Name the audience and the cost of a false conclusion. If no decision would change, avoid manufacturing a score merely because a tool is available.
- Step 2
Preserve and sanitize the source
Keep an untouched source, a stable version label, and enough context to reproduce the sample. Remove secrets and personal data from the working copy. Local browser processing prevents this tool from uploading text, but copied reports, screenshots, downloads, browser extensions, and later sharing can still expose content. Use Zero-Width Character Remover only after inspecting whether invisible characters are evidence rather than noise.
- Step 3
Record the counting contract
For frequency or density, record the segmentation locale, NFC, NFKC, or no normalization, case sensitivity, number inclusion, minimum token length, whitespace policy, row cap, and exact phrase. Define a character as an Intl.Segmenter grapheme cluster. Define density as overlapping occurrences divided by eligible same-length windows that do not cross filtered tokens, sentence punctuation, or line breaks.
- Step 4
Apply language-specific boundaries
Use the five readability values only for predominantly English passages and retain the sentence, word, letter, estimated-syllable, and complex-word counts beside them. Treat samples below 100 representative words as unstable comparisons. Use lexicon sentiment only for English AFINN evidence, and label its token coverage as coverage rather than confidence. Do not translate or infer missing labels.
- Step 5
Run the bounded analysis and inspect diagnostics
Load the sanitized source in Text Analysis Workbench, set the written options, and run the dedicated Worker. Review every exclusion and transformation notice before the first score. For similarity, verify whether exact match means original text or transformed text, and confirm the grapheme-cell preflight stayed below 12,000,000. For a changed draft, open Diff Checker as well so location and meaning are not replaced by one percentage.
- Step 6
Report evidence, limits, and the human decision separately
Save the source version, options, aggregate counts, complete report, browser date, and interpretation in separate fields. Quote the denominator with density, the formulas with readability, matched terms and coverage with lexicon tendency, and transformation policy with similarity. Then let an editor or domain reviewer decide whether wording, correctness, safety, accessibility, or tone should change. Re-run the same contract after revision rather than moving the target.
Example
Audit a repeated three-word phrase without crossing sentence boundaries
Input
Decision: reduce accidental repetition in an English help article. Contract: English segmentation, NFKC, case-insensitive, numbers excluded, minimum one grapheme, target “local text tools,” overlapping three-token windows, sentence and line boundaries preserved.Output
Report the target occurrence count and eligible three-token window count together, list any normalization or exclusion notices, inspect each occurrence in the source, and revise only when repetition harms clarity rather than chasing a universal percentage.Common mistakes
Starting with a preferred score
Changing normalization, token filters, phrase length, sample boundaries, or formulas until a desired number appears destroys comparability. Freeze the contract before seeing the result and document any later change as a new measurement.
Comparing percentages from different denominators
A phrase occurrence divided by words, phrase windows, sentences, or characters produces different values. Preserve the numerator, denominator, token length, overlap policy, and exclusions instead of copying only the percentage.
Using readability as a content-quality target
Short sentences and simple spellings can improve a formula while removing necessary precision. English readability values do not verify facts, structure, accessibility, translation quality, domain knowledge, or whether the intended audience understands the material.
Using lexicon tendency for moderation or diagnosis
AFINN labels can miss threats without negative words, invert sarcasm, score quoted speech, or misread names and specialist terms. Do not automate moderation, mental-health assessment, employment, credit, safety, or other consequential decisions from this heuristic.
Calling transformed equality source equality
NFKC can fold compatibility characters and case-insensitive comparison can remove case distinctions. A zero edit distance after those options does not establish byte identity, signed-content identity, or forensic equivalence. Preserve the originals and choose the identity appropriate to the decision.
FAQ
Should keyword density have a universal ideal percentage?
No. Search usefulness comes from satisfying intent with accurate, original, navigable content, not hitting one density number. Use a documented density only to locate possible repetition, then read each occurrence in context. Do not add variants or filler to manipulate a target.
Why use grapheme clusters instead of JavaScript string length?
JavaScript length counts UTF-16 code units. A visible character can use a surrogate pair, combining mark, variation selector, skin-tone modifier, or zero-width joiner sequence. Grapheme segmentation better matches user-perceived units, while code-point details preserve technical visibility.
Can I compare English, Korean, and Japanese word frequency?
You can inspect each with an appropriate segmentation locale and identical normalization policy, but tokenization and morphology differ across languages. Raw token frequency is not a cross-language semantic frequency. Record the locale and involve a fluent reviewer for interpretation.
Which readability value should I publish?
Usually publish the underlying writing decision rather than a naked score. If a report needs metrics, include all relevant formula names, the representative English sample, counts, estimator limits, and review date. Avoid presenting a grade estimate as a promise of comprehension.
What does no lexicon signal mean?
It means none of the segmented tokens matched the pinned English AFINN and emoji labels. It does not mean neutral emotion, harmless content, objective language, or absence of sentiment. The text may be non-English, specialized, contextual, indirect, or simply outside the lexicon.
When should I use Diff Checker instead of similarity?
Use Diff Checker when location, inserted wording, removed wording, line structure, or review history matters. Use bounded similarity for an aggregate edit and vocabulary-overlap signal. For large documents, specialized diff or document-comparison systems are more appropriate than quadratic exact edit distance.