Repository navigation
Count all Han ideographs as non-words
This patch release fixes WordCount treating recently assigned Han ideographs as words.
Changes
WordCountnow usesunicode.Is(unicode.Han, r)instead of hard-coded CJK range endpoints, so ideographs assigned after the old boundaries (e.g. U+4D86, U+9FCD, U+2CEB0) are consistently excluded from word counts.- Note: this also excludes a small set of Han iteration marks and compatibility ideographs (e.g. U+3005, U+F900) that were previously counted as words. Valid non-Han Unicode letters are unaffected.
- Added regression tests for the newly covered code points and updated the
WordCountdoc comment.
Thanks @draarivpatel-ui for the report and the fix in #81.