word_count 1.0.0 copy "word_count: ^1.0.0" to clipboard
word_count: ^1.0.0 copied to clipboard

A comprehensive multi-language word counting library for Dart supporting 85+ languages including CJK, European, South Asian, African, and Middle Eastern languages.

example/word_count_example.dart

import 'package:word_count/word_count.dart';

void main() {
  // Basic usage examples
  print('English text: ${wordsCount('Hello World')}'); // 2
  print('Chinese text: ${wordsCount('你好,世界')}'); // 4
  print('Mixed text: ${wordsCount('Hello, 你好。')}'); // 3
  
  // Using configuration
  const config = WordCountConfig(punctuationAsBreaker: true);
  print('With punctuation as breaker: ${wordsCount("Google's free service", config)}'); // 3
  
  // Getting word list
  final words = wordsSplit('Hello World');
  print('Words: $words'); // [Hello, World]
  
  // Full detection result
  final result = wordsDetect('Hello World');
  print('Count: ${result.count}, Words: ${result.words}'); // Count: 2, Words: [Hello, World]
}
0
likes
0
points
69
downloads

Publisher

verified publisherwaltertay.com

Weekly Downloads

A comprehensive multi-language word counting library for Dart supporting 85+ languages including CJK, European, South Asian, African, and Middle Eastern languages.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on word_count