public List<StructuredTranslation> KbestExtractOnHG(HyperGraph hg,int topN){
  resetState();
  if (hg == null || hg.goalNode == null) {
    return emptyList();
  }
  final List<StructuredTranslation> kbest=new ArrayList<>(topN);
  for (int k=1; k <= topN; k++) {
    StructuredTranslation translation=getKthStructuredTranslation(hg.goalNode,k);
    if (translation == null) {
      break;
    }
    kbest.add(translation);
  }
  return kbest;
}

public List < StructuredTranslation > KbestExtractOnHG ( HyperGraph hg , int topN ) { resetState ( ) ; if ( hg == null || hg . goalNode == null ) { return emptyList ( ) ; } final List < StructuredTranslation > kbest = new ArrayList < > ( topN ) ; for ( int k = 1 ; k <= topN ; k ++ ) { StructuredTranslation translation = getKthStructuredTranslation ( hg . goalNode , k ) ; if ( translation == null ) { break ; } kbest . add ( translation ) ; } return kbest ; }
this is an entry point for extracting k - best hypotheses as structuredtranslation objects . it computes all of them and returning a list of structuredtranslation objects . these objects hold all translation information ( string , tokens , features , alignments , score ) .
