public void addGlueRules(ArrayList<FeatureFunction> featureFunctions){
  HieroFormatReader reader=new HieroFormatReader();
  String goalNT=FormatUtils.cleanNonTerminal(joshuaConfiguration.goal_symbol);
  String defaultNT=FormatUtils.cleanNonTerminal(joshuaConfiguration.default_non_terminal);
  String[] ruleStrings=new String[]{String.format("[%s] ||| %s ||| %s ||| 0",goalNT,Vocabulary.START_SYM,Vocabulary.START_SYM),String.format("[%s] ||| [%s,1] [%s,2] ||| [%s,1] [%s,2] ||| -1",goalNT,goalNT,defaultNT,goalNT,defaultNT),String.format("[%s] ||| [%s,1] %s ||| [%s,1] %s ||| 0",goalNT,goalNT,Vocabulary.STOP_SYM,goalNT,Vocabulary.STOP_SYM)};
  for (  String ruleString : ruleStrings) {
    Rule rule=reader.parseLine(ruleString);
    addRule(rule);
    rule.estimateRuleCost(featureFunctions);
  }
}

public void addGlueRules ( ArrayList < FeatureFunction > featureFunctions ) { HieroFormatReader reader = new HieroFormatReader ( ) ; String goalNT = FormatUtils . cleanNonTerminal ( joshuaConfiguration . goal_symbol ) ; String defaultNT = FormatUtils . cleanNonTerminal ( joshuaConfiguration . default_non_terminal ) ; String [ ] ruleStrings = new String [ ] { String . format ( "[%s] ||| %s ||| %s ||| 0" , goalNT , Vocabulary . START_SYM , Vocabulary . START_SYM ) , String . format ( "[%s] ||| [%s,1] [%s,2] ||| [%s,1] [%s,2] ||| -1" , goalNT , goalNT , defaultNT , goalNT , defaultNT ) , String . format ( "[%s] ||| [%s,1] %s ||| [%s,1] %s ||| 0" , goalNT , goalNT , Vocabulary . STOP_SYM , goalNT , Vocabulary . STOP_SYM ) } ; for ( String ruleString : ruleStrings ) { Rule rule = reader . parseLine ( ruleString ) ; addRule ( rule ) ; rule . estimateRuleCost ( featureFunctions ) ; } }
adds a default set of glue rules .
