Class Util.TopNSearcher<T>

  • Enclosing class:
    Util

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

      • TopNSearcher

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

      • addIfCompetitive

        protected void addIfCompetitive​(Util.FSTPath<T> path)
      • addStartPaths

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

        protected boolean acceptResult​(IntsRef input,
                                       T output)