removeStopwords static method

String removeStopwords(
  1. String input,
  2. String language
)

Implementation

static String removeStopwords(String input, String language) {
  final stopSet = _stopwords[language] ?? {};
  final words = input.split(' ');
  final filtered = words.where((word) => !stopSet.contains(word.toLowerCase()));
  return filtered.join(' ');
}