23 using System.Collections.Generic;
25 using System.Collections;
26 using Lucene.Net.Analysis.Standard;
27 using Lucene.Net.Support;
30 namespace Lucene.Net.Analysis.Nl
52 public static readonly String[] DUTCH_STOP_WORDS =
54 "de",
"en",
"van",
"ik",
"te",
"dat",
"die",
"in",
"een",
55 "hij",
"het",
"niet",
"zijn",
"is",
"was",
"op",
"aan",
"met",
"als",
"voor",
"had",
56 "er",
"maar",
"om",
"hem",
"dan",
"zou",
"of",
"wat",
"mijn",
"men",
"dit",
"zo",
57 "door",
"over",
"ze",
"zich",
"bij",
"ook",
"tot",
"je",
"mij",
"uit",
"der",
"daar",
58 "haar",
"naar",
"heb",
"hoe",
"heeft",
"hebben",
"deze",
"u",
"want",
"nog",
"zal",
59 "me",
"zij",
"nu",
"ge",
"geen",
"omdat",
"iets",
"worden",
"toch",
"al",
"waren",
60 "veel",
"meer",
"doen",
"toen",
"moet",
"ben",
"zonder",
"kan",
"hun",
"dus",
61 "alles",
"onder",
"ja",
"eens",
"hier",
"wie",
"werd",
"altijd",
"doch",
"wordt",
62 "wezen",
"kunnen",
"ons",
"zelf",
"tegen",
"na",
"reeds",
"wil",
"kon",
"niets",
63 "uw",
"iemand",
"geweest",
"andere"
69 public static ISet<string> getDefaultStopSet()
71 return DefaultSetHolder.DEFAULT_STOP_SET;
74 static class DefaultSetHolder
76 internal static readonly ISet<string> DEFAULT_STOP_SET =
CharArraySet
84 private readonly ISet<string> stoptable;
89 private ISet<string> excltable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
91 private IDictionary<String, String> stemdict =
new HashMap<String, String>();
92 private readonly
Version matchVersion;
100 : this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET)
102 stemdict.Add(
"fiets",
"fiets");
103 stemdict.Add(
"bromfiets",
"bromfiets");
104 stemdict.Add(
"ei",
"eier");
105 stemdict.Add(
"kind",
"kinder");
118 this.matchVersion = matchVersion;
119 SetOverridesTokenStreamMethod<DutchAnalyzer>();
130 : this(matchVersion,
StopFilter.MakeStopSet(stopwords))
142 : this(matchVersion, (ISet<string>)stopwords)
156 SetOverridesTokenStreamMethod<DutchAnalyzer>();
161 catch (IOException e)
164 throw new Exception(
"", e);
166 this.matchVersion = matchVersion;
175 public void SetStemExclusionTable(params
string[] exclusionlist)
178 PreviousTokenStream = null;
185 public void SetStemExclusionTable(ISet<string> exclusionlist)
187 excltable = exclusionlist;
188 PreviousTokenStream = null;
195 public void SetStemExclusionTable(FileInfo exclusionlist)
200 PreviousTokenStream = null;
202 catch (IOException e)
205 throw new Exception(
"", e);
214 public void SetStemDictionary(FileInfo stemdictFile)
219 PreviousTokenStream = null;
221 catch (IOException e)
224 throw new Exception(
string.Empty, e);
260 public override TokenStream ReusableTokenStream(String fieldName, TextReader reader)
262 if (overridesTokenStreamMethod)
270 SavedStreams streams = (SavedStreams)PreviousTokenStream;
273 streams =
new SavedStreams();
277 streams.result, stoptable);
278 streams.result =
new DutchStemFilter(streams.result, excltable, stemdict);
279 PreviousTokenStream = streams;
283 streams.source.Reset(reader);
285 return streams.result;