Live demo of the Crushjs WordPress plugins. View on CodeCanyon →

Why reading time is hard for Thai, Khmer, Chinese and Japanese

·

1 min read

Most reading-time plugins count words by splitting text on spaces. That works for English, but many of the world's writing systems do not put spaces between words.

Thai, Khmer, Lao and Burmese write whole phrases without spaces. Chinese and Japanese do not separate words at all. To a space-counting plugin, a long Thai article looks like a handful of very long words, and it reports "1 min read".

Real word segmentation

Crushjs Reading Time uses the ICU word segmentation built into PHP's intl extension, the same technology browsers use to decide where a line may wrap. It knows the dictionaries for these languages and finds actual word boundaries.

On servers without intl, the plugin falls back to a character-based estimate tuned for each script, so the result is still sensible.

See the difference

The other articles on this site are written in Thai, Khmer and Japanese. Compare their reading times on the blog page: each one reflects the real length of the text.


Like what you see?

Future updates and six months of support included. Upload, activate, done.