19 using Lucene.Net.Documents;
20 using Lucene.Net.Store;
21 using Lucene.Net.Util;
23 namespace Lucene.Net.Analysis
47 public virtual TokenStream ReusableTokenStream(String fieldName, System.IO.TextReader reader)
53 private bool isDisposed;
59 protected internal virtual object PreviousTokenStream
63 if (tokenStreams == null)
67 return tokenStreams.Get();
71 if (tokenStreams == null)
75 tokenStreams.Set(value);
80 protected internal bool overridesTokenStreamMethod =
false;
92 [Obsolete(
"This is only present to preserve back-compat of classes that subclass a core analyzer and override tokenStream but not reusableTokenStream ")]
93 protected internal virtual void SetOverridesTokenStreamMethod<TClass>()
98 System.Reflection.MethodInfo m = this.GetType().GetMethod(
"TokenStream",
new[] { typeof(
string), typeof(System.IO.TextReader) });
99 overridesTokenStreamMethod = m.DeclaringType != typeof(TClass);
101 catch (MethodAccessException)
104 overridesTokenStreamMethod =
false;
123 public virtual int GetPositionIncrementGap(String fieldName)
151 public virtual void Dispose()
156 protected virtual void Dispose(
bool disposing)
158 if (isDisposed)
return;
162 if (tokenStreams != null)
164 tokenStreams.Close();