Package joshua.decoder.ff.tm.hiero

Examples of joshua.decoder.ff.tm.hiero.DiskHyperGraphFormatReader


      (null == itemsFile)
      ? new BufferedWriter(new OutputStreamWriter(System.out))
      : FileUtility.getWriteFileStream(itemsFile);
   
    if (ruleReader == null)
      ruleReader = new DiskHyperGraphFormatReader(null, this.symbolTable);
     
    if (useForestPruning) {
      this.pruner = new HyperGraphPruning(this.symbolTable, true, threshold, threshold);
    }
  }
View Full Code Here


      logger.fine("Reading rules from file " + rulesFile);
   
    this.associatedGrammar.clear();
   
    this.ruleReader =
      new DiskHyperGraphFormatReader(rulesFile, this.symbolTable);
     
    if (ruleReader != null) {
      ruleReader.initialize();
      for (Rule rule : ruleReader) {       
        this.associatedGrammar.put(rule.getRuleID(), rule);
View Full Code Here

// end readHyperGraph()
//===============================================================
  static public Map<String,Integer> obtainRuleStringToIDTable(String rulesFile) {
       
    SymbolTable symbolTable = new BuildinSymbol(null);
    GrammarReader<BilingualRule> ruleReader = new DiskHyperGraphFormatReader(rulesFile, symbolTable);
    Map<String,Integer> rulesIDTable = new HashMap<String,Integer>();
   
    ruleReader.initialize();
    for (Rule rule : ruleReader) {       
      rulesIDTable.put(rule.toStringWithoutFeatScores(symbolTable), rule.getRuleID());
    }     
    ruleReader.close();     
 
    return rulesIDTable;
  }
View Full Code Here

TOP

Related Classes of joshua.decoder.ff.tm.hiero.DiskHyperGraphFormatReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.