// do not use cachedToString @Deprecated public String toString(SymbolTable symbolTable) { StringBuffer sb = new StringBuffer(); sb.append(symbolTable.getWord(this.lhs)); sb.append(" ||| "); sb.append(symbolTable.getWords(this.pFrench)); sb.append(" |||"); for (int i = 0; i < this.featScores.length; i++) { sb.append(String.format(" %.4f", this.featScores[i])); } return sb.toString(); }
@Deprecated public String toString( Map<Integer, String> ntVocab, SymbolTable sourceVocab, SymbolTable targetVocab) { if (null == this.cachedToString) { StringBuffer sb = new StringBuffer(); sb.append(ntVocab.get(this.lhs)); sb.append(" ||| "); sb.append(sourceVocab.getWords(this.pFrench, true)); sb.append(" |||"); for (int i = 0; i < this.featScores.length; i++) { // sb.append(String.format(" %.4f", this.feat_scores[i])); sb.append(' ').append(Float.toString(this.featScores[i])); } this.cachedToString = sb.toString(); } return this.cachedToString; }