コード例 #1
0
 /// <summary>
 /// Creates a new iterator, buffering entries from the specified iterator
 /// </summary>
 public BufferingTermFreqIteratorWrapper(TermFreqIterator source)
 {
     this.comp = source.Comparator;
     BytesRef spare;
     int freqIndex = 0;
     while ((spare = source.Next()) != null)
     {
         entries.Append(spare);
         if (freqIndex >= freqs.Length)
         {
             freqs = ArrayUtil.Grow(freqs, freqs.Length + 1);
         }
         freqs[freqIndex++] = source.Weight;
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates a new iterator, buffering entries from the specified iterator
        /// </summary>
        public BufferingTermFreqIteratorWrapper(TermFreqIterator source)
        {
            this.comp = source.Comparator;
            BytesRef spare;
            int      freqIndex = 0;

            while ((spare = source.Next()) != null)
            {
                entries.Append(spare);
                if (freqIndex >= freqs.Length)
                {
                    freqs = ArrayUtil.Grow(freqs, freqs.Length + 1);
                }
                freqs[freqIndex++] = source.Weight;
            }
        }
コード例 #3
0
 /// <summary>
 /// Creates a new sorted wrapper, sorting by BytesRef
 /// (ascending) then cost (ascending).
 /// </summary>
 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public SortedTermFreqIteratorWrapper(org.apache.lucene.search.spell.TermFreqIterator source, java.util.Comparator<org.apache.lucene.util.BytesRef> comparator) throws java.io.IOException
 public SortedTermFreqIteratorWrapper(TermFreqIterator source, IComparer <BytesRef> comparator)
 {
     this.source     = source;
     this.comparator = comparator;
     this.reader     = Sort();
 }
コード例 #4
0
 /// <summary>
 /// Creates a new sorted wrapper, using {@link
 /// BytesRef#getUTF8SortedAsUnicodeComparator} for
 /// sorting.
 /// </summary>
 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public SortedTermFreqIteratorWrapper(org.apache.lucene.search.spell.TermFreqIterator source) throws java.io.IOException
 public SortedTermFreqIteratorWrapper(TermFreqIterator source)
     : this(source, BytesRef.UTF8SortedAsUnicodeComparator)
 {
 }