text

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package text provides text analysis utilities for content extraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountWords

func CountWords(text string) int

CountWords counts words in plain text, handling CJK characters correctly. Each CJK character (Han, Hangul, Hiragana, Katakana) counts as one word. Latin and other scripts are counted by whitespace boundaries. Go's native rune iteration handles supplementary planes (CJK Extension B+) that the TypeScript charCodeAt approach cannot.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL