Skip to content

Count all Han ideographs as non-words

Choose a tag to compare

@huandu huandu released this 26 Nov 03:52
· 2 commits to master since this release

This patch release fixes WordCount treating recently assigned Han ideographs as words.

Changes

  • WordCount now uses unicode.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 WordCount doc comment.

Thanks @draarivpatel-ui for the report and the fix in #81.