lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [39/62] [abbrv] lucenenet git commit: Deleted obsolete Contrib folder
Date Sat, 01 Apr 2017 01:09:32 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/DictionaryCompoundWordTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/DictionaryCompoundWordTokenFilter.cs b/src/contrib/Analyzers/Compound/DictionaryCompoundWordTokenFilter.cs
deleted file mode 100644
index 37c1aed..0000000
--- a/src/contrib/Analyzers/Compound/DictionaryCompoundWordTokenFilter.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * 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 System;
-using System.Collections.Generic;
-
-namespace Lucene.Net.Analysis.Compound
-{
-    /*
- * A {@link TokenFilter} that decomposes compound words found in many Germanic languages.
- * <p>
- * "Donaudampfschiff" becomes Donau, dampf, schiff so that you can find
- * "Donaudampfschiff" even when you only enter "schiff". 
- *  It uses a brute-force algorithm to achieve this.
- * </p>
- */
-    public class DictionaryCompoundWordTokenFilter : CompoundWordTokenFilterBase
-    {
-        /*
-         * 
-         * @param input the {@link TokenStream} to process
-         * @param dictionary the word dictionary to match against
-         * @param minWordSize only words longer than this get processed
-         * @param minSubwordSize only subwords longer than this get to the output stream
-         * @param maxSubwordSize only subwords shorter than this get to the output stream
-         * @param onlyLongestMatch Add only the longest matching subword to the stream
-         */
-        public DictionaryCompoundWordTokenFilter(TokenStream input, String[] dictionary,
-            int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
-            : base(input, dictionary, minWordSize, minSubwordSize, maxSubwordSize, onlyLongestMatch)
-        {
-
-        }
-
-        /*
-         * 
-         * @param input the {@link TokenStream} to process
-         * @param dictionary the word dictionary to match against
-         */
-        public DictionaryCompoundWordTokenFilter(TokenStream input, String[] dictionary)
-            : base(input, dictionary)
-        {
-
-        }
-
-        /*
-         * 
-         * @param input the {@link TokenStream} to process
-         * @param dictionary the word dictionary to match against. If this is a {@link org.apache.lucene.analysis.CharArraySet CharArraySet} it must have set ignoreCase=false and only contain
-         *        lower case strings. 
-         */
-        public DictionaryCompoundWordTokenFilter(TokenStream input, ISet<string> dictionary)
-            : base(input, dictionary)
-        {
-
-        }
-
-        /*
-         * 
-         * @param input the {@link TokenStream} to process
-         * @param dictionary the word dictionary to match against. If this is a {@link org.apache.lucene.analysis.CharArraySet CharArraySet} it must have set ignoreCase=false and only contain
-         *        lower case strings. 
-         * @param minWordSize only words longer than this get processed
-         * @param minSubwordSize only subwords longer than this get to the output stream
-         * @param maxSubwordSize only subwords shorter than this get to the output stream
-         * @param onlyLongestMatch Add only the longest matching subword to the stream
-         */
-        public DictionaryCompoundWordTokenFilter(TokenStream input, ISet<string> dictionary,
-            int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
-            : base(input, dictionary, minWordSize, minSubwordSize, maxSubwordSize, onlyLongestMatch)
-        {
-
-        }
-
-        protected override void DecomposeInternal(Token token)
-        {
-            // Only words longer than minWordSize get processed
-            if (token.TermLength() < this.minWordSize)
-            {
-                return;
-            }
-
-            char[] lowerCaseTermBuffer = MakeLowerCaseCopy(token.TermBuffer());
-
-            for (int i = 0; i < token.TermLength() - this.minSubwordSize; ++i)
-            {
-                Token longestMatchToken = null;
-                for (int j = this.minSubwordSize - 1; j < this.maxSubwordSize; ++j)
-                {
-                    if (i + j > token.TermLength())
-                    {
-                        break;
-                    }
-                    if (dictionary.Contains(lowerCaseTermBuffer, i, j))
-                    {
-                        if (this.onlyLongestMatch)
-                        {
-                            if (longestMatchToken != null)
-                            {
-                                if (longestMatchToken.TermLength() < j)
-                                {
-                                    longestMatchToken = CreateToken(i, j, token);
-                                }
-                            }
-                            else
-                            {
-                                longestMatchToken = CreateToken(i, j, token);
-                            }
-                        }
-                        else
-                        {
-                            tokens.AddLast(CreateToken(i, j, token));
-                        }
-                    }
-                }
-                if (this.onlyLongestMatch && longestMatchToken != null)
-                {
-                    tokens.AddLast(longestMatchToken);
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/ByteVector.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/ByteVector.cs b/src/contrib/Analyzers/Compound/Hyphenation/ByteVector.cs
deleted file mode 100644
index 6ceaaed..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/ByteVector.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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 System;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-//    ///////
-//     /// This class implements a simple byte vector with access to the underlying
-//     /// array.
-//     /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-//     ////
-
-//    [Serializable]
-//    public class ByteVector
-//    {
-//        ///<summary>
-//        /// Capacity increment size
-//        ///</summary>
-//        private static int DEFAULT_BLOCK_SIZE = 2048;
-
-//        private int blockSize;
-
-//        ///<summary>
-//        /// The encapsulated array
-//        ///</summary>
-//        private byte[] array;
-
-//        ///<summary>
-//        /// Points to next free item
-//        ///</summary>
-//        private int n;
-
-//        public ByteVector()
-//            : this(DEFAULT_BLOCK_SIZE)
-//        {
-
-//        }
-
-//        public ByteVector(int capacity)
-//        {
-//            if (capacity > 0)
-//            {
-//                blockSize = capacity;
-//            }
-//            else
-//            {
-//                blockSize = DEFAULT_BLOCK_SIZE;
-//            }
-//            array = new byte[blockSize];
-//            n = 0;
-//        }
-
-//        public ByteVector(byte[] a)
-//        {
-//            blockSize = DEFAULT_BLOCK_SIZE;
-//            array = a;
-//            n = 0;
-//        }
-
-//        public ByteVector(byte[] a, int capacity)
-//        {
-//            if (capacity > 0)
-//            {
-//                blockSize = capacity;
-//            }
-//            else
-//            {
-//                blockSize = DEFAULT_BLOCK_SIZE;
-//            }
-//            array = a;
-//            n = 0;
-//        }
-
-//        public byte[] GetArray()
-//        {
-//            return array;
-//        }
-
-//        ///<summary>
-//        /// return number of items in array
-//        ///</summary>
-//        public int Length()
-//        {
-//            return n;
-//        }
-
-//        ///<summary>
-//        /// returns current capacity of array
-//        ///</summary>
-//        public int Capacity()
-//        {
-//            return array.Length;
-//        }
-
-//        public void Put(int index, byte val)
-//        {
-//            array[index] = val;
-//        }
-
-//        public byte Get(int index)
-//        {
-//            return array[index];
-//        }
-
-//        ///
-//        /// This is to implement memory allocation in the array. Like malloc().
-//        ///
-//        public int Alloc(int size)
-//        {
-//            int index = n;
-//            int len = array.Length;
-//            if (n + size >= len)
-//            {
-//                byte[] aux = new byte[len + blockSize];
-//                Array.Copy(array, 0, aux, 0, len);
-//                array = aux;
-//            }
-//            n += size;
-//            return index;
-//        }
-
-//        public void TrimToSize()
-//        {
-//            if (n < array.Length)
-//            {
-//                byte[] aux = new byte[n];
-//                Array.Copy(array, 0, aux, 0, n);
-//                array = aux;
-//            }
-//        }
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/CharVector.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/CharVector.cs b/src/contrib/Analyzers/Compound/Hyphenation/CharVector.cs
deleted file mode 100644
index 657d299..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/CharVector.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * 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 System;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-
-//    /// <summary>
-//     /// This class implements a simple char vector with access to the underlying
-//     /// array.
-//     /// 
-//     /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-//    ///</summary>
-
-//    [Serializable]
-//    public class CharVector : ICloneable
-//    {
-
-//        ///<summary>
-//         /// Capacity increment size
-//        ///</summary>
-//        private static readonly int DEFAULT_BLOCK_SIZE = 2048;
-
-//        private int blockSize;
-
-//        ///<summary>
-//        /// The encapsulated array
-//        ///</summary>
-//        private char[] array;
-
-//        /// <summary>
-//        /// Points to next free item
-//        /// </summary>
-//        private int n;
-
-//        public CharVector()
-//            : this(DEFAULT_BLOCK_SIZE)
-//        {
-
-//        }
-
-//        public CharVector(int capacity)
-//        {
-//            if (capacity > 0)
-//            {
-//                blockSize = capacity;
-//            }
-//            else
-//            {
-//                blockSize = DEFAULT_BLOCK_SIZE;
-//            }
-//            array = new char[blockSize];
-//            n = 0;
-//        }
-
-//        public CharVector(char[] a)
-//        {
-//            blockSize = DEFAULT_BLOCK_SIZE;
-//            array = a;
-//            n = a.Length;
-//        }
-
-//        public CharVector(char[] a, int capacity)
-//        {
-//            if (capacity > 0)
-//            {
-//                blockSize = capacity;
-//            }
-//            else
-//            {
-//                blockSize = DEFAULT_BLOCK_SIZE;
-//            }
-//            array = a;
-//            n = a.Length;
-//        }
-
-//        ///<summary>
-//        /// Reset Vector but don't resize or clear elements
-//        ///</summary>
-//        public void Clear()
-//        {
-//            n = 0;
-//        }
-
-//        public Object Clone()
-//        {
-//            CharVector cv = new CharVector((char[]) array.Clone(), blockSize);
-//            cv.n = this.n;
-//            return cv;
-//        }
-
-//        public char[] GetArray()
-//        {
-//            return array;
-//        }
-
-//        ///<summary>
-//        /// return number of items in array
-//        ///</summary>
-//        public int Length()
-//        {
-//            return n;
-//        }
-
-//        ///<summary>
-//        /// returns current capacity of array
-//        ///</summary>
-//        public int Capacity()
-//        {
-//            return array.Length;
-//        }
-
-//        public void Put(int index, char val)
-//        {
-//            array[index] = val;
-//        }
-
-//        public char Get(int index)
-//        {
-//            return array[index];
-//        }
-
-//        public int Alloc(int size)
-//        {
-//            int index = n;
-//            int len = array.Length;
-//            if (n + size >= len)
-//            {
-//                char[] aux = new char[len + blockSize];
-//                Array.Copy(array, 0, aux, 0, len);
-//                array = aux;
-//            }
-//            n += size;
-//            return index;
-//        }
-
-//        public void TrimToSize()
-//        {
-//            if (n < array.Length)
-//            {
-//                char[] aux = new char[n];
-//                Array.Copy(array, 0, aux, 0, n);
-//                array = aux;
-//            }
-//        }
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/Hyphen.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/Hyphen.cs b/src/contrib/Analyzers/Compound/Hyphenation/Hyphen.cs
deleted file mode 100644
index 6bbdd61..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/Hyphen.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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 System;
-//using System.Text;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-
-//    /// <summary>
-//    /// This class represents a hyphen. A 'full' hyphen is made of 3 parts: the
-//    /// pre-break text, post-break text and no-break. If no line-break is generated
-//    /// at this position, the no-break text is used, otherwise, pre-break and
-//    /// post-break are used. Typically, pre-break is equal to the hyphen character
-//    /// and the others are empty. However, this general scheme allows support for
-//    /// cases in some languages where words change spelling if they're split across
-//    /// lines, like german's 'backen' which hyphenates 'bak-ken'. BTW, this comes
-//    /// from TeX.
-//    /// 
-//    /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-//    /// </summary>
-//    [Serializable]
-//    public class Hyphen
-//    {
-//        public String preBreak;
-
-//        public String noBreak;
-
-//        public String postBreak;
-
-//        private Hyphen(String pre, String no, String post)
-//        {
-//            preBreak = pre;
-//            noBreak = no;
-//            postBreak = post;
-//        }
-
-//        private Hyphen(String pre)
-//        {
-//            preBreak = pre;
-//            noBreak = null;
-//            postBreak = null;
-//        }
-
-//        public override string ToString()
-//        {
-//            if (noBreak == null && postBreak == null && preBreak != null
-//                && preBreak.Equals("-"))
-//            {
-//                return "-";
-//            }
-//            StringBuilder res = new StringBuilder("{");
-//            res.Append(preBreak);
-//            res.Append("}{");
-//            res.Append(postBreak);
-//            res.Append("}{");
-//            res.Append(noBreak);
-//            res.Append('}');
-//            return res.ToString();
-//        }
-
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/Hyphenation.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/Hyphenation.cs b/src/contrib/Analyzers/Compound/Hyphenation/Hyphenation.cs
deleted file mode 100644
index ef4c699..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/Hyphenation.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.Compound.Hyphenation
-//{
-//    /// <summary>
-//    /// This class represents a hyphenated word.
-//    /// 
-//    /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
-//    /// </summary>
-//    public class Hyphenation
-//    {
-
-//        private int[] hyphenPoints;
-
-//        ///<summary>
-//        /// number of hyphenation points in word
-//        ///</summary>
-//        private int len;
-
-//        ///<summary>
-//        /// rawWord as made of alternating strings and {@link Hyphen Hyphen} instances
-//        ///</summary>
-//        Hyphenation(int[] points)
-//        {
-//            hyphenPoints = points;
-//        }
-
-//        ///<summary>
-//        /// return the number of hyphenation points in the word
-//        ///</summary>
-//        public int Length()
-//        {
-//            return hyphenPoints.Length;
-//        }
-
-//        ///<summary>
-//        /// return the hyphenation points
-//        ///</summary>
-//        public int[] GetHyphenationPoints()
-//        {
-//            return hyphenPoints;
-//        }
-//    }
-//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/HyphenationException.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/HyphenationException.cs b/src/contrib/Analyzers/Compound/Hyphenation/HyphenationException.cs
deleted file mode 100644
index bd7ebab..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/HyphenationException.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 System;
-//using System.Runtime.Serialization;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-//    [Serializable]
-//    public class HyphenationException : Exception
-//    {
-//        //
-//        // For guidelines regarding the creation of new exception types, see
-//        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
-//        // and
-//        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
-//        //
-
-//        public HyphenationException()
-//        {
-//        }
-
-//        public HyphenationException(string message) : base(message)
-//        {
-//        }
-
-//        public HyphenationException(string message, Exception inner) : base(message, inner)
-//        {
-//        }
-
-//        protected HyphenationException(
-//            SerializationInfo info,
-//            StreamingContext context) : base(info, context)
-//        {
-//        }
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/HyphenationTree.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/HyphenationTree.cs b/src/contrib/Analyzers/Compound/Hyphenation/HyphenationTree.cs
deleted file mode 100644
index ab015ce..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/HyphenationTree.cs
+++ /dev/null
@@ -1,480 +0,0 @@
-////*
-// * 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 System;
-//using System.Collections.Generic;
-//using System.IO;
-//using System.Linq;
-//using System.Text;
-//using Lucene.Net.Support;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-////*
-// * This tree structure stores the hyphenation patterns in an efficient way for
-// * fast lookup. It provides the provides the method to hyphenate a word.
-// * 
-// * This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-// */
-//[Serializable]
-//public class HyphenationTree : TernaryTree, PatternConsumer
-//{
-
-//  private static readonly long serialVersionUID = -7842107987915665573L;
-
-//  /*
-//   * value space: stores the interletter values
-//   */
-//  protected ByteVector vspace;
-
-//  /*
-//   * This map stores hyphenation exceptions
-//   */
-//  protected HashMap<String,ArrayList> stoplist;
-
-//  /*
-//   * This map stores the character classes
-//   */
-//  protected TernaryTree classmap;
-
-//  /*
-//   * Temporary map to store interletter values on pattern loading.
-//   */
-//  [NonSerialized]
-//  private TernaryTree ivalues;
-
-//  public HyphenationTree() {
-//    stoplist = new HashMap<string,ArrayList>(23); // usually a small table
-//    classmap = new TernaryTree();
-//    vspace = new ByteVector();
-//    vspace.Alloc(1); // this reserves index 0, which we don't use
-//  }
-
-//  /*
-//   * Packs the values by storing them in 4 bits, two values into a byte Values
-//   * range is from 0 to 9. We use zero as terminator, so we'll add 1 to the
-//   * value.
-//   * 
-//   * @param values a string of digits from '0' to '9' representing the
-//   *        interletter values.
-//   * @return the index into the vspace array where the packed values are stored.
-//   */
-//  protected int packValues(String values) {
-//    int i, n = values.Length;
-//    int m = (n & 1) == 1 ? (n >> 1) + 2 : (n >> 1) + 1;
-//    int offset = vspace.Alloc(m);
-//    byte[] va = vspace.GetArray();
-//    for (i = 0; i < n; i++) {
-//      int j = i >> 1;
-//      byte v = (byte) ((values[i] - '0' + 1) & 0x0f);
-//      if ((i & 1) == 1) {
-//        va[j + offset] = (byte) (va[j + offset] | v);
-//      } else {
-//        va[j + offset] = (byte) (v << 4); // big endian
-//      }
-//    }
-//    va[m - 1 + offset] = 0; // terminator
-//    return offset;
-//  }
-
-//  protected String unpackValues(int k) {
-//    StringBuilder buf = new StringBuilder();
-//    byte v = vspace.Get(k++);
-//    while (v != 0) {
-//      char c = (char) ((v >>> 4) - 1 + '0');
-//      buf.Append(c);
-//      c = (char) (v & 0x0f);
-//      if (c == 0) {
-//        break;
-//      }
-//      c = (char) (c - 1 + '0');
-//      buf.Append(c);
-//      v = vspace.Get(k++);
-//    }
-//    return buf.ToString();
-//  }
-
-//  /*
-//   * Read hyphenation patterns from an XML file.
-//   * 
-//   * @param f the filename
-//   * @throws HyphenationException In case the parsing fails
-//   */
-//  public void loadPatterns(FileInfo f) 
-//  {
-//    try {
-//      InputSource src = new InputSource(f.toURL().toExternalForm());
-//      loadPatterns(src);
-//    } catch (MalformedURLException e) {
-//      throw new HyphenationException("Error converting the File '" + f
-//          + "' to a URL: " + e.getMessage());
-//    }
-//  }
-
-//  /*
-//   * Read hyphenation patterns from an XML file.
-//   * 
-//   * @param source the InputSource for the file
-//   * @throws HyphenationException In case the parsing fails
-//   */
-//  public void loadPatterns(InputSource source) 
-//  {
-//    PatternParser pp = new PatternParser(this);
-//    ivalues = new TernaryTree();
-
-//    pp.parse(source);
-
-//    // patterns/values should be now in the tree
-//    // let's optimize a bit
-//    trimToSize();
-//    vspace.trimToSize();
-//    classmap.trimToSize();
-
-//    // get rid of the auxiliary map
-//    ivalues = null;
-//  }
-
-//  public String findPattern(String pat) {
-//    int k = super.find(pat);
-//    if (k >= 0) {
-//      return unpackValues(k);
-//    }
-//    return "";
-//  }
-
-//  /*
-//   * String compare, returns 0 if equal or t is a substring of s
-//   */
-//  protected int hstrcmp(char[] s, int si, char[] t, int ti) {
-//    for (; s[si] == t[ti]; si++, ti++) {
-//      if (s[si] == 0) {
-//        return 0;
-//      }
-//    }
-//    if (t[ti] == 0) {
-//      return 0;
-//    }
-//    return s[si] - t[ti];
-//  }
-
-//  protected byte[] getValues(int k) {
-//    StringBuilder buf = new StringBuilder();
-//    byte v = vspace.get(k++);
-//    while (v != 0) {
-//      char c = (char) ((v >>> 4) - 1);
-//      buf.append(c);
-//      c = (char) (v & 0x0f);
-//      if (c == 0) {
-//        break;
-//      }
-//      c = (char) (c - 1);
-//      buf.append(c);
-//      v = vspace.get(k++);
-//    }
-//    byte[] res = new byte[buf.length()];
-//    for (int i = 0; i < res.length; i++) {
-//      res[i] = (byte) buf.charAt(i);
-//    }
-//    return res;
-//  }
-
-//  /*
-//   * <p>
-//   * Search for all possible partial matches of word starting at index an update
-//   * interletter values. In other words, it does something like:
-//   * </p>
-//   * <code>
-//   * for(i=0; i<patterns.length; i++) {
-//   * if ( word.substring(index).startsWidth(patterns[i]) )
-//   * update_interletter_values(patterns[i]);
-//   * }
-//   * </code>
-//   * <p>
-//   * But it is done in an efficient way since the patterns are stored in a
-//   * ternary tree. In fact, this is the whole purpose of having the tree: doing
-//   * this search without having to test every single pattern. The number of
-//   * patterns for languages such as English range from 4000 to 10000. Thus,
-//   * doing thousands of string comparisons for each word to hyphenate would be
-//   * really slow without the tree. The tradeoff is memory, but using a ternary
-//   * tree instead of a trie, almost halves the the memory used by Lout or TeX.
-//   * It's also faster than using a hash table
-//   * </p>
-//   * 
-//   * @param word null terminated word to match
-//   * @param index start index from word
-//   * @param il interletter values array to update
-//   */
-//  protected void searchPatterns(char[] word, int index, byte[] il) {
-//    byte[] values;
-//    int i = index;
-//    char p, q;
-//    char sp = word[i];
-//    p = root;
-
-//    while (p > 0 && p < sc.length) {
-//      if (sc[p] == 0xFFFF) {
-//        if (hstrcmp(word, i, kv.getArray(), lo[p]) == 0) {
-//          values = getValues(eq[p]); // data pointer is in eq[]
-//          int j = index;
-//          for (int k = 0; k < values.length; k++) {
-//            if (j < il.length && values[k] > il[j]) {
-//              il[j] = values[k];
-//            }
-//            j++;
-//          }
-//        }
-//        return;
-//      }
-//      int d = sp - sc[p];
-//      if (d == 0) {
-//        if (sp == 0) {
-//          break;
-//        }
-//        sp = word[++i];
-//        p = eq[p];
-//        q = p;
-
-//        // look for a pattern ending at this position by searching for
-//        // the null char ( splitchar == 0 )
-//        while (q > 0 && q < sc.length) {
-//          if (sc[q] == 0xFFFF) { // stop at compressed branch
-//            break;
-//          }
-//          if (sc[q] == 0) {
-//            values = getValues(eq[q]);
-//            int j = index;
-//            for (int k = 0; k < values.length; k++) {
-//              if (j < il.length && values[k] > il[j]) {
-//                il[j] = values[k];
-//              }
-//              j++;
-//            }
-//            break;
-//          } else {
-//            q = lo[q];
-
-//            /*
-//             * actually the code should be: q = sc[q] < 0 ? hi[q] : lo[q]; but
-//             * java chars are unsigned
-//             */
-//          }
-//        }
-//      } else {
-//        p = d < 0 ? lo[p] : hi[p];
-//      }
-//    }
-//  }
-
-//  /*
-//   * Hyphenate word and return a Hyphenation object.
-//   * 
-//   * @param word the word to be hyphenated
-//   * @param remainCharCount Minimum number of characters allowed before the
-//   *        hyphenation point.
-//   * @param pushCharCount Minimum number of characters allowed after the
-//   *        hyphenation point.
-//   * @return a {@link Hyphenation Hyphenation} object representing the
-//   *         hyphenated word or null if word is not hyphenated.
-//   */
-//  public Hyphenation hyphenate(String word, int remainCharCount,
-//      int pushCharCount) {
-//    char[] w = word.toCharArray();
-//    return hyphenate(w, 0, w.length, remainCharCount, pushCharCount);
-//  }
-
-//  /*
-//   * w = "****nnllllllnnn*****", where n is a non-letter, l is a letter, all n
-//   * may be absent, the first n is at offset, the first l is at offset +
-//   * iIgnoreAtBeginning; word = ".llllll.'\0'***", where all l in w are copied
-//   * into word. In the first part of the routine len = w.length, in the second
-//   * part of the routine len = word.length. Three indices are used: index(w),
-//   * the index in w, index(word), the index in word, letterindex(word), the
-//   * index in the letter part of word. The following relations exist: index(w) =
-//   * offset + i - 1 index(word) = i - iIgnoreAtBeginning letterindex(word) =
-//   * index(word) - 1 (see first loop). It follows that: index(w) - index(word) =
-//   * offset - 1 + iIgnoreAtBeginning index(w) = letterindex(word) + offset +
-//   * iIgnoreAtBeginning
-//   */
-
-//  /*
-//   * Hyphenate word and return an array of hyphenation points.
-//   * 
-//   * @param w char array that contains the word
-//   * @param offset Offset to first character in word
-//   * @param len Length of word
-//   * @param remainCharCount Minimum number of characters allowed before the
-//   *        hyphenation point.
-//   * @param pushCharCount Minimum number of characters allowed after the
-//   *        hyphenation point.
-//   * @return a {@link Hyphenation Hyphenation} object representing the
-//   *         hyphenated word or null if word is not hyphenated.
-//   */
-//  public Hyphenation hyphenate(char[] w, int offset, int len,
-//      int remainCharCount, int pushCharCount) {
-//    int i;
-//    char[] word = new char[len + 3];
-
-//    // normalize word
-//    char[] c = new char[2];
-//    int iIgnoreAtBeginning = 0;
-//    int iLength = len;
-//    boolean bEndOfLetters = false;
-//    for (i = 1; i <= len; i++) {
-//      c[0] = w[offset + i - 1];
-//      int nc = classmap.find(c, 0);
-//      if (nc < 0) { // found a non-letter character ...
-//        if (i == (1 + iIgnoreAtBeginning)) {
-//          // ... before any letter character
-//          iIgnoreAtBeginning++;
-//        } else {
-//          // ... after a letter character
-//          bEndOfLetters = true;
-//        }
-//        iLength--;
-//      } else {
-//        if (!bEndOfLetters) {
-//          word[i - iIgnoreAtBeginning] = (char) nc;
-//        } else {
-//          return null;
-//        }
-//      }
-//    }
-//    len = iLength;
-//    if (len < (remainCharCount + pushCharCount)) {
-//      // word is too short to be hyphenated
-//      return null;
-//    }
-//    int[] result = new int[len + 1];
-//    int k = 0;
-
-//    // check exception list first
-//    String sw = new String(word, 1, len);
-//    if (stoplist.containsKey(sw)) {
-//      // assume only simple hyphens (Hyphen.pre="-", Hyphen.post = Hyphen.no =
-//      // null)
-//      ArrayList hw = stoplist.get(sw);
-//      int j = 0;
-//      for (i = 0; i < hw.size(); i++) {
-//        Object o = hw.get(i);
-//        // j = index(sw) = letterindex(word)?
-//        // result[k] = corresponding index(w)
-//        if (o instanceof String) {
-//          j += ((String) o).length();
-//          if (j >= remainCharCount && j < (len - pushCharCount)) {
-//            result[k++] = j + iIgnoreAtBeginning;
-//          }
-//        }
-//      }
-//    } else {
-//      // use algorithm to get hyphenation points
-//      word[0] = '.'; // word start marker
-//      word[len + 1] = '.'; // word end marker
-//      word[len + 2] = 0; // null terminated
-//      byte[] il = new byte[len + 3]; // initialized to zero
-//      for (i = 0; i < len + 1; i++) {
-//        searchPatterns(word, i, il);
-//      }
-
-//      // hyphenation points are located where interletter value is odd
-//      // i is letterindex(word),
-//      // i + 1 is index(word),
-//      // result[k] = corresponding index(w)
-//      for (i = 0; i < len; i++) {
-//        if (((il[i + 1] & 1) == 1) && i >= remainCharCount
-//            && i <= (len - pushCharCount)) {
-//          result[k++] = i + iIgnoreAtBeginning;
-//        }
-//      }
-//    }
-
-//    if (k > 0) {
-//      // trim result array
-//      int[] res = new int[k+2];
-//      System.arraycopy(result, 0, res, 1, k);
-//      // We add the synthetical hyphenation points
-//      // at the beginning and end of the word
-//      res[0]=0;
-//      res[k+1]=len;
-//      return new Hyphenation(res);
-//    } else {
-//      return null;
-//    }
-//  }
-
-//  /*
-//   * Add a character class to the tree. It is used by
-//   * {@link PatternParser PatternParser} as callback to add character classes.
-//   * Character classes define the valid word characters for hyphenation. If a
-//   * word contains a character not defined in any of the classes, it is not
-//   * hyphenated. It also defines a way to normalize the characters in order to
-//   * compare them with the stored patterns. Usually pattern files use only lower
-//   * case characters, in this case a class for letter 'a', for example, should
-//   * be defined as "aA", the first character being the normalization char.
-//   */
-//  public void AddClass(String chargroup) {
-//    if (chargroup.Length > 0) {
-//      char equivChar = chargroup[0];
-//      char[] key = new char[2];
-//      key[1] = (char)0;
-//      for (int i = 0; i < chargroup.Length; i++) {
-//        key[0] = chargroup[i];
-//        classmap.Insert(key, 0, equivChar);
-//      }
-//    }
-//  }
-
-//  /*
-//   * Add an exception to the tree. It is used by
-//   * {@link PatternParser PatternParser} class as callback to store the
-//   * hyphenation exceptions.
-//   * 
-//   * @param word normalized word
-//   * @param hyphenatedword a vector of alternating strings and
-//   *        {@link Hyphen hyphen} objects.
-//   */
-//  public void AddException(String word, ArrayList hyphenatedword) {
-//    stoplist.Add(word, hyphenatedword);
-//  }
-
-//  /*
-//   * Add a pattern to the tree. Mainly, to be used by
-//   * {@link PatternParser PatternParser} class as callback to add a pattern to
-//   * the tree.
-//   * 
-//   * @param pattern the hyphenation pattern
-//   * @param ivalue interletter weight values indicating the desirability and
-//   *        priority of hyphenating at a given point within the pattern. It
-//   *        should contain only digit characters. (i.e. '0' to '9').
-//   */
-//  public void AddPattern(String pattern, String ivalue) {
-//    int k = ivalues.Find(ivalue);
-//    if (k <= 0) {
-//      k = packValues(ivalue);
-//      ivalues.Insert(ivalue, (char)k);
-//    }
-//    Insert(pattern, (char) k);
-//  }
-
-//  public override void PrintStats() {
-//    Console.WriteLine("Value space size = " + vspace.Length());
-//    base.PrintStats();
-
-//  }
-//}
-
-//}
-

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/PatternConsumer.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/PatternConsumer.cs b/src/contrib/Analyzers/Compound/Hyphenation/PatternConsumer.cs
deleted file mode 100644
index 1f92e0d..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/PatternConsumer.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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 System;
-//using System.Collections;
-
-//namespace Lucene.Net.Analyzers.Compound.Hyphenation
-//{
-// /*
-// * This interface is used to connect the XML pattern file parser to the
-// * hyphenation tree.
-// * 
-// * This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
-// */
-//public interface PatternConsumer {
-
-//  /*
-//   * Add a character class. A character class defines characters that are
-//   * considered equivalent for the purpose of hyphenation (e.g. "aA"). It
-//   * usually means to ignore case.
-//   * 
-//   * @param chargroup character group
-//   */
-//  void AddClass(string chargroup);
-
-//  /*
-//   * Add a hyphenation exception. An exception replaces the result obtained by
-//   * the algorithm for cases for which this fails or the user wants to provide
-//   * his own hyphenation. A hyphenatedword is a vector of alternating String's
-//   * and {@link Hyphen Hyphen} instances
-//   */
-//  void AddException(string word, ArrayList hyphenatedword);
-
-//  /*
-//   * Add hyphenation patterns.
-//   * 
-//   * @param pattern the pattern
-//   * @param values interletter values expressed as a string of digit characters.
-//   */
-//  void AddPattern(string pattern, string values);
-
-//}
-
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/PatternParser.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/PatternParser.cs b/src/contrib/Analyzers/Compound/Hyphenation/PatternParser.cs
deleted file mode 100644
index 28fa1c0..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/PatternParser.cs
+++ /dev/null
@@ -1,495 +0,0 @@
-//using System;
-//using System.Collections;
-//using System.Collections.Generic;
-//using System.IO;
-//using System.Linq;
-//using System.Text;
-//using Lucene.Net.Analysis.Compound.Hyphenation;
-
-//namespace Lucene.Net.Analyzers.Compound.Hyphenation
-//{
-// /*
-// * A SAX document handler to read and parse hyphenation patterns from a XML
-// * file.
-// * 
-// * This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-// */
-//public class PatternParser : DefaultHandler, PatternConsumer {
-
-//  XMLReader parser;
-
-//  int currElement;
-
-//  PatternConsumer consumer;
-
-//  StringBuilder token;
-
-//  ArrayList exception;
-
-//  char hyphenChar;
-
-//  String errMsg;
-
-//  static readonly int ELEM_CLASSES = 1;
-
-//  static readonly int ELEM_EXCEPTIONS = 2;
-
-//  static readonly int ELEM_PATTERNS = 3;
-
-//  static readonly int ELEM_HYPHEN = 4;
-
-//  public PatternParser() 
-//  {
-//    token = new StringBuilder();
-//    parser = CreateParser();
-//    parser.SetContentHandler(this);
-//    parser.SetErrorHandler(this);
-//    parser.SetEntityResolver(this);
-//    hyphenChar = '-'; // default
-
-//  }
-
-//  public PatternParser(PatternConsumer consumer)
-//      : this()
-//  {
-//    this.consumer = consumer;
-//  }
-
-//  public void setConsumer(PatternConsumer consumer) {
-//    this.consumer = consumer;
-//  }
-
-//  /*
-//   * Parses a hyphenation pattern file.
-//   * 
-//   * @param filename the filename
-//   * @throws HyphenationException In case of an exception while parsing
-//   */
-//  public void parse(String filename) 
-//  {
-//    parse(new FileInfo(filename));
-//  }
-
-//  /*
-//   * Parses a hyphenation pattern file.
-//   * 
-//   * @param file the pattern file
-//   * @throws HyphenationException In case of an exception while parsing
-//   */
-//  public void parse(FileInfo file) 
-//  {
-//    try {
-//      InputSource src = new InputSource(file.toURL().toExternalForm());
-//      parse(src);
-//    } catch (MalformedURLException e) {
-//      throw new HyphenationException("Error converting the File '" + file
-//          + "' to a URL: " + e.GetMessage());
-//    }
-//  }
-
-//  /*
-//   * Parses a hyphenation pattern file.
-//   * 
-//   * @param source the InputSource for the file
-//   * @throws HyphenationException In case of an exception while parsing
-//   */
-//  public void parse(InputSource source) 
-//  {
-//    try {
-//      parser.parse(source);
-//    } catch (FileNotFoundException fnfe) {
-//      throw new HyphenationException("File not found: " + fnfe.GetMessage());
-//    } catch (IOException ioe) {
-//      throw new HyphenationException(ioe.GetMessage());
-//    } catch (SAXException e) {
-//      throw new HyphenationException(errMsg);
-//    }
-//  }
-
-//  /*
-//   * Creates a SAX parser using JAXP
-//   * 
-//   * @return the created SAX parser
-//   */
-//  static XMLReader createParser() {
-//    try {
-//      SAXParserFactory factory = SAXParserFactory.newInstance();
-//      factory.SetNamespaceAware(true);
-//      return factory.newSAXParser().GetXMLReader();
-//    } catch (Exception e) {
-//      throw new RuntimeException("Couldn't create XMLReader: " + e.GetMessage());
-//    }
-//  }
-
-//  protected String readToken(StringBuffer chars) {
-//    String word;
-//    bool space = false;
-//    int i;
-//    for (i = 0; i < chars.Length(); i++) {
-//      if (char.isWhitespace(chars.charAt(i))) {
-//        space = true;
-//      } else {
-//        break;
-//      }
-//    }
-//    if (space) {
-//      // chars.delete(0,i);
-//      for (int countr = i; countr < chars.Length(); countr++) {
-//        chars.SetCharAt(countr - i, chars.charAt(countr));
-//      }
-//      chars.SetLength(chars.Length() - i);
-//      if (token.Length() > 0) {
-//        word = token.ToString();
-//        token.SetLength(0);
-//        return word;
-//      }
-//    }
-//    space = false;
-//    for (i = 0; i < chars.Length(); i++) {
-//      if (char.isWhitespace(chars.charAt(i))) {
-//        space = true;
-//        break;
-//      }
-//    }
-//    token.Append(chars.ToString().substring(0, i));
-//    // chars.delete(0,i);
-//    for (int countr = i; countr < chars.Length(); countr++) {
-//      chars.SetCharAt(countr - i, chars.charAt(countr));
-//    }
-//    chars.SetLength(chars.Length() - i);
-//    if (space) {
-//      word = token.ToString();
-//      token.SetLength(0);
-//      return word;
-//    }
-//    token.Append(chars);
-//    return null;
-//  }
-
-//  protected static String getPattern(String word) {
-//    StringBuilder pat = new StringBuilder();
-//    int len = word.Length();
-//    for (int i = 0; i < len; i++) {
-//      if (!char.isDigit(word.charAt(i))) {
-//        pat.Append(word.charAt(i));
-//      }
-//    }
-//    return pat.ToString();
-//  }
-
-//  protected ArrayList normalizeException(ArrayList ex) {
-//    ArrayList res = new ArrayList();
-//    for (int i = 0; i < ex.size(); i++) {
-//      Object item = ex.Get(i);
-//      if (item instanceof String) {
-//        String str = (String) item;
-//        StringBuilder buf = new StringBuilder();
-//        for (int j = 0; j < str.Length(); j++) {
-//          char c = str.charAt(j);
-//          if (c != hyphenChar) {
-//            buf.Append(c);
-//          } else {
-//            res.add(buf.ToString());
-//            buf.SetLength(0);
-//            char[] h = new char[1];
-//            h[0] = hyphenChar;
-//            // we use here hyphenChar which is not necessarily
-//            // the one to be printed
-//            res.add(new Hyphen(new String(h), null, null));
-//          }
-//        }
-//        if (buf.Length() > 0) {
-//          res.add(buf.ToString());
-//        }
-//      } else {
-//        res.add(item);
-//      }
-//    }
-//    return res;
-//  }
-
-//  protected String getExceptionWord(ArrayList ex) {
-//    StringBuilder res = new StringBuilder();
-//    for (int i = 0; i < ex.size(); i++) {
-//      Object item = ex.Get(i);
-//      if (item instanceof String) {
-//        res.Append((String) item);
-//      } else {
-//        if (((Hyphen) item).noBreak != null) {
-//          res.Append(((Hyphen) item).noBreak);
-//        }
-//      }
-//    }
-//    return res.ToString();
-//  }
-
-//  protected static String getInterletterValues(String pat) {
-//    StringBuilder il = new StringBuilder();
-//    String word = pat + "a"; // add dummy letter to serve as sentinel
-//    int len = word.Length();
-//    for (int i = 0; i < len; i++) {
-//      char c = word.charAt(i);
-//      if (char.isDigit(c)) {
-//        il.Append(c);
-//        i++;
-//      } else {
-//        il.Append('0');
-//      }
-//    }
-//    return il.ToString();
-//  }
-
-//  //
-//  // EntityResolver methods
-//  //
-//  public override InputSource resolveEntity(String publicId, String systemId) {
-//    return HyphenationDTDGenerator.generateDTD();
-//  }
-
-//  //
-//  // ContentHandler methods
-//  //
-
-//  /*
-//   * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
-//   *      java.lang.String, java.lang.String, org.xml.sax.Attributes)
-//   */
-//  public override void startElement(String uri, String local, String raw,
-//      Attributes attrs) {
-//    if (local.equals("hyphen-char")) {
-//      String h = attrs.GetValue("value");
-//      if (h != null && h.Length() == 1) {
-//        hyphenChar = h.charAt(0);
-//      }
-//    } else if (local.equals("classes")) {
-//      currElement = ELEM_CLASSES;
-//    } else if (local.equals("patterns")) {
-//      currElement = ELEM_PATTERNS;
-//    } else if (local.equals("exceptions")) {
-//      currElement = ELEM_EXCEPTIONS;
-//      exception = new ArrayList();
-//    } else if (local.equals("hyphen")) {
-//      if (token.Length() > 0) {
-//        exception.add(token.ToString());
-//      }
-//      exception.add(new Hyphen(attrs.GetValue("pre"), attrs.GetValue("no"),
-//          attrs.GetValue("post")));
-//      currElement = ELEM_HYPHEN;
-//    }
-//    token.SetLength(0);
-//  }
-
-//  /*
-//   * @see org.xml.sax.ContentHandler#endElement(java.lang.String,
-//   *      java.lang.String, java.lang.String)
-//   */
-//  public override void endElement(String uri, String local, String raw) {
-
-//    if (token.Length() > 0) {
-//      String word = token.ToString();
-//      switch (currElement) {
-//        case ELEM_CLASSES:
-//          consumer.addClass(word);
-//          break;
-//        case ELEM_EXCEPTIONS:
-//          exception.add(word);
-//          exception = normalizeException(exception);
-//          consumer.addException(getExceptionWord(exception),
-//              (ArrayList) exception.clone());
-//          break;
-//        case ELEM_PATTERNS:
-//          consumer.addPattern(getPattern(word), getInterletterValues(word));
-//          break;
-//        case ELEM_HYPHEN:
-//          // nothing to do
-//          break;
-//      }
-//      if (currElement != ELEM_HYPHEN) {
-//        token.SetLength(0);
-//      }
-//    }
-//    if (currElement == ELEM_HYPHEN) {
-//      currElement = ELEM_EXCEPTIONS;
-//    } else {
-//      currElement = 0;
-//    }
-
-//  }
-
-//  /*
-//   * @see org.xml.sax.ContentHandler#chars(char[], int, int)
-//   */
-//  public override void chars(char ch[], int start, int Length) {
-//    StringBuffer chars = new StringBuffer(Length);
-//    chars.Append(ch, start, Length);
-//    String word = readToken(chars);
-//    while (word != null) {
-//      // Console.WriteLine("\"" + word + "\"");
-//      switch (currElement) {
-//        case ELEM_CLASSES:
-//          consumer.addClass(word);
-//          break;
-//        case ELEM_EXCEPTIONS:
-//          exception.add(word);
-//          exception = normalizeException(exception);
-//          consumer.addException(getExceptionWord(exception),
-//              (ArrayList) exception.clone());
-//          exception.clear();
-//          break;
-//        case ELEM_PATTERNS:
-//          consumer.addPattern(getPattern(word), getInterletterValues(word));
-//          break;
-//      }
-//      word = readToken(chars);
-//    }
-
-//  }
-
-//  //
-//  // ErrorHandler methods
-//  //
-
-//  /*
-//   * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
-//   */
-//  public override void warning(SAXParseException ex) {
-//    errMsg = "[Warning] " + getLocationString(ex) + ": " + ex.GetMessage();
-//  }
-
-//  /*
-//   * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
-//   */
-//  public override void error(SAXParseException ex) {
-//    errMsg = "[Error] " + getLocationString(ex) + ": " + ex.GetMessage();
-//  }
-
-//  /*
-//   * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
-//   */
-//  public override void fatalError(SAXParseException ex) throws SAXException {
-//    errMsg = "[Fatal Error] " + getLocationString(ex) + ": " + ex.GetMessage();
-//    throw ex;
-//  }
-
-//  /*
-//   * Returns a string of the location.
-//   */
-//  private String getLocationString(SAXParseException ex) {
-//    StringBuilder str = new StringBuilder();
-
-//    String systemId = ex.GetSystemId();
-//    if (systemId != null) {
-//      int index = systemId.lastIndexOf('/');
-//      if (index != -1) {
-//        systemId = systemId.substring(index + 1);
-//      }
-//      str.Append(systemId);
-//    }
-//    str.Append(':');
-//    str.Append(ex.GetLineNumber());
-//    str.Append(':');
-//    str.Append(ex.GetColumnNumber());
-
-//    return str.ToString();
-
-//  } // getLocationString(SAXParseException):String
-
-//  // PatternConsumer implementation for testing purposes
-//  public void addClass(String c) {
-//    Console.WriteLine("class: " + c);
-//  }
-
-//  public void addException(String w, ArrayList e) {
-//    Console.WriteLine("exception: " + w + " : " + e.ToString());
-//  }
-
-//  public void addPattern(String p, String v) {
-//    Console.WriteLine("pattern: " + p + " : " + v);
-//  }
-
-//  public static void main(String[] args) 
-//  {
-//    if (args.Length > 0) {
-//      PatternParser pp = new PatternParser();
-//      pp.SetConsumer(pp);
-//      pp.parse(args[0]);
-//    }
-//  }
-//}
-
-//class HyphenationDTDGenerator {
-//  public static readonly String DTD_STRING=
-//    "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>\n"+
-//    "<!--\n"+
-//    "  Copyright 1999-2004 The Apache Software Foundation\n"+
-//    "\n"+
-//    "  Licensed under the Apache License, Version 2.0 (the \"License\");\n"+
-//    "  you may not use this file except in compliance with the License.\n"+
-//    "  You may obtain a copy of the License at\n"+
-//    "\n"+
-//    "       http://www.apache.org/licenses/LICENSE-2.0\n"+
-//    "\n"+
-//    "  Unless required by applicable law or agreed to in writing, software\n"+
-//    "  distributed under the License is distributed on an \"AS IS\" BASIS,\n"+
-//    "  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"+
-//    "  See the License for the specific language governing permissions and\n"+
-//    "  limitations under the License.\n"+
-//    "-->\n"+
-//    "<!-- $Id: hyphenation.dtd,v 1.3 2004/02/27 18:34:59 jeremias Exp $ -->\n"+
-//    "\n"+
-//    "<!ELEMENT hyphenation-info (hyphen-char?, hyphen-min?,\n"+
-//    "                           classes, exceptions?, patterns)>\n"+
-//    "\n"+
-//    "<!-- Hyphen char to be used in the exception list as shortcut for\n"+
-//    "     <hyphen pre-break=\"-\"/>. Defaults to '-'\n"+
-//    "-->\n"+
-//    "<!ELEMENT hyphen-char EMPTY>\n"+
-//    "<!ATTLIST hyphen-char value CDATA #REQUIRED>\n"+
-//    "\n"+
-//    "<!-- Default minimun Length in chars of hyphenated word fragments\n"+
-//    "     before and after the line break. For some languages this is not\n"+
-//    "     only for aesthetic purposes, wrong hyphens may be generated if this\n"+
-//    "     is not accounted for.\n"+
-//    "-->\n"+
-//    "<!ELEMENT hyphen-min EMPTY>\n"+
-//    "<!ATTLIST hyphen-min before CDATA #REQUIRED>\n"+
-//    "<!ATTLIST hyphen-min after CDATA #REQUIRED>\n"+
-//    "\n"+
-//    "<!-- char equivalent classes: space separated list of char groups, all\n"+
-//    "     chars in a group are to be treated equivalent as far as\n"+
-//    "     the hyphenation algorithm is concerned. The first char in a group\n"+
-//    "     is the group's equivalent char. Patterns should only contain\n"+
-//    "     first chars. It also defines word chars, i.e. a word that\n"+
-//    "     contains chars not present in any of the classes is not hyphenated.\n"+
-//    "-->\n"+
-//    "<!ELEMENT classes (#PCDATA)>\n"+
-//    "\n"+
-//    "<!-- Hyphenation exceptions: space separated list of hyphenated words.\n"+
-//    "     A hyphen is indicated by the hyphen tag, but you can use the\n"+
-//    "     hyphen-char defined previously as shortcut. This is in cases\n"+
-//    "     when the algorithm procedure finds wrong hyphens or you want\n"+
-//    "     to provide your own hyphenation for some words.\n"+
-//    "-->\n"+
-//    "<!ELEMENT exceptions (#PCDATA|hyphen)* >\n"+
-//    "\n"+
-//    "<!-- The hyphenation patterns, space separated. A pattern is made of 'equivalent'\n"+
-//    "     chars as described before, between any two word chars a digit\n"+
-//    "     in the range 0 to 9 may be specified. The absence of a digit is equivalent\n"+
-//    "     to zero. The '.' char is reserved to indicate begining or ending\n"+
-//    "     of words. -->\n"+
-//    "<!ELEMENT patterns (#PCDATA)>\n"+
-//    "\n"+
-//    "<!-- A \"full hyphen\" equivalent to TeX's \\discretionary\n"+
-//    "     with pre-break, post-break and no-break attributes.\n"+
-//    "     To be used in the exceptions list, the hyphen char is not\n"+
-//    "     automatically added -->\n"+
-//    "<!ELEMENT hyphen EMPTY>\n"+
-//    "<!ATTLIST hyphen pre CDATA #IMPLIED>\n"+
-//    "<!ATTLIST hyphen no CDATA #IMPLIED>\n"+
-//    "<!ATTLIST hyphen post CDATA #IMPLIED>\n";
-  
-// public static InputSource generateDTD() {
-//    return new InputSource(new StringReader(DTD_STRING));
-//  }
-//}
-//}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02362804/src/contrib/Analyzers/Compound/Hyphenation/TernaryTree.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Compound/Hyphenation/TernaryTree.cs b/src/contrib/Analyzers/Compound/Hyphenation/TernaryTree.cs
deleted file mode 100644
index fbbca07..0000000
--- a/src/contrib/Analyzers/Compound/Hyphenation/TernaryTree.cs
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * 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 System;
-//using System.Collections;
-//using System.Text;
-
-//namespace Lucene.Net.Analysis.Compound.Hyphenation
-//{
-//    /*
-//     * <h2>Ternary Search Tree.</h2>
-//     * 
-//     * <p>
-//     * A ternary search tree is a hybrid between a binary tree and a digital search
-//     * tree (trie). Keys are limited to strings. A data value of type char is stored
-//     * in each leaf node. It can be used as an index (or pointer) to the data.
-//     * Branches that only contain one key are compressed to one node by storing a
-//     * pointer to the trailer substring of the key. This class is intended to serve
-//     * as base class or helper class to implement Dictionary collections or the
-//     * like. Ternary trees have some nice properties as the following: the tree can
-//     * be traversed in sorted order, partial matches (wildcard) can be implemented,
-//     * retrieval of all keys within a given distance from the target, etc. The
-//     * storage requirements are higher than a binary tree but a lot less than a
-//     * trie. Performance is comparable with a hash table, sometimes it outperforms a
-//     * hash function (most of the time can determine a miss faster than a hash).
-//     * </p>
-//     * 
-//     * <p>
-//     * The main purpose of this java port is to serve as a base for implementing
-//     * TeX's hyphenation algorithm (see The TeXBook, appendix H). Each language
-//     * requires from 5000 to 15000 hyphenation patterns which will be keys in this
-//     * tree. The strings patterns are usually small (from 2 to 5 characters), but
-//     * each char in the tree is stored in a node. Thus memory usage is the main
-//     * concern. We will sacrifice 'elegance' to keep memory requirements to the
-//     * minimum. Using java's char type as pointer (yes, I know pointer it is a
-//     * forbidden word in java) we can keep the size of the node to be just 8 bytes
-//     * (3 pointers and the data char). This gives room for about 65000 nodes. In my
-//     * tests the english patterns took 7694 nodes and the german patterns 10055
-//     * nodes, so I think we are safe.
-//     * </p>
-//     * 
-//     * <p>
-//     * All said, this is a map with strings as keys and char as value. Pretty
-//     * limited!. It can be extended to a general map by using the string
-//     * representation of an object and using the char value as an index to an array
-//     * that contains the object values.
-//     * </p>
-//     * 
-//     * This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
-//     */
-//    [Serializable]
-//    public class TernaryTree : ICloneable
-//    {
-
-//        /*
-//         * We use 4 arrays to represent a node. I guess I should have created a proper
-//         * node class, but somehow Knuth's pascal code made me forget we now have a
-//         * portable language with virtual memory management and automatic garbage
-//         * collection! And now is kind of late, furthermore, if it ain't broken, don't
-//         * fix it.
-//         */
-
-//        /*
-//         * Pointer to low branch and to rest of the key when it is stored directly in
-//         * this node, we don't have unions in java!
-//         */
-//        protected char[] lo;
-
-//        /*
-//         * Pointer to high branch.
-//         */
-//        protected char[] hi;
-
-//        /*
-//         * Pointer to equal branch and to data when this node is a string terminator.
-//         */
-//        protected char[] eq;
-
-//        /*
-//         * <P>
-//         * The character stored in this node: splitchar. Two special values are
-//         * reserved:
-//         * </P>
-//         * <ul>
-//         * <li>0x0000 as string terminator</li>
-//         * <li>0xFFFF to indicate that the branch starting at this node is compressed</li>
-//         * </ul>
-//         * <p>
-//         * This shouldn't be a problem if we give the usual semantics to strings since
-//         * 0xFFFF is guaranteed not to be an Unicode character.
-//         * </p>
-//         */
-//        protected char[] sc;
-
-//        /*
-//         * This vector holds the trailing of the keys when the branch is compressed.
-//         */
-//        protected CharVector kv;
-
-//        protected char root;
-
-//        protected char freenode;
-
-//        protected int length; // number of items in tree
-
-//        protected static readonly int BLOCK_SIZE = 2048; // allocation size for arrays
-
-//        private TernaryTree()
-//        {
-//            Init();
-//        }
-
-//        protected void Init()
-//        {
-//            root = (char)0;
-//            freenode = (char)1;
-//            length = 0;
-//            lo = new char[BLOCK_SIZE];
-//            hi = new char[BLOCK_SIZE];
-//            eq = new char[BLOCK_SIZE];
-//            sc = new char[BLOCK_SIZE];
-//            kv = new CharVector();
-//        }
-
-//        /*
-//         * Branches are initially compressed, needing one node per key plus the size
-//         * of the string key. They are decompressed as needed when another key with
-//         * same prefix is inserted. This saves a lot of space, specially for long
-//         * keys.
-//         */
-//        public void insert(String key, char val)
-//        {
-//            // make sure we have enough room in the arrays
-//            int len = key.Length + 1; // maximum number of nodes that may be generated
-//            if (freenode + len > eq.Length)
-//            {
-//                redimNodeArrays(eq.Length + BLOCK_SIZE);
-//            }
-//            char[] strkey = new char[len--];
-//            key.GetChars(0, len, strkey, 0);
-//            strkey[len] = (char)0;
-//            root = insert(root, strkey, 0, val);
-//        }
-
-//        public void insert(char[] key, int start, char val)
-//        {
-//            int len = strlen(key) + 1;
-//            if (freenode + len > eq.Length)
-//            {
-//                redimNodeArrays(eq.Length + BLOCK_SIZE);
-//            }
-//            root = insert(root, key, start, val);
-//        }
-
-//        /*
-//         * The actual insertion function, recursive version.
-//         */
-//        private char insert(char p, char[] key, int start, char val)
-//        {
-//            int len = strlen(key, start);
-//            if (p == 0)
-//            {
-//                // this means there is no branch, this node will start a new branch.
-//                // Instead of doing that, we store the key somewhere else and create
-//                // only one node with a pointer to the key
-//                p = freenode++;
-//                eq[p] = val; // holds data
-//                length++;
-//                hi[p] = (char)0;
-//                if (len > 0)
-//                {
-//                    sc[p] = (char)0xFFFF; // indicates branch is compressed
-//                    lo[p] = (char)kv.Alloc(len + 1); // use 'lo' to hold pointer to key
-//                    strcpy(kv.GetArray(), lo[p], key, start);
-//                }
-//                else
-//                {
-//                    sc[p] = (char)0;
-//                    lo[p] = (char)0;
-//                }
-//                return p;
-//            }
-
-//            if (sc[p] == 0xFFFF)
-//            {
-//                // branch is compressed: need to decompress
-//                // this will generate garbage in the external key array
-//                // but we can do some garbage collection later
-//                char pp = freenode++;
-//                lo[pp] = lo[p]; // previous pointer to key
-//                eq[pp] = eq[p]; // previous pointer to data
-//                lo[p] = (char)0;
-//                if (len > 0)
-//                {
-//                    sc[p] = kv.Get(lo[pp]);
-//                    eq[p] = pp;
-//                    lo[pp]++;
-//                    if (kv.Get(lo[pp]) == 0)
-//                    {
-//                        // key completly decompressed leaving garbage in key array
-//                        lo[pp] = (char)0;
-//                        sc[pp] = (char)0;
-//                        hi[pp] = (char)0;
-//                    }
-//                    else
-//                    {
-//                        // we only got first char of key, rest is still there
-//                        sc[pp] = (char)0xFFFF;
-//                    }
-//                }
-//                else
-//                {
-//                    // In this case we can save a node by swapping the new node
-//                    // with the compressed node
-//                    sc[pp] = (char)0xFFFF;
-//                    hi[p] = pp;
-//                    sc[p] = (char)0;
-//                    eq[p] = val;
-//                    length++;
-//                    return p;
-//                }
-//            }
-//            char s = key[start];
-//            if (s < sc[p])
-//            {
-//                lo[p] = insert(lo[p], key, start, val);
-//            }
-//            else if (s == sc[p])
-//            {
-//                if (s != 0)
-//                {
-//                    eq[p] = insert(eq[p], key, start + 1, val);
-//                }
-//                else
-//                {
-//                    // key already in tree, overwrite data
-//                    eq[p] = val;
-//                }
-//            }
-//            else
-//            {
-//                hi[p] = insert(hi[p], key, start, val);
-//            }
-//            return p;
-//        }
-
-//        /*
-//         * Compares 2 null terminated char arrays
-//         */
-//        public static int strcmp(char[] a, int startA, char[] b, int startB)
-//        {
-//            for (; a[startA] == b[startB]; startA++, startB++)
-//            {
-//                if (a[startA] == 0)
-//                {
-//                    return 0;
-//                }
-//            }
-//            return a[startA] - b[startB];
-//        }
-
-//        /*
-//         * Compares a string with null terminated char array
-//         */
-//        public static int strcmp(String str, char[] a, int start)
-//        {
-//            int i, d, len = str.Length;
-//            for (i = 0; i < len; i++)
-//            {
-//                d = (int)str[i] - a[start + i];
-//                if (d != 0)
-//                {
-//                    return d;
-//                }
-//                if (a[start + i] == 0)
-//                {
-//                    return d;
-//                }
-//            }
-//            if (a[start + i] != 0)
-//            {
-//                return (int)-a[start + i];
-//            }
-//            return 0;
-
-//        }
-
-//        public static void strcpy(char[] dst, int di, char[] src, int si)
-//        {
-//            while (src[si] != 0)
-//            {
-//                dst[di++] = src[si++];
-//            }
-//            dst[di] = (char)0;
-//        }
-
-//        public static int strlen(char[] a, int start)
-//        {
-//            int len = 0;
-//            for (int i = start; i < a.Length && a[i] != 0; i++)
-//            {
-//                len++;
-//            }
-//            return len;
-//        }
-
-//        public static int strlen(char[] a)
-//        {
-//            return strlen(a, 0);
-//        }
-
-//        public int find(String key)
-//        {
-//            int len = key.Length;
-//            char[] strkey = new char[len + 1];
-//            key.GetChars(0, len, strkey, 0);
-//            strkey[len] = (char)0;
-
-//            return find(strkey, 0);
-//        }
-
-//        public int find(char[] key, int start)
-//        {
-//            int d;
-//            char p = root;
-//            int i = start;
-//            char c;
-
-//            while (p != 0)
-//            {
-//                if (sc[p] == 0xFFFF)
-//                {
-//                    if (strcmp(key, i, kv.GetArray(), lo[p]) == 0)
-//                    {
-//                        return eq[p];
-//                    }
-//                    else
-//                    {
-//                        return -1;
-//                    }
-//                }
-//                c = key[i];
-//                d = c - sc[p];
-//                if (d == 0)
-//                {
-//                    if (c == 0)
-//                    {
-//                        return eq[p];
-//                    }
-//                    i++;
-//                    p = eq[p];
-//                }
-//                else if (d < 0)
-//                {
-//                    p = lo[p];
-//                }
-//                else
-//                {
-//                    p = hi[p];
-//                }
-//            }
-//            return -1;
-//        }
-
-//        public bool knows(String key)
-//        {
-//            return (find(key) >= 0);
-//        }
-
-//        // redimension the arrays
-//        private void redimNodeArrays(int newsize)
-//        {
-//            int len = newsize < lo.Length ? newsize : lo.Length;
-//            char[] na = new char[newsize];
-//            Array.Copy(lo, 0, na, 0, len);
-//            lo = na;
-//            na = new char[newsize];
-//            Array.Copy(hi, 0, na, 0, len);
-//            hi = na;
-//            na = new char[newsize];
-//            Array.Copy(eq, 0, na, 0, len);
-//            eq = na;
-//            na = new char[newsize];
-//            Array.Copy(sc, 0, na, 0, len);
-//            sc = na;
-//        }
-
-//        public int size()
-//        {
-//            return length;
-//        }
-
-//        public Object clone()
-//        {
-//            TernaryTree t = new TernaryTree();
-//            t.lo = (char[])this.lo.Clone();
-//            t.hi = (char[])this.hi.Clone();
-//            t.eq = (char[])this.eq.Clone();
-//            t.sc = (char[])this.sc.Clone();
-//            t.kv = (CharVector)this.kv.Clone();
-//            t.root = this.root;
-//            t.freenode = this.freenode;
-//            t.length = this.length;
-
-//            return t;
-//        }
-
-//        /*
-//         * Recursively insert the median first and then the median of the lower and
-//         * upper halves, and so on in order to get a balanced tree. The array of keys
-//         * is assumed to be sorted in ascending order.
-//         */
-//        protected void insertBalanced(String[] k, char[] v, int offset, int n)
-//        {
-//            int m;
-//            if (n < 1)
-//            {
-//                return;
-//            }
-//            m = n >> 1;
-
-//            insert(k[m + offset], v[m + offset]);
-//            insertBalanced(k, v, offset, m);
-
-//            insertBalanced(k, v, offset + m + 1, n - m - 1);
-//        }
-
-//        /*
-//         * Balance the tree for best search performance
-//         */
-//        public void balance()
-//        {
-//            // System.out.print("Before root splitchar = ");
-//            // System.out.println(sc[root]);
-
-//            int i = 0, n = length;
-//            String[] k = new String[n];
-//            char[] v = new char[n];
-//            Iterator iter = new Iterator();
-//            while (iter.HasMoreElements())
-//            {
-//                v[i] = iter.getValue();
-//                k[i++] = (String)iter.nextElement();
-//            }
-//            Init();
-//            insertBalanced(k, v, 0, n);
-
-//            // With uniform letter distribution sc[root] should be around 'm'
-//            // System.out.print("After root splitchar = ");
-//            // System.out.println(sc[root]);
-//        }
-
-//        /*
-//         * Each node stores a character (splitchar) which is part of some key(s). In a
-//         * compressed branch (one that only contain a single string key) the trailer
-//         * of the key which is not already in nodes is stored externally in the kv
-//         * array. As items are inserted, key substrings decrease. Some substrings may
-//         * completely disappear when the whole branch is totally decompressed. The
-//         * tree is traversed to find the key substrings actually used. In addition,
-//         * duplicate substrings are removed using a map (implemented with a
-//         * TernaryTree!).
-//         * 
-//         */
-//        public void trimToSize()
-//        {
-//            // first balance the tree for best performance
-//            balance();
-
-//            // redimension the node arrays
-//            redimNodeArrays(freenode);
-
-//            // ok, compact kv array
-//            CharVector kx = new CharVector();
-//            kx.Alloc(1);
-//            TernaryTree map = new TernaryTree();
-//            compact(kx, map, root);
-//            kv = kx;
-//            kv.TrimToSize();
-//        }
-
-//        private void compact(CharVector kx, TernaryTree map, char p)
-//        {
-//            int k;
-//            if (p == 0)
-//            {
-//                return;
-//            }
-//            if (sc[p] == 0xFFFF)
-//            {
-//                k = map.find(kv.GetArray(), lo[p]);
-//                if (k < 0)
-//                {
-//                    k = kx.Alloc(strlen(kv.GetArray(), lo[p]) + 1);
-//                    strcpy(kx.GetArray(), k, kv.GetArray(), lo[p]);
-//                    map.insert(kx.GetArray(), k, (char)k);
-//                }
-//                lo[p] = (char)k;
-//            }
-//            else
-//            {
-//                compact(kx, map, lo[p]);
-//                if (sc[p] != 0)
-//                {
-//                    compact(kx, map, eq[p]);
-//                }
-//                compact(kx, map, hi[p]);
-//            }
-//        }
-
-//        public IEnumerator keys()
-//        {
-//            return new Iterator();
-//        }
-
-//        public class Iterator : IEnumerator
-//        {
-
-//            /*
-//             * current node index
-//             */
-//            int cur;
-
-//            /*
-//             * current key
-//             */
-//            String curkey;
-
-//            private class Item : ICloneable
-//            {
-//                char parent;
-
-//                char child;
-
-//                public Item()
-//                {
-//                    parent = (char)0;
-//                    child = (char)0;
-//                }
-
-//                public Item(char p, char c)
-//                {
-//                    parent = p;
-//                    child = c;
-//                }
-
-//                public Object Clone()
-//                {
-//                    return new Item(parent, child);
-//                }
-
-//            }
-
-//            /*
-//             * Node stack
-//             */
-//            Stack ns;
-
-//            /*
-//             * key stack implemented with a StringBuilder
-//             */
-//            StringBuilder ks;
-
-//            public Iterator()
-//            {
-//                cur = -1;
-//                ns = new Stack();
-//                ks = new StringBuilder();
-//                rewind();
-//            }
-
-//            public void rewind()
-//            {
-//                ns.Clear();
-//                ks.SetLength(0);
-//                cur = root;
-//                Run();
-//            }
-
-//            public Object nextElement()
-//            {
-//                String res = curkey;
-//                cur = up();
-//                Run();
-//                return res;
-//            }
-
-//            public char getValue()
-//            {
-//                if (cur >= 0)
-//                {
-//                    return eq[cur];
-//                }
-//                return 0;
-//            }
-
-//            public bool hasMoreElements()
-//            {
-//                return (cur != -1);
-//            }
-
-//            /*
-//             * traverse upwards
-//             */
-//            private int up()
-//            {
-//                Item i = new Item();
-//                int res = 0;
-
-//                if (ns.Empty())
-//                {
-//                    return -1;
-//                }
-
-//                if (cur != 0 && sc[cur] == 0)
-//                {
-//                    return lo[cur];
-//                }
-
-//                bool climb = true;
-
-//                while (climb)
-//                {
-//                    i = (Item)ns.Pop();
-//                    i.child++;
-//                    switch (i.child)
-//                    {
-//                        case 1:
-//                            if (sc[i.parent] != 0)
-//                            {
-//                                res = eq[i.parent];
-//                                ns.Push(i.Clone());
-//                                ks.Append(sc[i.parent]);
-//                            }
-//                            else
-//                            {
-//                                i.child++;
-//                                ns.Push(i.Clone());
-//                                res = hi[i.parent];
-//                            }
-//                            climb = false;
-//                            break;
-
-//                        case 2:
-//                            res = hi[i.parent];
-//                            ns.Push(i.Clone());
-//                            if (ks.Length() > 0)
-//                            {
-//                                ks.SetLength(ks.Length() - 1); // pop
-//                            }
-//                            climb = false;
-//                            break;
-
-//                        default:
-//                            if (ns.Clear())
-//                            {
-//                                return -1;
-//                            }
-//                            climb = true;
-//                            break;
-//                    }
-//                }
-//                return res;
-//            }
-
-//            /*
-//             * traverse the tree to find next key
-//             */
-//            private int Run()
-//            {
-//                if (cur == -1)
-//                {
-//                    return -1;
-//                }
-
-//                bool leaf = false;
-//                while (true)
-//                {
-//                    // first go down on low branch until leaf or compressed branch
-//                    while (cur != 0)
-//                    {
-//                        if (sc[cur] == 0xFFFF)
-//                        {
-//                            leaf = true;
-//                            break;
-//                        }
-//                        ns.Push(new Item((char)cur, '\u0000'));
-//                        if (sc[cur] == 0)
-//                        {
-//                            leaf = true;
-//                            break;
-//                        }
-//                        cur = lo[cur];
-//                    }
-//                    if (leaf)
-//                    {
-//                        break;
-//                    }
-//                    // nothing found, go up one node and try again
-//                    cur = up();
-//                    if (cur == -1)
-//                    {
-//                        return -1;
-//                    }
-//                }
-//                // The current node should be a data node and
-//                // the key should be in the key stack (at least partially)
-//                StringBuilder buf = new StringBuilder(ks.ToString());
-//                if (sc[cur] == 0xFFFF)
-//                {
-//                    int p = lo[cur];
-//                    while (kv.Get(p) != 0)
-//                    {
-//                        buf.Append(kv.Get(p++));
-//                    }
-//                }
-//                curkey = buf.ToString();
-//                return 0;
-//            }
-
-//        }
-
-//        public void PrintStats()
-//        {
-//            Console.WriteLine("Number of keys = " + length);
-//            Console.WriteLine("Node count = " + freenode);
-//            // System.out.println("Array length = " + Integer.toString(eq.length));
-//            Console.WriteLine("Key Array length = " + kv.Length());
-
-//            /*
-//             * for(int i=0; i<kv.length(); i++) if ( kv.get(i) != 0 )
-//             * System.out.print(kv.get(i)); else System.out.println("");
-//             * System.out.println("Keys:"); for(Enumeration enum = keys();
-//             * enum.hasMoreElements(); ) System.out.println(enum.nextElement());
-//             */
-
-//        }
-
-//        public static void Main(String[] args)
-//        {
-//            TernaryTree tt = new TernaryTree();
-//            tt.insert("Carlos", 'C');
-//            tt.insert("Car", 'r');
-//            tt.insert("palos", 'l');
-//            tt.insert("pa", 'p');
-//            tt.trimToSize();
-//            Console.WriteLine((char)tt.find("Car"));
-//            Console.WriteLine((char)tt.find("Carlos"));
-//            Console.WriteLine((char)tt.find("alto"));
-//            tt.PrintStats();
-//        }
-//    }
-//}
\ No newline at end of file


Mime
View raw message