public void search(){
  int to_pop=config.pop_limit;
  if (LOG.isDebugEnabled()) {
    LOG.debug("Stack::search(): pop: {} size: {}",to_pop,candidates.size());
    for (    Candidate c : candidates)     LOG.debug("{}",c);
  }
  while (to_pop > 0 && !candidates.isEmpty()) {
    Candidate got=candidates.poll();
    if (got != null) {
      addHypothesis(got);
      --to_pop;
      for (      Candidate c : got.extend())       if (c != null) {
        addCandidate(c);
      }
    }
  }
}

public void search ( ) { int to_pop = config . pop_limit ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Stack::search(): pop: {} size: {}" , to_pop , candidates . size ( ) ) ; for ( Candidate c : candidates ) LOG . debug ( "{}" , c ) ; } while ( to_pop > 0 && ! candidates . isEmpty ( ) ) { Candidate got = candidates . poll ( ) ; if ( got != null ) { addHypothesis ( got ) ; -- to_pop ; for ( Candidate c : got . extend ( ) ) if ( c != null ) { addCandidate ( c ) ; } } } }
cube pruning . repeatedly pop the top candidate , creating a new hyperedge from it , adding it to the k - best list , and then extending the list of candidates with extensions of the current candidate .
