lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/2] lucenenet git commit: More work on Analysis.Common
Date Sat, 30 May 2015 22:20:53 GMT
More work on Analysis.Common


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f47779a7
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f47779a7
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f47779a7

Branch: refs/heads/master
Commit: f47779a7efb30d4ab3cfaa7d7e1bdae5b614fa7f
Parents: 40684b8
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Sun May 31 01:20:39 2015 +0300
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Sun May 31 01:20:39 2015 +0300

----------------------------------------------------------------------
 .../Compound/hyphenation/PatternParser.cs       |   1 +
 .../Analysis/Core/StopAnalyzer.cs               |   2 +-
 .../Analysis/Miscellaneous/PatternAnalyzer.cs   |   2 +-
 .../Miscellaneous/SingleTokenTokenStream.cs     |  39 +-
 .../Miscellaneous/StemmerOverrideFilter.cs      |  51 +--
 .../Analysis/Miscellaneous/TrimFilter.cs        | 159 +++----
 .../Analysis/Miscellaneous/TrimFilterFactory.cs | 110 +++--
 .../Miscellaneous/WordDelimiterIterator.cs      |   9 +-
 .../Pattern/PatternCaptureGroupFilterFactory.cs |  12 +-
 .../Pattern/PatternCaptureGroupTokenFilter.cs   |  20 +-
 .../Payloads/DelimitedPayloadTokenFilter.cs     | 145 +++----
 .../Analysis/Shingle/ShingleFilter.cs           |  36 +-
 .../Analysis/Standard/ClassicTokenizerImpl.cs   |   4 +-
 .../Analysis/Standard/StandardTokenizerImpl.cs  |  26 +-
 .../Standard/StandardTokenizerInterface.cs      | 125 +++---
 .../Analysis/Util/AbstractAnalysisFactory.cs    |  29 +-
 .../Analysis/Util/CharArrayIterator.cs          |  20 +-
 .../Analysis/Util/CharArrayMap.cs               | 419 ++++++++++---------
 .../Analysis/Util/CharArraySet.cs               | 117 +++++-
 .../Analysis/Util/CharacterUtils.cs             |  15 +-
 .../Analysis/Util/StopwordAnalyzerBase.cs       |   2 +-
 src/Lucene.Net.Core/Support/Character.cs        |   2 +
 22 files changed, 686 insertions(+), 659 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
index 383dee2..1d012c4 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
@@ -17,6 +17,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 
 namespace Lucene.Net.Analysis.Compound.Hyphenation

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
index e51dbc1..5c2f34a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Analysis.Core
 	  {
 		IList<string> stopWords = Arrays.AsList("a", "an", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with");
 		var stopSet = new CharArraySet(LuceneVersion.LUCENE_CURRENT, stopWords, false);
-		ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet);
+		ENGLISH_STOP_WORDS_SET = CharArraySet.UnmodifiableSet(stopSet);
 	  }
 
 	  /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
index c20a7c3..6c28927 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
         /// <code>"\\s+"</code>; Divides text at whitespaces (Character.isWhitespace(c)) </summary>
         public static readonly Pattern WHITESPACE_PATTERN = Pattern.compile("\\s+");
 
-        private static readonly CharArraySet EXTENDED_ENGLISH_STOP_WORDS = CharArraySet.unmodifiableSet(new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.asList("a", "about", "above", "across", "adj", "after", "afterwards", "again", "against", "albeit", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anywhere", "are", "around", "as", "at", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "co", "could", "down", "during", "each", "eg", "either", "else", "elsewhere", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "first", "for", "former", "formerly", "from", "further", "had", "has", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", 
 "herself", "him", "himself", "his", "how", "however", "i", "ie", "if", "in", "inc", "indeed", "into", "is", "it", "its", "itself", "last", "latter", "latterly", "least", "less", "ltd", "many", "may", "me", "meanwhile", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "namely", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "per", "perhaps", "rather", "s", "same", "seem", "seemed", "seeming", "seems", "several", "she", "should", "since", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "t", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefor", "therein", "thereupon", "these", "they", "this", "those", "though", "through", "th
 roughout", "thru", "thus", "to", "together", "too", "toward", "towards", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereafter", "whereas", "whereat", "whereby", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "with", "within", "without", "would", "xsubj", "xcal", "xauthor", "xother ", "xnote", "yet", "you", "your", "yours", "yourself", "yourselves"), true));
+        private static readonly CharArraySet EXTENDED_ENGLISH_STOP_WORDS = CharArraySet.UnmodifiableSet(new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.asList("a", "about", "above", "across", "adj", "after", "afterwards", "again", "against", "albeit", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anywhere", "are", "around", "as", "at", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "co", "could", "down", "during", "each", "eg", "either", "else", "elsewhere", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "first", "for", "former", "formerly", "from", "further", "had", "has", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", 
 "herself", "him", "himself", "his", "how", "however", "i", "ie", "if", "in", "inc", "indeed", "into", "is", "it", "its", "itself", "last", "latter", "latterly", "least", "less", "ltd", "many", "may", "me", "meanwhile", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "namely", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "per", "perhaps", "rather", "s", "same", "seem", "seemed", "seeming", "seems", "several", "she", "should", "since", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "t", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefor", "therein", "thereupon", "these", "they", "this", "those", "though", "through", "th
 roughout", "thru", "thus", "to", "together", "too", "toward", "towards", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereafter", "whereas", "whereat", "whereby", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "with", "within", "without", "would", "xsubj", "xcal", "xauthor", "xother ", "xnote", "yet", "you", "your", "yours", "yourself", "yourselves"), true));
 
         /// <summary>
         /// A lower-casing word analyzer with English stop words (can be shared

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
index 435247c..c5b0559 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
@@ -1,6 +1,8 @@
 using System.Diagnostics;
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -19,11 +21,7 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using AttributeImpl = org.apache.lucene.util.AttributeImpl;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-
-	/// <summary>
+    /// <summary>
 	/// A <seealso cref="TokenStream"/> containing a single token.
 	/// </summary>
 	public sealed class SingleTokenTokenStream : TokenStream
@@ -39,13 +37,13 @@ namespace org.apache.lucene.analysis.miscellaneous
 	  {
 
 		Debug.Assert(token != null);
-		this.singleToken = token.clone();
+		this.singleToken = token.Clone();
 
-		tokenAtt = (AttributeImpl) addAttribute(typeof(CharTermAttribute));
-		assert(tokenAtt is Token);
+        tokenAtt = AddAttribute <ICharTermAttribute>();
+		Debug.Assert(tokenAtt is Token);
 	  }
 
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
 		if (exhausted)
 		{
@@ -53,27 +51,22 @@ namespace org.apache.lucene.analysis.miscellaneous
 		}
 		else
 		{
-		  clearAttributes();
-		  singleToken.copyTo(tokenAtt);
+		  ClearAttributes();
+		  singleToken.CopyTo(tokenAtt);
 		  exhausted = true;
 		  return true;
 		}
 	  }
 
-	  public override void reset()
+	  public override void Reset()
 	  {
 		exhausted = false;
 	  }
 
-	  public Token getToken()
-	  {
-		return singleToken.clone();
-	  }
-
-	  public void setToken(Token token)
-	  {
-		this.singleToken = token.clone();
-	  }
+        public Token Token
+        {
+            get { return (Token) singleToken.Clone(); }
+            set { this.singleToken = (Token) value.Clone(); }
+        }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
index 078ff66..a89fbe3 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
@@ -1,6 +1,11 @@
 using System.Collections.Generic;
+using System.IO;
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Support;
+using Lucene.Net.Util;
+using Lucene.Net.Util.Fst;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -19,21 +24,7 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using KeywordAttribute = org.apache.lucene.analysis.tokenattributes.KeywordAttribute;
-	using BytesRef = org.apache.lucene.util.BytesRef;
-	using BytesRefHash = org.apache.lucene.util.BytesRefHash;
-	using CharsRef = org.apache.lucene.util.CharsRef;
-	using IntsRef = org.apache.lucene.util.IntsRef;
-	using UnicodeUtil = org.apache.lucene.util.UnicodeUtil;
-	using ByteSequenceOutputs = org.apache.lucene.util.fst.ByteSequenceOutputs;
-	using FST = org.apache.lucene.util.fst.FST;
-	using Arc = org.apache.lucene.util.fst.FST.Arc;
-	using BytesReader = org.apache.lucene.util.fst.FST.BytesReader;
-
-
-	/// <summary>
+    /// <summary>
 	/// Provides the ability to override any <seealso cref="KeywordAttribute"/> aware stemmer
 	/// with custom dictionary-based stemming.
 	/// </summary>
@@ -41,8 +32,8 @@ namespace org.apache.lucene.analysis.miscellaneous
 	{
 	  private readonly StemmerOverrideMap stemmerOverrideMap;
 
-	  private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly KeywordAttribute keywordAtt = addAttribute(typeof(KeywordAttribute));
+	  private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+	  private readonly IKeywordAttribute keywordAtt = addAttribute(typeof(KeywordAttribute));
 	  private readonly FST.BytesReader fstReader;
 	  private readonly FST.Arc<BytesRef> scratchArc = new FST.Arc<BytesRef>();
 	  private readonly CharsRef spare = new CharsRef();
@@ -55,19 +46,15 @@ namespace org.apache.lucene.analysis.miscellaneous
 	  /// so that they will not be stemmed with stemmers down the chain.
 	  /// </para>
 	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public StemmerOverrideFilter(final org.apache.lucene.analysis.TokenStream input, final StemmerOverrideMap stemmerOverrideMap)
 	  public StemmerOverrideFilter(TokenStream input, StemmerOverrideMap stemmerOverrideMap) : base(input)
 	  {
 		this.stemmerOverrideMap = stemmerOverrideMap;
 		fstReader = stemmerOverrideMap.BytesReader;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
-		if (input.incrementToken())
+		if (input.IncrementToken())
 		{
 		  if (fstReader == null)
 		  {
@@ -76,15 +63,11 @@ namespace org.apache.lucene.analysis.miscellaneous
 		  }
 		  if (!keywordAtt.Keyword) // don't muck with already-keyworded terms
 		  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.util.BytesRef stem = stemmerOverrideMap.get(termAtt.buffer(), termAtt.length(), scratchArc, fstReader);
-			BytesRef stem = stemmerOverrideMap.get(termAtt.buffer(), termAtt.length(), scratchArc, fstReader);
+			BytesRef stem = stemmerOverrideMap.get(termAtt.Buffer(), termAtt.Length, scratchArc, fstReader);
 			if (stem != null)
 			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = spare.chars = termAtt.buffer();
-			  char[] buffer = spare.chars = termAtt.buffer();
-			  UnicodeUtil.UTF8toUTF16(stem.bytes, stem.offset, stem.length, spare);
+			  char[] buffer = spare.chars = termAtt.Buffer();
+			  UnicodeUtil.UTF8toUTF16(stem.Bytes, stem.Offset, stem.Length, spare);
 			  if (spare.chars != buffer)
 			  {
 				termAtt.copyBuffer(spare.chars, spare.offset, spare.length);
@@ -202,17 +185,13 @@ namespace org.apache.lucene.analysis.miscellaneous
 		/// <param name="input"> the input char sequence </param>
 		/// <param name="output"> the stemmer override output char sequence </param>
 		/// <returns> <code>false</code> iff the input has already been added to this builder otherwise <code>true</code>. </returns>
-		public virtual bool add(CharSequence input, CharSequence output)
+		public virtual bool add(ICharSequence input, ICharSequence output)
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int length = input.length();
 		  int length = input.length();
 		  if (ignoreCase)
 		  {
 			// convert on the fly to lowercase
 			charsSpare.grow(length);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = charsSpare.chars;
 			char[] buffer = charsSpare.chars;
 			for (int i = 0; i < length;)
 			{

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
index 6e57cc6..e7732e2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
@@ -16,94 +16,97 @@
  */
 using System;
 using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Analysis.Miscellaneous
 {
     /// <summary>
-	/// Trims leading and trailing whitespace from Tokens in the stream.
-	/// <para>As of Lucene 4.4, this filter does not support updateOffsets=true anymore
-	/// as it can lead to broken token streams.
-	/// </para>
-	/// </summary>
-	public sealed class TrimFilter : TokenFilter
-	{
+    /// Trims leading and trailing whitespace from Tokens in the stream.
+    /// <para>As of Lucene 4.4, this filter does not support updateOffsets=true anymore
+    /// as it can lead to broken token streams.
+    /// </para>
+    /// </summary>
+    public sealed class TrimFilter : TokenFilter
+    {
 
-	  internal readonly bool updateOffsets;
-	  private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly IOffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+        internal readonly bool updateOffsets;
+        private readonly ICharTermAttribute termAtt;
+        private readonly IOffsetAttribute offsetAtt;
 
-	  /// <summary>
-	  /// Create a new <seealso cref="TrimFilter"/>. </summary>
-	  /// <param name="version">       the Lucene match version </param>
-	  /// <param name="in">            the stream to consume </param>
-	  /// <param name="updateOffsets"> whether to update offsets </param>
-	  /// @deprecated Offset updates are not supported anymore as of Lucene 4.4. 
-	  [Obsolete("Offset updates are not supported anymore as of Lucene 4.4.")]
-	  public TrimFilter(Version version, TokenStream @in, bool updateOffsets) : base(@in)
-	  {
-		if (updateOffsets && version.onOrAfter(Version.LUCENE_44))
-		{
-		  throw new System.ArgumentException("updateOffsets=true is not supported anymore as of Lucene 4.4");
-		}
-		this.updateOffsets = updateOffsets;
-	  }
+        /// <summary>
+        /// Create a new <seealso cref="TrimFilter"/>. </summary>
+        /// <param name="version">       the Lucene match version </param>
+        /// <param name="in">            the stream to consume </param>
+        /// <param name="updateOffsets"> whether to update offsets </param>
+        /// @deprecated Offset updates are not supported anymore as of Lucene 4.4. 
+        [Obsolete("Offset updates are not supported anymore as of Lucene 4.4.")]
+        public TrimFilter(LuceneVersion version, TokenStream @in, bool updateOffsets)
+            : base(@in)
+        {
+            if (updateOffsets && version.OnOrAfter(LuceneVersion.LUCENE_44))
+            {
+                throw new System.ArgumentException("updateOffsets=true is not supported anymore as of Lucene 4.4");
+            }
+            termAtt = AddAttribute<ICharTermAttribute>();
+            offsetAtt = AddAttribute<IOffsetAttribute>();
+            this.updateOffsets = updateOffsets;
+        }
 
-	  /// <summary>
-	  /// Create a new <seealso cref="TrimFilter"/> on top of <code>in</code>. </summary>
-	  public TrimFilter(Version version, TokenStream @in) : this(version, @in, false)
-	  {
-	  }
+        /// <summary>
+        /// Create a new <seealso cref="TrimFilter"/> on top of <code>in</code>. </summary>
+        public TrimFilter(LuceneVersion version, TokenStream @in)
+            : this(version, @in, false)
+        {
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
-	  {
-		if (!input.incrementToken())
-		{
-			return false;
-		}
+        public override bool IncrementToken()
+        {
+            if (!input.IncrementToken())
+            {
+                return false;
+            }
 
-		char[] termBuffer = termAtt.buffer();
-		int len = termAtt.length();
-		//TODO: Is this the right behavior or should we return false?  Currently, "  ", returns true, so I think this should
-		//also return true
-		if (len == 0)
-		{
-		  return true;
-		}
-		int start = 0;
-		int end = 0;
-		int endOff = 0;
+            char[] termBuffer = termAtt.Buffer();
+            int len = termAtt.Length;
+            //TODO: Is this the right behavior or should we return false?  Currently, "  ", returns true, so I think this should
+            //also return true
+            if (len == 0)
+            {
+                return true;
+            }
+            int start = 0;
+            int end = 0;
+            int endOff = 0;
 
-		// eat the first characters
-		for (start = 0; start < len && char.IsWhiteSpace(termBuffer[start]); start++)
-		{
-		}
-		// eat the end characters
-		for (end = len; end >= start && char.IsWhiteSpace(termBuffer[end - 1]); end--)
-		{
-		  endOff++;
-		}
-		if (start > 0 || end < len)
-		{
-		  if (start < end)
-		  {
-			termAtt.copyBuffer(termBuffer, start, (end - start));
-		  }
-		  else
-		  {
-			termAtt.setEmpty();
-		  }
-		  if (updateOffsets && len == offsetAtt.endOffset() - offsetAtt.startOffset())
-		  {
-			int newStart = offsetAtt.startOffset() + start;
-			int newEnd = offsetAtt.endOffset() - (start < end ? endOff:0);
-			offsetAtt.setOffset(newStart, newEnd);
-		  }
-		}
+            // eat the first characters
+            for (start = 0; start < len && char.IsWhiteSpace(termBuffer[start]); start++)
+            {
+            }
+            // eat the end characters
+            for (end = len; end >= start && char.IsWhiteSpace(termBuffer[end - 1]); end--)
+            {
+                endOff++;
+            }
+            if (start > 0 || end < len)
+            {
+                if (start < end)
+                {
+                    termAtt.CopyBuffer(termBuffer, start, (end - start));
+                }
+                else
+                {
+                    termAtt.SetEmpty();
+                }
+                if (updateOffsets && len == offsetAtt.EndOffset() - offsetAtt.StartOffset())
+                {
+                    int newStart = offsetAtt.StartOffset() + start;
+                    int newEnd = offsetAtt.EndOffset() - (start < end ? endOff : 0);
+                    offsetAtt.SetOffset(newStart, newEnd);
+                }
+            }
 
-		return true;
-	  }
-	}
+            return true;
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
index 8ed68ac..864003b 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
@@ -1,64 +1,58 @@
 using System.Collections.Generic;
-using Lucene.Net.Analysis.Miscellaneous;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using TokenFilterFactory = TokenFilterFactory;
-
-	/// <summary>
-	/// Factory for <seealso cref="TrimFilter"/>.
-	/// <pre class="prettyprint">
-	/// &lt;fieldType name="text_trm" class="solr.TextField" positionIncrementGap="100"&gt;
-	///   &lt;analyzer&gt;
-	///     &lt;tokenizer class="solr.NGramTokenizerFactory"/&gt;
-	///     &lt;filter class="solr.TrimFilterFactory" /&gt;
-	///   &lt;/analyzer&gt;
-	/// &lt;/fieldType&gt;</pre>
-	/// </summary>
-	/// <seealso cref= TrimFilter </seealso>
-	public class TrimFilterFactory : TokenFilterFactory
-	{
-
-	  protected internal readonly bool updateOffsets;
-
-	  /// <summary>
-	  /// Creates a new TrimFilterFactory </summary>
-	  public TrimFilterFactory(IDictionary<string, string> args) : base(args)
-	  {
-		updateOffsets = getBoolean(args, "updateOffsets", false);
-		if (args.Count > 0)
-		{
-		  throw new System.ArgumentException("Unknown parameters: " + args);
-		}
-	  }
-
-	  public override TrimFilter create(TokenStream input)
-	  {
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @SuppressWarnings("deprecation") final org.apache.lucene.analysis.miscellaneous.TrimFilter filter = new org.apache.lucene.analysis.miscellaneous.TrimFilter(luceneMatchVersion, input, updateOffsets);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-		  TrimFilter filter = new TrimFilter(luceneMatchVersion, input, updateOffsets);
-		return filter;
-	  }
-	}
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Factory for <seealso cref="TrimFilter"/>.
+    /// <pre class="prettyprint">
+    /// &lt;fieldType name="text_trm" class="solr.TextField" positionIncrementGap="100"&gt;
+    ///   &lt;analyzer&gt;
+    ///     &lt;tokenizer class="solr.NGramTokenizerFactory"/&gt;
+    ///     &lt;filter class="solr.TrimFilterFactory" /&gt;
+    ///   &lt;/analyzer&gt;
+    /// &lt;/fieldType&gt;</pre>
+    /// </summary>
+    /// <seealso cref= TrimFilter </seealso>
+    public class TrimFilterFactory : TokenFilterFactory
+    {
+
+        protected internal readonly bool updateOffsets;
+
+        /// <summary>
+        /// Creates a new TrimFilterFactory </summary>
+        public TrimFilterFactory(IDictionary<string, string> args)
+            : base(args)
+        {
+            updateOffsets = getBoolean(args, "updateOffsets", false);
+            if (args.Count > 0)
+            {
+                throw new System.ArgumentException("Unknown parameters: " + args);
+            }
+        }
+
+        public override TokenStream Create(TokenStream input)
+        {
+            var filter = new TrimFilter(luceneMatchVersion, input, updateOffsets);
+            return filter;
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
index e43d407..3fff248 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
@@ -1,7 +1,4 @@
-using Lucene.Net.Analysis.Miscellaneous;
-using Lucene.Net.Support;
-
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -21,10 +18,6 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * limitations under the License.
 	 */
 
-	using org.apache.lucene.analysis.miscellaneous;
-//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
-//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter.*;
-
 	/// <summary>
 	/// A BreakIterator-like API for iterating over subwords in text, according to WordDelimiterFilter rules.
 	/// @lucene.internal

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
index 5b47526..4772417 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
@@ -1,7 +1,7 @@
 using System.Collections.Generic;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.pattern
+namespace Lucene.Net.Analysis.Pattern
 {
 
 	/*
@@ -20,11 +20,7 @@ namespace org.apache.lucene.analysis.pattern
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using TokenFilterFactory = TokenFilterFactory;
-
-	/// <summary>
+    /// <summary>
 	/// Factory for <seealso cref="PatternCaptureGroupTokenFilter"/>. 
 	/// <pre class="prettyprint">
 	/// &lt;fieldType name="text_ptncapturegroup" class="solr.TextField" positionIncrementGap="100"&gt;
@@ -45,7 +41,7 @@ namespace org.apache.lucene.analysis.pattern
 		pattern = getPattern(args, "pattern");
 		preserveOriginal = args.ContainsKey("preserve_original") ? bool.Parse(args["preserve_original"]) : true;
 	  }
-	  public override PatternCaptureGroupTokenFilter create(TokenStream input)
+	  public override TokenStream Create(TokenStream input)
 	  {
 		return new PatternCaptureGroupTokenFilter(input, preserveOriginal, pattern);
 	  }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
index 887b749..689ac8e 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
@@ -1,6 +1,7 @@
 using System.Diagnostics;
+using Lucene.Net.Analysis.Tokenattributes;
 
-namespace org.apache.lucene.analysis.pattern
+namespace Lucene.Net.Analysis.Pattern
 {
 
 	/*
@@ -19,12 +20,7 @@ namespace org.apache.lucene.analysis.pattern
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-	using CharsRef = org.apache.lucene.util.CharsRef;
-
-	/// <summary>
+    /// <summary>
 	/// CaptureGroup uses Java regexes to emit multiple tokens - one for each capture
 	/// group in one or more patterns.
 	/// 
@@ -69,7 +65,7 @@ namespace org.apache.lucene.analysis.pattern
 	public sealed class PatternCaptureGroupTokenFilter : TokenFilter
 	{
 
-	  private readonly CharTermAttribute charTermAttr = addAttribute(typeof(CharTermAttribute));
+	  private readonly ICharTermAttribute charTermAttr = addAttribute(typeof(CharTermAttribute));
 	  private readonly PositionIncrementAttribute posAttr = addAttribute(typeof(PositionIncrementAttribute));
 	  private State state;
 	  private readonly Matcher[] matchers;
@@ -118,11 +114,7 @@ namespace org.apache.lucene.analysis.pattern
 		  {
 			while (currentGroup[i] < groupCounts[i] + 1)
 			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int start = matcher.start(currentGroup[i]);
 			  int start = matcher.start(currentGroup[i]);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int end = matcher.end(currentGroup[i]);
 			  int end = matcher.end(currentGroup[i]);
 			  if (start == end || preserveOriginal && start == 0 && spare.length == end)
 			  {
@@ -176,8 +168,8 @@ namespace org.apache.lucene.analysis.pattern
 
 		char[] buffer = charTermAttr.buffer();
 		int length = charTermAttr.length();
-		spare.copyChars(buffer, 0, length);
-		state = captureState();
+		spare.CopyChars(buffer, 0, length);
+		state = CaptureState();
 
 		for (int i = 0; i < matchers.Length; i++)
 		{

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
index 1c03b4e..e577319 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
@@ -1,82 +1,75 @@
-namespace org.apache.lucene.analysis.payloads
-{
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+using Lucene.Net.Analysis.Tokenattributes;
+using org.apache.lucene.analysis.payloads;
 
-
-	/// <summary>
-	/// Characters before the delimiter are the "token", those after are the payload.
-	/// <p/>
-	/// For example, if the delimiter is '|', then for the string "foo|bar", foo is the token
-	/// and "bar" is a payload.
-	/// <p/>
-	/// Note, you can also include a <seealso cref="org.apache.lucene.analysis.payloads.PayloadEncoder"/> to convert the payload in an appropriate way (from characters to bytes).
-	/// <p/>
-	/// Note make sure your Tokenizer doesn't split on the delimiter, or this won't work
-	/// </summary>
-	/// <seealso cref= PayloadEncoder </seealso>
-	public sealed class DelimitedPayloadTokenFilter : TokenFilter
-	{
-	  public const char DEFAULT_DELIMITER = '|';
-	  private readonly char delimiter;
-	  private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly PayloadAttribute payAtt = addAttribute(typeof(PayloadAttribute));
-	  private readonly PayloadEncoder encoder;
+namespace Lucene.Net.Analysis.Payloads
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Characters before the delimiter are the "token", those after are the payload.
+    /// <p/>
+    /// For example, if the delimiter is '|', then for the string "foo|bar", foo is the token
+    /// and "bar" is a payload.
+    /// <p/>
+    /// Note, you can also include a <seealso cref="org.apache.lucene.analysis.payloads.PayloadEncoder"/> to convert the payload in an appropriate way (from characters to bytes).
+    /// <p/>
+    /// Note make sure your Tokenizer doesn't split on the delimiter, or this won't work
+    /// </summary>
+    /// <seealso cref= PayloadEncoder </seealso>
+    public sealed class DelimitedPayloadTokenFilter : TokenFilter
+    {
+        public const char DEFAULT_DELIMITER = '|';
+        private readonly char delimiter;
+        private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+        private readonly IPayloadAttribute payAtt = addAttribute(typeof(PayloadAttribute));
+        private readonly PayloadEncoder encoder;
 
 
-	  public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder) : base(input)
-	  {
-		this.delimiter = delimiter;
-		this.encoder = encoder;
-	  }
+        public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder)
+            : base(input)
+        {
+            this.delimiter = delimiter;
+            this.encoder = encoder;
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
-	  {
-		if (input.incrementToken())
-		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = termAtt.buffer();
-		  char[] buffer = termAtt.buffer();
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int length = termAtt.length();
-		  int length = termAtt.length();
-		  for (int i = 0; i < length; i++)
-		  {
-			if (buffer[i] == delimiter)
-			{
-			  payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
-			  termAtt.Length = i; // simply set a new length
-			  return true;
-			}
-		  }
-		  // we have not seen the delimiter
-		  payAtt.Payload = null;
-		  return true;
-		}
-		else
-		{
-			return false;
-		}
-	  }
-	}
+        public override bool IncrementToken()
+        {
+            if (input.IncrementToken())
+            {
+                char[] buffer = termAtt.Buffer();
+                int length = termAtt.Length;
+                for (int i = 0; i < length; i++)
+                {
+                    if (buffer[i] == delimiter)
+                    {
+                        payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
+                        termAtt.Length = i; // simply set a new length
+                        return true;
+                    }
+                }
+                // we have not seen the delimiter
+                payAtt.Payload = null;
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
index 9bdc341..a9b7dfd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
+using Lucene.Net.Analysis;
 
 namespace org.apache.lucene.analysis.shingle
 {
@@ -23,14 +25,6 @@ namespace org.apache.lucene.analysis.shingle
 	 */
 
 
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-	using PositionLengthAttribute = org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute;
-	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
-	using AttributeSource = org.apache.lucene.util.AttributeSource;
-
-
 	/// <summary>
 	/// <para>A ShingleFilter constructs shingles (token n-grams) from a token stream.
 	/// In other words, it creates combinations of tokens as a single token.
@@ -329,9 +323,7 @@ namespace org.apache.lucene.analysis.shingle
 		  }
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
 		bool tokenAvailable = false;
 		int builtGramSize = 0;
@@ -407,8 +399,6 @@ namespace org.apache.lucene.analysis.shingle
 	  /// <param name="target"> Where to put the new token; if null, a new instance is created. </param>
 	  /// <returns> On success, the populated token; null otherwise </returns>
 	  /// <exception cref="IOException"> if the input stream has a problem </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private InputWindowToken getNextToken(InputWindowToken target) throws java.io.IOException
 	  private InputWindowToken getNextToken(InputWindowToken target)
 	  {
 		InputWindowToken newTarget = target;
@@ -507,17 +497,15 @@ namespace org.apache.lucene.analysis.shingle
 		return newTarget;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void end() throws java.io.IOException
-	  public override void end()
+	  public override void End()
 	  {
 		if (!exhausted)
 		{
-		  base.end();
+		  base.End();
 		}
 		else
 		{
-		  restoreState(endState);
+		  RestoreState(endState);
 		}
 	  }
 
@@ -530,8 +518,6 @@ namespace org.apache.lucene.analysis.shingle
 	  /// </para>
 	  /// </summary>
 	  /// <exception cref="IOException"> if there's a problem getting the next token </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private void shiftInputWindow() throws java.io.IOException
 	  private void shiftInputWindow()
 	  {
 		InputWindowToken firstToken = null;
@@ -574,11 +560,9 @@ namespace org.apache.lucene.analysis.shingle
 		isOutputHere = false;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void reset() throws java.io.IOException
-	  public override void reset()
+	  public override void Reset()
 	  {
-		base.reset();
+		base.Reset();
 		gramSize.reset();
 		inputWindow.Clear();
 		nextInputStreamToken = null;
@@ -715,8 +699,8 @@ namespace org.apache.lucene.analysis.shingle
 		{
 			this.outerInstance = outerInstance;
 		  this.attSource = attSource;
-		  this.termAtt = attSource.getAttribute(typeof(CharTermAttribute));
-		  this.offsetAtt = attSource.getAttribute(typeof(OffsetAttribute));
+		  this.termAtt = attSource.GetAttribute(typeof(CharTermAttribute));
+		  this.offsetAtt = attSource.GetAttribute(typeof(OffsetAttribute));
 		}
 	  }
 	}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
index f2ad424..0798ff9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Analysis.Standard
 
 	  /// <summary>
 	  /// This character denotes the end of file </summary>
-	  public const int StandardTokenizerInterface_Fields;
+	  //public const int StandardTokenizerInterface_Fields;
 
 	  /// <summary>
 	  /// initial size of the lookahead buffer </summary>
@@ -537,8 +537,6 @@ namespace Lucene.Net.Analysis.Standard
 	  /// </summary>
 	  /// <returns>      the next token </returns>
 	  /// <exception cref="java.io.IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException
 	  public virtual int NextToken
 	  {
 		  get

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
index 44a9bbe..c78982c 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
@@ -1,6 +1,8 @@
 using System;
 /* The following code was generated by JFlex 1.5.1 */
+using System.IO;
 using Lucene.Net.Analysis.Standard;
+using Lucene.Net.Analysis.Tokenattributes;
 
 namespace org.apache.lucene.analysis.standard
 {
@@ -45,7 +47,7 @@ namespace org.apache.lucene.analysis.standard
 
 	  /// <summary>
 	  /// This character denotes the end of file </summary>
-	  public const int StandardTokenizerInterface_Fields;
+	  //public const int StandardTokenizerInterface_Fields;
 
 	  /// <summary>
 	  /// initial size of the lookahead buffer </summary>
@@ -210,7 +212,7 @@ namespace org.apache.lucene.analysis.standard
 
 	  /// <summary>
 	  /// the input device </summary>
-	  private java.io.Reader zzReader;
+	  private TextReader zzReader;
 
 	  /// <summary>
 	  /// the current state of the DFA </summary>
@@ -307,9 +309,9 @@ namespace org.apache.lucene.analysis.standard
 	  /// <summary>
 	  /// Fills CharTermAttribute with the current token text.
 	  /// </summary>
-	  public void getText(CharTermAttribute t)
+	  public void getText(ICharTermAttribute t)
 	  {
-		t.copyBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
+		t.CopyBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
 	  }
 
 
@@ -317,7 +319,7 @@ namespace org.apache.lucene.analysis.standard
 	  /// Creates a new scanner
 	  /// </summary>
 	  /// <param name="in">  the java.io.Reader to read input from. </param>
-	  public StandardTokenizerImpl(java.io.Reader @in)
+	  public StandardTokenizerImpl(TextReader @in)
 	  {
 		this.zzReader = @in;
 	  }
@@ -379,7 +381,7 @@ namespace org.apache.lucene.analysis.standard
 		}
 
 		/* finally: fill the buffer with new input */
-		int numRead = zzReader.read(zzBuffer, zzEndRead, zzBuffer.Length - zzEndRead);
+		int numRead = zzReader.Read(zzBuffer, zzEndRead, zzBuffer.Length - zzEndRead);
 
 		if (numRead > 0)
 		{
@@ -389,8 +391,8 @@ namespace org.apache.lucene.analysis.standard
 		// unlikely but not impossible: read 0 characters, but not at end of stream    
 		if (numRead == 0)
 		{
-		  int c = zzReader.read();
-		  if (c == -1)
+		  int c = zzReader.Read();
+		  if (c <= 0)
 		  {
 			return true;
 		  }
@@ -409,8 +411,6 @@ namespace org.apache.lucene.analysis.standard
 	  /// <summary>
 	  /// Closes the input stream.
 	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public final void yyclose() throws java.io.IOException
 	  public void yyclose()
 	  {
 		zzAtEOF = true; // indicate end of file
@@ -418,7 +418,7 @@ namespace org.apache.lucene.analysis.standard
 
 		if (zzReader != null)
 		{
-		  zzReader.close();
+		  zzReader.Dispose();
 		}
 	  }
 
@@ -434,7 +434,7 @@ namespace org.apache.lucene.analysis.standard
 	  /// Internal scan buffer is resized down to its initial length, if it has grown.
 	  /// </summary>
 	  /// <param name="reader">   the new input stream  </param>
-	  public void yyreset(java.io.Reader reader)
+	  public void yyreset(TextReader reader)
 	  {
 		zzReader = reader;
 		zzAtBOL = true;
@@ -557,8 +557,6 @@ namespace org.apache.lucene.analysis.standard
 	  /// </summary>
 	  /// <returns>      the next token </returns>
 	  /// <exception cref="java.io.IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException
 	  public int NextToken
 	  {
 		  get

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
index ee84322..b066d2f 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
@@ -1,77 +1,76 @@
-namespace org.apache.lucene.analysis.standard
-{
+using System.IO;
+using Lucene.Net.Analysis.Tokenattributes;
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
+namespace Lucene.Net.Analysis.Standard
+{
 
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
 
 
-	/// <summary>
-	/// Internal interface for supporting versioned grammars.
-	/// @lucene.internal 
-	/// </summary>
-	public interface StandardTokenizerInterface
-	{
+    /// <summary>
+    /// Internal interface for supporting versioned grammars.
+    /// @lucene.internal 
+    /// </summary>
+    public interface StandardTokenizerInterface
+    {
 
-	  /// <summary>
-	  /// This character denotes the end of file </summary>
+        /// <summary>
+        /// This character denotes the end of file </summary>
 
-	  /// <summary>
-	  /// Copies the matched text into the CharTermAttribute
-	  /// </summary>
-	  void getText(CharTermAttribute t);
+        /// <summary>
+        /// Copies the matched text into the CharTermAttribute
+        /// </summary>
+        void getText(ICharTermAttribute t);
 
-	  /// <summary>
-	  /// Returns the current position.
-	  /// </summary>
-	  int yychar();
+        /// <summary>
+        /// Returns the current position.
+        /// </summary>
+        int yychar();
 
-	  /// <summary>
-	  /// Resets the scanner to read from a new input stream.
-	  /// Does not close the old reader.
-	  /// 
-	  /// All internal variables are reset, the old input stream 
-	  /// <b>cannot</b> be reused (internal buffer is discarded and lost).
-	  /// Lexical state is set to <tt>ZZ_INITIAL</tt>.
-	  /// </summary>
-	  /// <param name="reader">   the new input stream  </param>
-	  void yyreset(Reader reader);
+        /// <summary>
+        /// Resets the scanner to read from a new input stream.
+        /// Does not close the old reader.
+        /// 
+        /// All internal variables are reset, the old input stream 
+        /// <b>cannot</b> be reused (internal buffer is discarded and lost).
+        /// Lexical state is set to <tt>ZZ_INITIAL</tt>.
+        /// </summary>
+        /// <param name="reader">   the new input stream  </param>
+        void yyreset(TextReader reader);
 
-	  /// <summary>
-	  /// Returns the length of the matched text region.
-	  /// </summary>
-	  int yylength();
+        /// <summary>
+        /// Returns the length of the matched text region.
+        /// </summary>
+        int yylength();
 
-	  /// <summary>
-	  /// Resumes scanning until the next regular expression is matched,
-	  /// the end of input is encountered or an I/O-Error occurs.
-	  /// </summary>
-	  /// <returns>      the next token, <seealso cref="#YYEOF"/> on end of stream </returns>
-	  /// <exception cref="IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException;
-	  int NextToken {get;}
+        /// <summary>
+        /// Resumes scanning until the next regular expression is matched,
+        /// the end of input is encountered or an I/O-Error occurs.
+        /// </summary>
+        /// <returns>      the next token, <seealso cref="#YYEOF"/> on end of stream </returns>
+        /// <exception cref="IOException">  if any I/O-Error occurs </exception>
+        int NextToken { get; }
 
-	}
+    }
 
-	public static class StandardTokenizerInterface_Fields
-	{
-	  public const int YYEOF = -1;
-	}
+    public static class StandardTokenizerInterface_Fields
+    {
+        public const int YYEOF = -1;
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
index 64dde54..27d2531 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
@@ -93,12 +93,13 @@ namespace Lucene.Net.Analysis.Util
         }
 
         public virtual string require(IDictionary<string, string> args, string name)
-        {
-            string s = args.Remove(name);
-            if (s == null)
+        {            
+            string s;
+            if (!args.TryGetValue(name, out s))
             {
                 throw new System.ArgumentException("Configuration Error: missing parameter '" + name + "'");
             }
+            args.Remove(name);
             return s;
         }
         public virtual string require(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
@@ -134,14 +135,12 @@ namespace Lucene.Net.Analysis.Util
                 throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " + allowedValues);
             }
         }
-        public virtual string get(IDictionary<string, string> args, string name)
+        public virtual string get(IDictionary<string, string> args, string name, string defaultVal = null)
         {
-            return args.Remove(name); // defaultVal = null
-        }
-        public virtual string get(IDictionary<string, string> args, string name, string defaultVal)
-        {
-            string s = args.Remove(name);
-            return s == null ? defaultVal : s;
+            string s;
+            if (args.TryGetValue(name, out s))
+                args.Remove(name);
+            return s ?? defaultVal;
         }
         public virtual string get(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
         {
@@ -153,9 +152,10 @@ namespace Lucene.Net.Analysis.Util
         }
         public virtual string get(IDictionary<string, string> args, string name, ICollection<string> allowedValues, string defaultVal, bool caseSensitive)
         {
-            string s = args.Remove(name);
-            if (s == null)
+            string s = null;
+            if (args.TryGetValue(name, out s))
             {
+                args.Remove(name);
                 return defaultVal;
             }
             else
@@ -177,7 +177,8 @@ namespace Lucene.Net.Analysis.Util
                         }
                     }
                 }
-                throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " + allowedValues);
+                throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " +
+                                                   allowedValues);
             }
         }
 
@@ -359,7 +360,7 @@ namespace Lucene.Net.Analysis.Util
             IList<string> result = new List<string>();
             foreach (string file in fileNames.Split("(?<!\\\\),", true))
             {
-                result.Add(file.replaceAll("\\\\(?=,)", ""));
+                result.Add(file.ReplaceAll("\\\\(?=,)", ""));
             }
 
             return result;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
index 1d1c44b..b4f4b96 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
@@ -25,7 +25,7 @@ namespace org.apache.lucene.analysis.util
 	/// A CharacterIterator used internally for use with <seealso cref="BreakIterator"/>
 	/// @lucene.internal
 	/// </summary>
-	public abstract class CharArrayIterator : CharacterIterator
+	public abstract class CharArrayIterator //: CharacterIterator
 	{
 	  private char[] array;
 	  private int start;
@@ -63,8 +63,6 @@ namespace org.apache.lucene.analysis.util
 	  /// <param name="array"> text buffer to examine </param>
 	  /// <param name="start"> offset into buffer </param>
 	  /// <param name="length"> maximum length to examine </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public void setText(final char array[] , int start, int length)
 	  public virtual void setText(char[] array, int start, int length)
 	  {
 		this.array = array;
@@ -74,17 +72,17 @@ namespace org.apache.lucene.analysis.util
 		this.limit = start + length;
 	  }
 
-	  public override char current()
+	  public override char Current()
 	  {
 		return (index == limit) ? DONE : jreBugWorkaround(array[index]);
 	  }
 
 	  protected internal abstract char jreBugWorkaround(char ch);
 
-	  public override char first()
+	  public override char First()
 	  {
 		index = start;
-		return current();
+		return Current();
 	  }
 
 	  public override int BeginIndex
@@ -111,13 +109,13 @@ namespace org.apache.lucene.analysis.util
 		  }
 	  }
 
-	  public override char last()
+	  public override char Last()
 	  {
 		index = (limit == start) ? limit : limit - 1;
 		return current();
 	  }
 
-	  public override char next()
+	  public override char Next()
 	  {
 		if (++index >= limit)
 		{
@@ -130,7 +128,7 @@ namespace org.apache.lucene.analysis.util
 		}
 	  }
 
-	  public override char previous()
+	  public override char Previous()
 	  {
 		if (--index < start)
 		{
@@ -143,7 +141,7 @@ namespace org.apache.lucene.analysis.util
 		}
 	  }
 
-	  public override char setIndex(int position)
+	  public override char SetIndex(int position)
 	  {
 		if (position < BeginIndex || position > EndIndex)
 		{
@@ -153,7 +151,7 @@ namespace org.apache.lucene.analysis.util
 		return current();
 	  }
 
-	  public override CharArrayIterator clone()
+	  public override CharArrayIterator Clone()
 	  {
 		try
 		{


Mime
View raw message