예제 #1
0
 public AnalyzerWrapperAnonymousClass2(TestMockAnalyzer outerInstance, ReuseStrategy getReuseStrategy, int positionGap, int offsetGap, Analyzer @delegate)
     : base(getReuseStrategy)
 {
     this.outerInstance = outerInstance;
     this.positionGap   = positionGap;
     this.offsetGap     = offsetGap;
     this.@delegate     = @delegate;
 }
예제 #2
0
 /// <summary>
 /// Creates a new <see cref="AnalyzerWrapper"/> with the given reuse strategy.
 /// <para/>If you want to wrap a single delegate <see cref="Analyzer"/> you can probably
 /// reuse its strategy when instantiating this subclass:
 /// <c>base(innerAnalyzer.Strategy)</c>.
 /// <para/>If you choose different analyzers per field, use
 /// <see cref="Analyzer.PER_FIELD_REUSE_STRATEGY"/>.
 /// </summary>
 /// <seealso cref="Analyzer.Strategy"/>
 protected internal AnalyzerWrapper(ReuseStrategy reuseStrategy)
     : base(reuseStrategy)
 {
 }
예제 #3
0
 /// <summary>
 /// Expert: create a new Analyzer with a custom <seealso cref="ReuseStrategy"/>.
 /// <p>
 /// NOTE: if you just want to reuse on a per-field basis, its easier to
 /// use a subclass of <seealso cref="AnalyzerWrapper"/> such as
 /// <a href="{@docRoot}/../analyzers-common/Lucene.Net.Analysis/miscellaneous/PerFieldAnalyzerWrapper.html">
 /// PerFieldAnalyerWrapper</a> instead.
 /// </summary>
 public Analyzer(ReuseStrategy reuseStrategy)
 {
     this.ReuseStrategy_Renamed = reuseStrategy;
 }
예제 #4
0
 public AnalyzerWrapperAnonymousClass(TestMockAnalyzer outerInstance, ReuseStrategy getReuseStrategy, Analyzer @delegate)
     : base(getReuseStrategy)
 {
     this.outerInstance = outerInstance;
     this.@delegate     = @delegate;
 }
예제 #5
0
 public AnonymousAnalyzer(Func <string, TextReader, TokenStreamComponents> createComponents, Func <string, TextReader, TextReader> initReader, ReuseStrategy reuseStrategy)
     : base(reuseStrategy)
 {
     this.createComponents = createComponents ?? throw new ArgumentNullException(nameof(createComponents));
     this.initReader       = initReader;
 }
예제 #6
0
 /// <summary>
 /// Expert: create a new Analyzer with a custom <see cref="ReuseStrategy"/>.
 /// <para/>
 /// NOTE: if you just want to reuse on a per-field basis, its easier to
 /// use a subclass of <see cref="AnalyzerWrapper"/> such as
 /// <c>Lucene.Net.Analysis.Common.Miscellaneous.PerFieldAnalyzerWrapper</c>
 /// instead.
 /// </summary>
 public Analyzer(ReuseStrategy reuseStrategy)
 {
     this.reuseStrategy = reuseStrategy;
 }
예제 #7
0
 /// <summary>
 /// Creates a new instance with the ability to specify the body of the <see cref="CreateComponents(string, TextReader)"/>
 /// method through the <paramref name="createComponents"/> parameter, the body of the <see cref="InitReader(string, TextReader)"/>
 /// method through the <paramref name="initReader"/> parameter, and allows the use of a <see cref="ReuseStrategy"/>.
 /// Simple example:
 /// <code>
 ///     var analyzer = Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
 ///     {
 ///         Tokenizer source = new FooTokenizer(reader);
 ///         TokenStream filter = new FooFilter(source);
 ///         filter = new BarFilter(filter);
 ///         return new TokenStreamComponents(source, filter);
 ///     }, initReader: (fieldName, reader) =>
 ///     {
 ///         return new HTMLStripCharFilter(reader);
 ///     }, reuseStrategy);
 /// </code>
 /// <para/>
 /// LUCENENET specific
 /// </summary>
 /// <param name="createComponents">
 /// A delegate method that represents (is called by) the <see cref="CreateComponents(string, TextReader)"/>
 /// method. It accepts a <see cref="string"/> fieldName and a <see cref="TextReader"/> reader and
 /// returns the <see cref="TokenStreamComponents"/> for this analyzer.
 /// </param>
 /// <param name="initReader">A delegate method that represents (is called by) the <see cref="InitReader(string, TextReader)"/>
 /// method. It accepts a <see cref="string"/> fieldName and a <see cref="TextReader"/> reader and
 /// returns the <see cref="TextReader"/> that can be modified or wrapped by the <paramref name="initReader"/> method.</param>
 /// <param name="reuseStrategy">A custom <see cref="ReuseStrategy"/> instance.</param>
 /// <returns> A new <see cref="AnonymousAnalyzer"/> instance.</returns>
 public static Analyzer NewAnonymous(Func <string, TextReader, TokenStreamComponents> createComponents, Func <string, TextReader, TextReader> initReader, ReuseStrategy reuseStrategy)
 {
     return(new AnonymousAnalyzer(createComponents, initReader, reuseStrategy));
 }
예제 #8
0
 /// <summary>
 /// Creates a new instance with the ability to specify the body of the <see cref="CreateComponents(string, TextReader)"/>
 /// method through the <paramref name="createComponents"/> parameter and allows the use of a <see cref="ReuseStrategy"/>.
 /// Simple example:
 /// <code>
 ///     var analyzer = Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
 ///     {
 ///         Tokenizer source = new FooTokenizer(reader);
 ///         TokenStream filter = new FooFilter(source);
 ///         filter = new BarFilter(filter);
 ///         return new TokenStreamComponents(source, filter);
 ///     }, reuseStrategy);
 /// </code>
 /// <para/>
 /// LUCENENET specific
 /// </summary>
 /// <param name="createComponents">
 /// An delegate method that represents (is called by) the <see cref="CreateComponents(string, TextReader)"/>
 /// method. It accepts a <see cref="string"/> fieldName and a <see cref="TextReader"/> reader and
 /// returns the <see cref="TokenStreamComponents"/> for this analyzer.
 /// </param>
 /// <param name="reuseStrategy">A custom <see cref="ReuseStrategy"/> instance.</param>
 /// <returns> A new <see cref="AnonymousAnalyzer"/> instance.</returns>
 public static Analyzer NewAnonymous(Func <string, TextReader, TokenStreamComponents> createComponents, ReuseStrategy reuseStrategy)
 {
     return(NewAnonymous(createComponents, null, reuseStrategy));
 }
예제 #9
0
 /// <summary>
 /// Expert: create a new Analyzer with a custom <see cref="ReuseStrategy"/>.
 /// <para/>
 /// NOTE: if you just want to reuse on a per-field basis, its easier to
 /// use a subclass of <see cref="AnalyzerWrapper"/> such as
 /// <c>Lucene.Net.Analysis.Common.Miscellaneous.PerFieldAnalyzerWrapper</c>
 /// instead.
 /// </summary>
 protected Analyzer(ReuseStrategy reuseStrategy) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected)
 {
     this.reuseStrategy = reuseStrategy;
 }
예제 #10
0
 public AnonymousAnalyzer(Func <string, TextReader, TokenStreamComponents> createComponents, ReuseStrategy reuseStrategy)
     : base(reuseStrategy)
 {
     if (createComponents == null)
     {
         throw new ArgumentNullException("createComponents");
     }
     this.createComponents = createComponents;
 }
예제 #11
0
 /// <summary>
 /// Expert: create a new Analyzer with a custom <seealso cref="ReuseStrategy"/>.
 /// <p>
 /// NOTE: if you just want to reuse on a per-field basis, its easier to
 /// use a subclass of <seealso cref="AnalyzerWrapper"/> such as
 /// <a href="{@docRoot}/../analyzers-common/Lucene.Net.Analysis/miscellaneous/PerFieldAnalyzerWrapper.html">
 /// PerFieldAnalyerWrapper</a> instead.
 /// </summary>
 protected Analyzer(ReuseStrategy reuseStrategy)
 {
     this._reuseStrategy = reuseStrategy;
 }