DraftLens engine 1.0.0 uses deterministic rules in your browser. There is no hidden AI model or external document search. These methods describe parts of a text; they do not identify its author or establish misconduct.
Words, sentences, and offsets
Words are Unicode letter or number groups, including internal straight or curly apostrophes. Hyphenated terms count as separate words. Sentence boundaries use the browser’s English Intl.Segmenter; abbreviations and browser versions can affect segmentation. Paragraphs are nonempty blocks separated by a blank line. Character counts and spans use UTF-16 code units, matching JavaScript strings, so an emoji may count as two characters.
Writing patterns
We flag repeated three-word sentence openings, repeated five-word sequences, repeated paragraphs longer than 30 characters, and a small published set of conventional transitions: “in conclusion,” “furthermore,” “moreover,” “it is important to note,” “in today’s world,” and “additionally.” A transition is flagged only when those words are present.
Adjacent sentences are compared using Jaccard overlap of unique normalized words. When both have at least five unique words and overlap is at least 65%, we surface an observation. That threshold is an editing heuristic, not a validated authorship boundary.
Observable repetition is Low with fewer than two repeated-opening/phrase/paragraph findings, Moderate with two to four, and High with five or more. These levels depend on text length and do not measure quality. Under 300 trimmed characters, we show an insufficient-text status instead of a repetition level. No composite authorship score is produced.
Sentence-length variation is the population standard deviation of sentence word counts divided by their mean. It needs at least two sentences. Lexical diversity is unique normalized words divided by total words. Both are length- and genre-sensitive. An intentional refrain can raise repetition; technical consistency can lower vocabulary diversity.
Readability
Flesch Reading Ease = 206.835 − 1.015 × words/sentences − 84.6 × syllables/words.
Flesch–Kincaid Grade = 0.39 × words/sentences + 11.8 × syllables/words − 15.59.
Syllables are approximated using vowel groups and common suffix exclusions. We require 30 words, English function-word evidence, and an ASCII/typographic-punctuation character screen before displaying estimates. That screen can reject valid accented English or accept unsuitable text; it is not language identification. Proper names, abbreviations, lists, and specialist language can distort estimates. We do not clamp extreme values into a misleading “normal” range. Reading time defaults to 200 words per minute and is adjustable in the counter.
Grammar and clarity
Rules flag duplicate words, horizontal spacing, selected punctuation spacing, lowercase sentence starts, lowercase “i,” modal “could/would/should of,” and 20 wordy expressions. Example pairs include “in order to” → “to,” “on a daily basis” → “daily,” and “prior to” → “before.” The complete rule list is inspectable in the source engine. Rules do not provide comprehensive spelling, syntax, or dialect correction.
Double-quoted spans, bracketed text, links, and parenthetical citations containing a year are protected from replacement. This is a limited protective pattern, not a complete quotation or citation parser. Edits are applied individually against current offsets, recomputed after changes, and undoable in memory. Review each edit for meaning.
Text similarity
We compare sets of unique normalized five-word sequences. Jaccard similarity = intersection size / union size × 100. All-stopword sequences from a small local list are excluded. Shared sequences are highlighted in both original passages. Short inputs without five words receive an insufficient-text notice. We do not search the internet, infer semantic paraphrases, inspect private databases, or certify originality.
Citation formatting
Each nonempty line is treated as one reference. APA mode checks basic parenthesized date cues; MLA mode prompts review of title/container cues. Both flag possible duplicate lines, missing dates, author-like openings, and punctuation. Existing DOI strings can be shown in URL form separately; original references and links are unchanged. Source existence and factual claims are not verified. Plain text cannot validate italics or hanging indents.
Validation and changes
Version 1.0.0 introduces the six local tools. Automated fixtures cover Unicode offsets, empty and long inputs, edits and undo, quotation protection, identical/disjoint similarity, citation duplicates, file validation, and browser interactions. Tests establish specified behavior, not scientific detection accuracy. See the repository’s test report for commands and measured outcomes.