KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > text > analyze > StopTable


1 /*
2  * StopTable.java
3  *
4  * Created on 23. Juli 2003, 19:20
5  */

6
7 package org.contineo.core.text.analyze;
8
9 import java.util.Hashtable JavaDoc;
10 /**
11  * This class creates a hashtable filled with stop words.
12  * @author Michael Scholz
13  * @version 1.0
14  */

15 public class StopTable {
16     
17     /**
18      * This method transforms the array of stop words into a hashtable of stop words.
19      * @param stopwords - Array of stop words.
20      */

21     public final static Hashtable JavaDoc setStopWords(String JavaDoc stopwords[]) {
22         Hashtable JavaDoc<String JavaDoc, String JavaDoc> stoptable = new Hashtable JavaDoc<String JavaDoc, String JavaDoc>(stopwords.length);
23         for (int i = 0; i<stopwords.length;i++) {
24             stoptable.put(stopwords[i],stopwords[i]);
25         }
26         return stoptable;
27     }
28     
29 }
30
Popular Tags