//=== baseline feature ====
//TODO: ????????????????????????????????????????????????????
int baselineFeatID = 99;
//??????????????????????????????????????
EdgeTblBasedBaselineFF baselineFeature = new EdgeTblBasedBaselineFF(baselineFeatID, baselineWeight);
features.add(baselineFeature);
//=== reranking feature ===
//TODO: ??????????????
int ngramStateID = 0;
int baselineLMOrder = 5;
int startNgramOrder = 1;
int endNgramOrder = 2;
int featID = 100;
double weight = 1.0;
//????????
Map<String,Integer> rulesIDTable = null; //TODO??
//TODO
FeatureFunction rerankFF = DiscriminativeSupport.setupRerankingFeature(featID, weight, symbolTbl, useTMFeat, useLMFeat, useEdgeNgramOnly, useTMTargetFeat,
JoshuaConfiguration.useMicroTMFeat, JoshuaConfiguration.wordMapFile,
ngramStateID,
baselineLMOrder, startNgramOrder, endNgramOrder, featureFile, modelFile, rulesIDTable);
features.add(rerankFF);
//=== reranker using the feature functions
HGRanker reranker = new HGRanker(features);
BufferedWriter out1best = FileUtilityOld.getWriteFileStream(reranked1bestFile);
int topN=3;
boolean useUniqueNbest =true;
boolean useTreeNbest = false;
boolean addCombinedCost = true;
KBestExtractor kbestExtractor = new KBestExtractor(symbolTbl, useUniqueNbest, useTreeNbest, false, addCombinedCost, false, true);
DiskHyperGraph diskHG = new DiskHyperGraph(symbolTbl, ngramStateID, saveModelCosts, null);
diskHG.initRead(testNodesFile, testRulesFile, null);
for(int sentID=0; sentID < numSent; sentID ++){
System.out.println("#Process sentence " + sentID);
HyperGraph testHG = diskHG.readHyperGraph();
baselineFeature.collectTransitionLogPs(testHG);
reranker.rankHG(testHG);
try{
kbestExtractor.lazyKBestExtractOnHG(testHG, features, topN, sentID, out1best);
} catch (IOException e) {