Class Util.TopNSearcher<T>

  • Enclosing class:
    Util

    public static class Util.TopNSearcher<T>
    extends java.lang.Object
    Utility class to find top N shortest paths from start point(s).
    • Constructor Summary

      Constructors 
      Constructor Description
      TopNSearcher​(FST<T> fst, int topN, int maxQueueDepth, java.util.Comparator<T> comparator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addStartPaths​(FST.Arc<T> node, T startOutput, boolean allowEmptyString, IntsRef input)
      Adds all leaving arcs, including 'finished' arc, if the node is final, from this node into the queue.
      Util.MinResult<T>[] search()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TopNSearcher

        public TopNSearcher​(FST<T> fst,
                            int topN,
                            int maxQueueDepth,
                            java.util.Comparator<T> comparator)
    • Method Detail

      • addStartPaths

        public void addStartPaths​(FST.Arc<T> node,
                                  T startOutput,
                                  boolean allowEmptyString,
                                  IntsRef input)
                           throws java.io.IOException
        Adds all leaving arcs, including 'finished' arc, if the node is final, from this node into the queue.
        Throws:
        java.io.IOException
      • search

        public Util.MinResult<T>[] search()
                                   throws java.io.IOException
        Throws:
        java.io.IOException