Github user synhershko commented on a diff in the pull request:

    https://github.com/apache/lucenenet/pull/185#discussion_r78302836
  
    --- Diff: src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs ---
    @@ -913,6 +945,73 @@ private void VerifyPruned(int inputMode, FST<T> fst, 
int prune1, int prune2)
                     }
                 }
     
    +
    +            //// prune 'em
    +            //IEnumerator<KeyValuePair<IntsRef, CountMinOutput<T>>> it = 
prefixes.GetEnumerator();
    +            //while (it.MoveNext())
    +            //{
    +            //    KeyValuePair<IntsRef, CountMinOutput<T>> ent = 
it.Current;
    +            //    IntsRef prefix = ent.Key;
    +            //    CountMinOutput<T> cmo = ent.Value;
    +            //    if (LuceneTestCase.VERBOSE)
    +            //    {
    +            //        Console.WriteLine("  term prefix=" + 
InputToString(inputMode, prefix, false) + " count=" + cmo.Count + " isLeaf=" + 
cmo.IsLeaf + " output=" + Outputs.OutputToString(cmo.Output) + " isFinal=" + 
cmo.IsFinal);
    +            //    }
    +            //    bool keep;
    +            //    if (prune1 > 0)
    +            //    {
    +            //        keep = cmo.Count >= prune1;
    +            //    }
    +            //    else
    +            //    {
    +            //        Debug.Assert(prune2 > 0);
    +            //        if (prune2 > 1 && cmo.Count >= prune2)
    +            //        {
    +            //            keep = true;
    +            //        }
    +            //        else if (prefix.Length > 0)
    +            //        {
    +            //            // consult our parent
    +            //            scratch.Length = prefix.Length - 1;
    +            //            Array.Copy(prefix.Ints, prefix.Offset, 
scratch.Ints, 0, scratch.Length);
    +            //            CountMinOutput<T> cmo2 = 
prefixes.ContainsKey(scratch) ? prefixes[scratch] : null;
    +            //            //System.out.println("    parent count = " + 
(cmo2 == null ? -1 : cmo2.count));
    +            //            keep = cmo2 != null && ((prune2 > 1 && 
cmo2.Count >= prune2) || (prune2 == 1 && (cmo2.Count >= 2 || prefix.Length <= 
1)));
    +            //        }
    +            //        else if (cmo.Count >= prune2)
    +            //        {
    +            //            keep = true;
    +            //        }
    +            //        else
    +            //        {
    +            //            keep = false;
    +            //        }
    +            //    }
    +
    +            //    if (!keep)
    +            //    {
    +            //        it.Reset();
    +            //        //System.out.println("    remove");
    +            //    }
    +            //    else
    +            //    {
    +            //        // clear isLeaf for all ancestors
    +            //        //System.out.println("    keep");
    +            //        scratch.CopyInts(prefix);
    +            //        scratch.Length--;
    +            //        while (scratch.Length >= 0)
    +            //        {
    +            //            CountMinOutput<T> cmo2 = 
prefixes.ContainsKey(scratch) ? prefixes[scratch] : null;
    +            //            if (cmo2 != null)
    +            //            {
    +            //                //System.out.println("    clear isLeaf " + 
inputToString(inputMode, scratch));
    +            //                cmo2.IsLeaf = false;
    +            //            }
    +            //            scratch.Length--;
    +            //        }
    +            //    }
    +            //}
    +
    --- End diff --
    
    ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to