String[] fds = line.split("\\s+");
if (fds[0].compareTo("vbaseline") == 0 && fds.length == 2) {
//baseline feature
double baselineWeight = new Double(fds[1].trim());
FeatureFunction ff = new EdgeTblBasedBaselineFF(ngramStateID+1+featFunctions.size(), baselineWeight);
featFunctions.add(ff);
logger.info(String.format("Baseline feature wiht weight: " + baselineWeight));
}else if (fds[0].compareTo("vbaselinecombo") == 0 && fds.length > 2) {
//baseline combo features: vbaselinecombo list-of-baseline-features (each one should be " pos_id||inter-weight ") weight
double weight = new Double(fds[fds.length-1].trim());
List<Integer> positions = new ArrayList<Integer>();
List<Double> interWeights = new ArrayList<Double>();
for(int i=1; i<fds.length-1; i++){
String[] tems = fds[i].split("\\|{2}");
int pos = new Integer(tems[0]);
double interWeight = new Double(tems[1]);
positions.add(pos);
interWeights.add(interWeight);
}
System.out.println("baseline combo model");
FeatureFunction ff = new BaselineComboFF(ngramStateID+1+featFunctions.size(), weight, positions, interWeights);
featFunctions.add(ff);
logger.info( String.format("Baseline combo model with weight: " + weight));
}else if(fds[0].compareTo("vconstituent") == 0 && fds.length == 2) {
/*
double constituentWeight = new Double(fds[1].trim());
HashMap<HyperEdge,Double> tbl = new HashMap<HyperEdge,Double>();
FeatureFunction ff = new BaselineFF(baselineLMFeatID+1+featFunctions.size(), constituentWeight, tbl);
FeatureTemplate ft = new FeatureTemplateConstituent();
VariationalLMApproximator rmodel = new VariationalLMApproximator(ff, ft, tbl);
featFunctions.add(ff);
approximatorMap.add(rmodel);
logger.info( String.format("constituent model with weight: " + constituentWeight));
*/
logger.severe("Wrong config line: " + line);
System.exit(1);
} else if(fds[0].compareTo("vlm")==0 && fds.length == 3){
int vlmOrder = new Integer(fds[1].trim());
if(vlmOrder> baselineLMOrder){
System.out.println("varatioanl_ngram_order is greater than baseline_lm_order; must be wrong");
System.exit(1);
}
double weight = new Double(fds[2].trim());
FeatureTemplate ft = new NgramFT(symbolTbl, true , ngramStateID, baselineLMOrder, vlmOrder, vlmOrder);
FeatureTemplateBasedFF ff = new FeatureTemplateBasedFF(ngramStateID+1+featFunctions.size(), weight, ft);
VariationalNgramApproximator rmodel = new VariationalNgramApproximator(symbolTbl, ft, 1.0, vlmOrder);
featFunctions.add(ff);
approximatorMap.put(rmodel, ff);
logger.info( String.format("vlm feature with weight: " + weight));
}else if(fds[0].compareTo("word_penalty_weight") == 0 && fds.length == 2) {
double weight = new Double(fds[1].trim());
System.out.println("word penalty feature");
FeatureFunction ff = new WordPenaltyFF(ngramStateID+1+featFunctions.size(), weight);
featFunctions.add(ff);
logger.info( String.format("word penalty feature with weight: " + weight));
}else{
if (logger.isLoggable(Level.SEVERE))