public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed) { stemmer = new PorterStemmer(); }
public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed) { stemmer = new PorterStemmer(); termAtt = (TermAttribute)AddAttribute(typeof(TermAttribute)); }
public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed) { stemmer = new PorterStemmer(); termAtt = AddAttribute<ITermAttribute>(); }
public static void Main(System.String[] args) { var s = new PorterStemmer(); for (int i = 0; i < args.Length; i++) { try { System.IO.Stream in_Renamed = new System.IO.FileStream(args[i], System.IO.FileMode.Open, System.IO.FileAccess.Read); var buffer = new byte[1024]; int bufferLen = in_Renamed.Read(buffer, 0, buffer.Length); int offset = 0; s.Reset(); while (true) { int ch; if (offset < bufferLen) ch = buffer[offset++]; else { bufferLen = in_Renamed.Read(buffer, 0, buffer.Length); offset = 0; if (bufferLen < 0) ch = - 1; else ch = buffer[offset++]; } if (Char.IsLetter((char) ch)) { s.Add(Char.ToLower((char) ch)); } else { s.Stem(); Console.Out.Write(s.ToString()); s.Reset(); if (ch < 0) break; else { System.Console.Out.Write((char) ch); } } } in_Renamed.Close(); } catch (System.IO.IOException) { Console.Out.WriteLine("error reading " + args[i]); } } }
public static void Main(System.String[] args) { PorterStemmer s = new PorterStemmer(); for (int i = 0; i < args.Length; i++) { try { System.IO.BinaryReader in_Renamed = new System.IO.BinaryReader(System.IO.File.Open(args[i], System.IO.FileMode.Open, System.IO.FileAccess.Read)); byte[] buffer = new byte[1024]; int bufferLen, offset, ch; bufferLen = in_Renamed.Read(buffer, 0, buffer.Length); offset = 0; s.Reset(); while (true) { if (offset < bufferLen) { ch = buffer[offset++]; } else { bufferLen = in_Renamed.Read(buffer, 0, buffer.Length); offset = 0; if (bufferLen <= 0) { ch = -1; } else { ch = buffer[offset++]; } } if (System.Char.IsLetter((char)ch)) { s.Add(System.Char.ToLower((char)ch)); } else { s.Stem(); System.Console.Out.Write(s.ToString()); s.Reset(); if (ch < 0) { break; } else { System.Console.Out.Write((char)ch); } } } in_Renamed.Close(); } catch (System.IO.IOException) { System.Console.Out.WriteLine("error reading " + args[i]); } } }
public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed) { stemmer = new PorterStemmer(); termAtt = (TermAttribute) AddAttribute(typeof(TermAttribute)); }
public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed) { stemmer = new PorterStemmer(); termAtt = AddAttribute <ITermAttribute>(); }