v2.1 improves Unicode and mixed-script Japanese detection and adds a built-in preference for widely spoken languages on short texts. The public API and default minimum length remain unchanged.
- Now prefers English, Chinese (Mandarin), Hindi, Spanish, and French for short texts. Eligible trigram candidates receive a point bonus through 10 letters, fading to zero at 50 letters. Script routing and candidate restrictions still apply.
- Recognize uppercase Georgian, extended Greek, and supplementary Han letters using Unicode script properties.
- Combine Han and kana when detecting Japanese.
- Exclude digits, punctuation, and emoji from script votes and minimum-length counting; treat them as trigram separators while preserving combining marks.
- Expand regression coverage for short texts and Unicode handling.
Short-text preferences are a heuristic: ambiguous fragments can still be misclassified. Statistical detection still returns undetermined below 10 letters by default.
Full changelog: v2.0.1...v2.1.0