19 using System.Collections.Generic;
22 using System.Collections;
24 using Lucene.Net.Analysis;
25 using Lucene.Net.Analysis.De;
26 using Lucene.Net.Analysis.Standard;
29 namespace Lucene.Net.Analysis.Cz
49 public static readonly String[] CZECH_STOP_WORDS = {
50 "a",
"s",
"k",
"o",
"i",
"u",
"v",
"z",
"dnes",
"cz",
"t\u00edmto",
"bude\u0161",
"budem",
51 "byli",
"jse\u0161",
"m\u016fj",
"sv\u00fdm",
"ta",
"tomto",
"tohle",
"tuto",
"tyto",
52 "jej",
"zda",
"pro\u010d",
"m\u00e1te",
"tato",
"kam",
"tohoto",
"kdo",
"kte\u0159\u00ed",
53 "mi",
"n\u00e1m",
"tom",
"tomuto",
"m\u00edt",
"nic",
"proto",
"kterou",
"byla",
54 "toho",
"proto\u017ee",
"asi",
"ho",
"na\u0161i",
"napi\u0161te",
"re",
"co\u017e",
"t\u00edm",
55 "tak\u017ee",
"sv\u00fdch",
"jej\u00ed",
"sv\u00fdmi",
"jste",
"aj",
"tu",
"tedy",
"teto",
56 "bylo",
"kde",
"ke",
"prav\u00e9",
"ji",
"nad",
"nejsou",
"\u010di",
"pod",
"t\u00e9ma",
57 "mezi",
"p\u0159es",
"ty",
"pak",
"v\u00e1m",
"ani",
"kdy\u017e",
"v\u0161ak",
"neg",
"jsem",
58 "tento",
"\u010dl\u00e1nku",
"\u010dl\u00e1nky",
"aby",
"jsme",
"p\u0159ed",
"pta",
"jejich",
59 "byl",
"je\u0161t\u011b",
"a\u017e",
"bez",
"tak\u00e9",
"pouze",
"prvn\u00ed",
"va\u0161e",
"kter\u00e1",
60 "n\u00e1s",
"nov\u00fd",
"tipy",
"pokud",
"m\u016f\u017ee",
"strana",
"jeho",
"sv\u00e9",
"jin\u00e9",
61 "zpr\u00e1vy",
"nov\u00e9",
"nen\u00ed",
"v\u00e1s",
"jen",
"podle",
"zde",
"u\u017e",
"b\u00fdt",
"v\u00edce",
62 "bude",
"ji\u017e",
"ne\u017e",
"kter\u00fd",
"by",
"kter\u00e9",
"co",
"nebo",
"ten",
"tak",
63 "m\u00e1",
"p\u0159i",
"od",
"po",
"jsou",
"jak",
"dal\u0161\u00ed",
"ale",
"si",
"se",
"ve",
64 "to",
"jako",
"za",
"zp\u011bt",
"ze",
"do",
"pro",
"je",
"na",
"atd",
"atp",
65 "jakmile",
"p\u0159i\u010dem\u017e",
"j\u00e1",
"on",
"ona",
"ono",
"oni",
"ony",
"my",
"vy",
66 "j\u00ed",
"ji",
"m\u011b",
"mne",
"jemu",
"tomu",
"t\u011bm",
"t\u011bmu",
"n\u011bmu",
"n\u011bmu\u017e",
67 "jeho\u017e",
"j\u00ed\u017e",
"jeliko\u017e",
"je\u017e",
"jako\u017e",
"na\u010de\u017e",
75 return DefaultSetHolder.DEFAULT_SET;
78 private static class DefaultSetHolder {
80 (IEnumerable<string>)CZECH_STOP_WORDS,
false));
87 private ISet<string> stoptable;
88 private readonly
Version matchVersion;
94 : this(matchVersion, DefaultSetHolder.DEFAULT_SET)
108 this.matchVersion = matchVersion;
118 : this(matchVersion,
StopFilter.MakeStopSet( stopwords ))
129 : this(matchVersion, (ISet<string>)stopwords)
151 public void LoadStopWords( Stream wordfile, System.Text.Encoding encoding ) {
152 PreviousTokenStream = null;
153 if ( wordfile == null )
155 stoptable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
160 stoptable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
163 if (encoding == null)
164 isr =
new StreamReader(wordfile);
166 isr =
new StreamReader(wordfile, encoding);
169 }
catch ( IOException) {
172 stoptable = Support.Compatibility.SetFactory.CreateHashSet<
string>();
191 private class SavedStreams {
203 public override TokenStream ReusableTokenStream(String fieldName, TextReader reader)
205 SavedStreams streams = (SavedStreams) PreviousTokenStream;
206 if (streams == null) {
207 streams =
new SavedStreams();
212 streams.result, stoptable);
213 PreviousTokenStream = streams;
215 streams.source.Reset(reader);
217 return streams.result;