Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void check(final String input, final String expected) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        private void check(string input, string expected)
        {
            ArabicLetterTokenizer      tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
            PersianNormalizationFilter filter      = new PersianNormalizationFilter(tokenStream);

            assertTokenStreamContents(filter, new string[] { expected });
        }
Пример #2
0
 /// <summary>
 /// Creates
 /// <seealso cref="org.apache.lucene.analysis.Analyzer.TokenStreamComponents"/>
 /// used to tokenize all the text in the provided <seealso cref="Reader"/>.
 /// </summary>
 /// <returns> <seealso cref="org.apache.lucene.analysis.Analyzer.TokenStreamComponents"/>
 ///         built from a <seealso cref="StandardTokenizer"/> filtered with
 ///         <seealso cref="LowerCaseFilter"/>, <seealso cref="ArabicNormalizationFilter"/>,
 ///         <seealso cref="PersianNormalizationFilter"/> and Persian Stop words </returns>
 protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
 {
     //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
     //ORIGINAL LINE: final org.apache.lucene.analysis.Tokenizer source;
     Tokenizer source;
     if (matchVersion.onOrAfter(Version.LUCENE_31))
     {
       source = new StandardTokenizer(matchVersion, reader);
     }
     else
     {
       source = new ArabicLetterTokenizer(matchVersion, reader);
     }
     TokenStream result = new LowerCaseFilter(matchVersion, source);
     result = new ArabicNormalizationFilter(result);
     /* additional persian-specific normalization */
     result = new PersianNormalizationFilter(result);
     /*
      * the order here is important: the stopword list is normalized with the
      * above!
      */
     return new TokenStreamComponents(source, new StopFilter(matchVersion, result, stopwords));
 }
 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: private void check(final String input, final String expected) throws java.io.IOException
 //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
 private void check(string input, string expected)
 {
     ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
     PersianNormalizationFilter filter = new PersianNormalizationFilter(tokenStream);
     assertTokenStreamContents(filter, new string[]{expected});
 }