1. Background
A similarity checker does not compare text in the abstract. It compares a representation: character sequences, tokens, word forms, subwords, embeddings, or translated passages. That representation affects both retrieval and what a reviewer can inspect. For similarity checking, language identification is therefore an upstream decision, not a label added after matching.
Language names need stable identifiers. ISO 639-3 specifies three-letter codes for representing language names.1 But a code does not identify the script on a page, decide whether the label applies to a full document or one sentence, or distinguish original prose from a quotation, heading, citation, or code sample.
Script and language are different variables. Unicode defines Script properties for characters and also uses Common and Inherited values for characters such as punctuation, digits, and combining marks.2 Latin script can represent English, Turkish, Vietnamese, Yoruba, and many other languages. Serbian may be written in Cyrillic or Latin. A two-character sequence such as “no” or “da” has too little context for dependable routing.
A single page can combine an English argument, a Spanish quotation, Arabic source titles, romanized names, and programming identifiers. Assigning one language to the whole page loses that structure. Code-switched language identification is treated in research as a separate task, with distinct data and evaluation problems.3
2. Method
This is a design review, not a Silvertext benchmark. The protocol uses early evidence to choose a representation, retains the original offsets, and preserves uncertainty for later review.
Let be a document and a candidate span. The language-ID model returns a distribution over supported labels , rather than only its top label. A routing decision can retain an uncertain state when the leading probability does not clear a chosen threshold.
Here is the recorded transformation selected for a span. It might be a script-aware character n-gram representation, a language-specific segmenter, or a subword model. is a candidate score. It identifies material for a person to inspect. It is not proof that a writer copied another source.
Character-level features are common in language ID because they can work without word dictionaries and tolerate some spelling variation. langid.py, for example, uses multinomial naive Bayes with character n-grams.4 Yet coverage, closely related languages, short strings, and domain shift remain known sources of error.5 A page-level prediction should not silently label every fragment on the page.

| Stage | Input | Output retained | Failure addressed |
|---|---|---|---|
| Unicode and script inspection | Code points and normalization form | Script runs, boundaries, unusual characters | Treating mixed scripts as one uniform stream |
| Span formation | Paragraphs, sentences, script changes | Candidate spans and original offsets | Labeling an entire mixed document at once |
| Language routing | Span text and script evidence | Ranked labels, confidence, uncertain state |
Forcing weak predictions into a language-specific route |
| Comparison preparation | Routed span | Representation and provenance | Comparing units without recording their construction |
Original offsets are essential. A reviewer should be able to see the submitted passage, including its script, punctuation, quotation marks, and surrounding context. Normalized text may help retrieval, but it should not replace the submitted text in the review view.
3. Results
The sources support three engineering conclusions. They do not establish one universal accuracy figure.
First, language ID changes with the setting. Caswell and colleagues describe web-scale challenges including short strings, noisy content, and a long tail of languages that practical tools may not cover well.6 A one-line heading or cited title may have too little text for a useful language prediction. In those cases, a script label and an uncertainty marker can be more informative than a confident-looking language name.
Second, token boundaries are not universal. Unicode Text Segmentation defines default boundaries for grapheme clusters, words, and sentences, while making clear that its default algorithm is not a complete language-specific linguistic analysis.7 Default boundaries are useful for consistent offsets and a baseline retrieval path. They do not guarantee linguistically meaningful words for every language.
For text that commonly separates words with spaces, whitespace-adjacent tokenization can yield readable highlights. Where word segmentation needs additional analysis, character n-grams or a dedicated segmenter may be safer retrieval units. SentencePiece describes a subword approach trained directly from raw sentences without pre-tokenization.8 This reduces dependence on spaces, but still requires evaluation on the relevant language, script, and document genre.
Third, cross-language matching is a separate retrieval route. Potthast and colleagues describe cross-language plagiarism detection as identifying reused content across language boundaries, including translation-based and cross-language retrieval approaches.9 Transliteration is not translation. An Arabic-script title and a romanized form may name the same source with little character overlap. Two translations may express similar meaning with no literal overlap.
| Protocol stage | Sequence value |
|---|---|
| Script inspection | 1 |
| Span language routing | 1 |
| Representation selection | 1 |
| Candidate comparison | 1 |
Illustrative four-stage protocol described in this note. Values indicate sequence only, not measured performance.
4. Interpretation
The comparison unit should be smaller than a full document when the evidence calls for it. Paragraphs are a practical starting point, not a fixed rule. A bibliography, block quotation, footnote, code sample, or bilingual table may need separate handling.
Mixed-language documents need an abstention path. A span may be too short, contain only names and numbers, use an unsupported variety, or produce near-tied labels. The system can retain its script information and use a robust character-level representation. It can also omit that span from a language-specific search route. Both options are easier to audit than forcing an unsupported label.
Preserve route provenance for every candidate: source and target language estimates, normalization applied, representation version, and retrieval route. This makes a surprising result debuggable. It also lets a reviewer distinguish direct phrase overlap from a semantically related passage found through a cross-language route.
Similarity does not answer whether a writer acted improperly. Shared wording can come from quotations, standard terminology, assignment language, translations, or proper citation. The useful outcome is a passage a writer can reread in their own work, then clarify quotation, attribution, or citation where needed.
5. Limitations
This note reports no Silvertext accuracy study. It offers a protocol derived from public sources, not evidence that any classifier, tokenizer, or threshold performs well in a particular institution. Measurement requires labeled documents that reflect the actual languages, scripts, lengths, reference styles, and code-switching patterns a system will encounter.
Coverage is uneven. ISO identifiers cover more languages than most deployed models. A model can also merge regional varieties, historical forms, or closely related languages into broad labels. Evaluation should disclose the label inventory, excluded languages, uncertain cases, and whether scoring is performed per document or per span. Aggregate accuracy can conceal poor behavior on short and underrepresented inputs.5
Tokenization introduces trade-offs. Character n-grams can retrieve useful candidates while producing highlights that are hard to read. Morphological and subword segmentation can improve retrieval in one setting and reduce clarity in another. Cross-language retrieval can increase the candidate set while making false positives harder to explain. Every route needs original-text displays, provenance, and human interpretation.
Finally, unusual script mixtures are not evidence of intent. They may be valid quotations, product codes, source titles, or transcription choices. Script inspection is a reason for careful routing, not a finding about the writer.
References
- 1. International Organization for Standardization, 2007, ISO 639-3:2007, Codes for the representation of names of languages, Part 3: Alpha-3 code for comprehensive coverage of languages, ISO. https://www.iso.org/standard/39536.html
- 2. The Unicode Consortium, 2023, Unicode Standard Annex #24: Unicode Script Property, Unicode Standard Version 15.1, Unicode Consortium. https://www.unicode.org/reports/tr24/tr24-39.html
- 3. Thamar Solorio, Elizabeth Blair, Suraj Maharjan, Steven Bethard, Mona Diab, and Mona T. Farra, 2014, Overview for the First Shared Task on Language Identification in Code-Switched Data, Proceedings of the First Workshop on Computational Approaches to Code Switching, Association for Computational Linguistics. https://aclanthology.org/W14-3907/
- 4. Marco Lui and Timothy Baldwin, 2012, langid.py: An Off-the-shelf Language Identification Tool, Proceedings of the ACL 2012 System Demonstrations, Association for Computational Linguistics, pages 25-30. https://aclanthology.org/P12-3005/
- 5. Tommi Jauhiainen, Marco Lui, Marcos Zampieri, and Timothy Baldwin, 2019, Automatic Language Identification in Texts: A Survey, Journal of Artificial Intelligence Research, volume 65, pages 675-782. https://jair.org/index.php/jair/article/view/11675
- 6. Isaac Caswell, Theresa Breiner, Daan van Esch, and Ankur Bapna, 2020, Language ID in the Wild: Unexpected Challenges on the Path to a Thousand-Language Web Text Corpus, Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics. https://aclanthology.org/2020.acl-main.628/
- 7. The Unicode Consortium, 2023, Unicode Standard Annex #29: Unicode Text Segmentation, Unicode Standard Version 15.1, Unicode Consortium. https://www.unicode.org/reports/tr29/tr29-43.html
- 8. Taku Kudo and John Richardson, 2018, SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Association for Computational Linguistics, pages 66-71. https://aclanthology.org/D18-2012/
- 9. Martin Potthast, Alberto Barrón-Cedeño, Benno Stein, and Paolo Rosso, 2011, Cross-Language Plagiarism Detection, Language Resources and Evaluation, volume 45, issue 1, pages 45-62. https://doi.org/10.1007/s10579-009-9114-z



