Michael Barbarelli wrote:
Can I instantiate a standard analyzer with an argument containing my own
stop words?  If so, how?  Will they be appended to or override the built-in
stop words?

You can do it with one of the alternate constructors, and they'll override the build-in list.

---

String[] MY_WORDS = new String[] {"this", "that", "thing", "thloople"};

StandardAnalyzer a = new StandardAnalyzer(MY_WORDS);

---

There are also constructors that take a Set of strings, a file to take a word list from, or a Reader. If you want the existing words PLUS your own, it shouldn't be too hard...

---

Set words = new HashSet(Arrays.asList(StandardAnalyzer.STOP_WORDS));

words.add("thloople");

StandardAnalyzer a = new StandardAnalyzer(words);

---

or similar.

Cheers,

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to