Here you can find the source of removeStopWords(String[] tokens, Set
public static String[] removeStopWords(String[] tokens, Set<String> stopWords)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import java.util.Set; public class Main { public static String[] removeStopWords(String[] tokens, Set<String> stopWords) { List<String> res = new ArrayList<String>(); for (String token : tokens) { if (!stopWords.contains(token)) res.add(token);//from www . j a v a2 s.co m } return res.toArray(new String[0]); } public static double[] add(double[] a, double b) { for (int i = 0; i < a.length; i++) { a[i] += b; } return a; } public static double[] add(double[] a, double scale, double[] b) { for (int i = 0; i < a.length; i++) { a[i] += scale * b[i]; } return a; } }