for (int pos = 0; pos < padLength; pos++) {
tags[pos] = ts.getPossibleValues(pos);
tagNum[pos] = tags[pos].length;
}
Beam newBeam = new Beam(beamSize, ScoredComparator.ASCENDING_COMPARATOR);
TagSeq initSeq = new TagSeq();
newBeam.add(initSeq);
for (int pos = 0; pos < padLength; pos++) {
//System.out.println("scoring word " + pos + " / " + (leftWindow + length) + ", tagNum = " + tagNum[pos] + "...");
//System.out.flush();
Beam oldBeam = newBeam;
if (pos < leftWindow + rightWindow && exhaustiveStart) {
newBeam = new Beam(100000, ScoredComparator.ASCENDING_COMPARATOR);
} else {
newBeam = new Beam(beamSize, ScoredComparator.ASCENDING_COMPARATOR);
}
// each hypothesis gets extended and beamed
for (Iterator beamI = oldBeam.iterator(); beamI.hasNext();) {
// System.out.print("#"); System.out.flush();
TagSeq tagSeq = (TagSeq) beamI.next();
for (int nextTagNum = 0; nextTagNum < tagNum[pos]; nextTagNum++) {
TagSeq nextSeq = tagSeq.tclone();