Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove Stopwords in java

I have a list of stop words which contain around 30 words and a set of articles .

I want to parse each article and remove those stop words from it .

I am not sure what is the most effecient way to do it.

for instance I can loop through stop list and replace the word in article if exist with whitespace but it does not seem good .

Thanks

like image 845
Elham Avatar asked Apr 25 '26 02:04

Elham


1 Answers

  • Put stop words into a java.util.Set
  • Split input into words
  • For each word in input, see if it's contained in the set of stopwords, write to output if not
like image 178
Michael Borgwardt Avatar answered Apr 27 '26 16:04

Michael Borgwardt