private Derivation<TK,FV> constructDerivation(Derivation<TK,FV> markedNode,int sourceInputId,FeatureExtractor<TK,FV> featurizer,Scorer<FV> scorer,SearchHeuristic<TK,FV> heuristic,OutputSpace<TK,FV> outputSpace){
  final List<Derivation<TK,FV>> nodes=new LinkedList<>();
  Derivation<TK,FV> p=markedNode;
  while (p != null) {
    nodes.add(0,p);
    p=p.parent;
  }
  p=markedNode.bestChild;
  while (p != null) {
    nodes.add(p);
    p=p.bestChild;
  }
  Derivation<TK,FV> goalHyp=null;
  for (  Derivation<TK,FV> node : nodes) {
    goalHyp=goalHyp == null ? node : new Derivation<>(sourceInputId,node.rule,goalHyp.length,goalHyp,featurizer,scorer,heuristic,outputSpace);
  }
  return goalHyp;
}

private Derivation < TK , FV > constructDerivation ( Derivation < TK , FV > markedNode , int sourceInputId , FeatureExtractor < TK , FV > featurizer , Scorer < FV > scorer , SearchHeuristic < TK , FV > heuristic , OutputSpace < TK , FV > outputSpace ) { final List < Derivation < TK , FV > > nodes = new LinkedList < > ( ) ; Derivation < TK , FV > p = markedNode ; while ( p != null ) { nodes . add ( 0 , p ) ; p = p . parent ; } p = markedNode . bestChild ; while ( p != null ) { nodes . add ( p ) ; p = p . bestChild ; } Derivation < TK , FV > goalHyp = null ; for ( Derivation < TK , FV > node : nodes ) { goalHyp = goalHyp == null ? node : new Derivation < > ( sourceInputId , node . rule , goalHyp . length , goalHyp , featurizer , scorer , heuristic , outputSpace ) ; } return goalHyp ; }
construct a new derivation from a node of interest .
