19 using System.Collections;
20 using System.Collections.Generic;
22 using Lucene.Net.Analysis;
23 using Lucene.Net.Analysis.Standard;
33 namespace Lucene.Net.Analysis.BR
41 public static string[] BRAZILIAN_STOP_WORDS = {
42 "a",
"ainda",
"alem",
"ambas",
"ambos",
"antes",
43 "ao",
"aonde",
"aos",
"apos",
"aquele",
"aqueles",
44 "as",
"assim",
"com",
"como",
"contra",
"contudo",
45 "cuja",
"cujas",
"cujo",
"cujos",
"da",
"das",
"de",
46 "dela",
"dele",
"deles",
"demais",
"depois",
"desde",
47 "desta",
"deste",
"dispoe",
"dispoem",
"diversa",
48 "diversas",
"diversos",
"do",
"dos",
"durante",
"e",
49 "ela",
"elas",
"ele",
"eles",
"em",
"entao",
"entre",
50 "essa",
"essas",
"esse",
"esses",
"esta",
"estas",
51 "este",
"estes",
"ha",
"isso",
"isto",
"logo",
"mais",
52 "mas",
"mediante",
"menos",
"mesma",
"mesmas",
"mesmo",
53 "mesmos",
"na",
"nas",
"nao",
"nas",
"nem",
"nesse",
"neste",
54 "nos",
"o",
"os",
"ou",
"outra",
"outras",
"outro",
"outros",
55 "pelas",
"pelas",
"pelo",
"pelos",
"perante",
"pois",
"por",
56 "porque",
"portanto",
"proprio",
"propios",
"quais",
"qual",
57 "qualquer",
"quando",
"quanto",
"que",
"quem",
"quer",
"se",
58 "seja",
"sem",
"sendo",
"seu",
"seus",
"sob",
"sobre",
"sua",
59 "suas",
"tal",
"tambem",
"teu",
"teus",
"toda",
"todas",
61 "todos",
"tua",
"tuas",
"tudo",
"um",
"uma",
"umas",
"uns"
68 public static ISet<string> GetDefaultStopSet()
70 return DefaultSetHolder.DEFAULT_STOP_SET;
73 private static class DefaultSetHolder
75 internal static ISet<string> DEFAULT_STOP_SET =
82 private ISet<string> stoptable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
84 private readonly
Version matchVersion;
90 private ISet<string> excltable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
93 : this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET)
109 this.matchVersion = matchVersion;
122 ISet<string> stemExclusionSet)
123 : this(matchVersion, stopwords)
127 .Copy(stemExclusionSet));
136 : this(matchVersion,
StopFilter.MakeStopSet(stopwords))
147 : this(matchVersion, stopwords.Keys.ToArray())
167 public void SetStemExclusionTable(params
string[] exclusionlist)
170 PreviousTokenStream = null;
178 public void SetStemExclusionTable(IDictionary<string, string> exclusionlist)
180 excltable = Support.Compatibility.SetFactory.CreateHashSet(exclusionlist.Keys);
181 PreviousTokenStream = null;
189 public void SetStemExclusionTable(FileInfo exclusionlist)
192 PreviousTokenStream = null;
213 private class SavedStreams
228 public override TokenStream ReusableTokenStream(String fieldName, TextReader reader)
230 SavedStreams streams = (SavedStreams) PreviousTokenStream;
233 streams =
new SavedStreams();
238 streams.result, stoptable);
240 PreviousTokenStream = streams;
244 streams.source.Reset(reader);
246 return streams.result;