本文整理匯總了Java中edu.cmu.minorthird.util.IOUtil類的典型用法代碼示例。如果您正苦於以下問題:Java IOUtil類的具體用法?Java IOUtil怎麽用?Java IOUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IOUtil類屬於edu.cmu.minorthird.util包,在下文中一共展示了IOUtil類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import edu.cmu.minorthird.util.IOUtil; //導入依賴的package包/類
public void initialize() throws Exception {
// return if already initialized
if (isInitialized()) return;
if (languagePair == null)
throw new Exception("languagePair must be set before calling initialize");
super.initialize();
Properties properties = Properties.loadFromClassName(this.getClass().getName());
properties = properties.mapProperties().get(languagePair.getFirst()+"_"+languagePair.getSecond());
String classifierFileName = properties.get("classifierFile");
if (classifierFileName == null)
throw new RuntimeException("Required property classifierFile is undefined'");
classifier = (Classifier) IOUtil.loadSerialized(new File(
classifierFileName));
setInitialized(true);
}
示例2: MTNERParser
import edu.cmu.minorthird.util.IOUtil; //導入依賴的package包/類
MTNERParser(String modelname, FeatureGenerator featureg) {
try {
model = (SequenceClassifier) IOUtil.loadSerialized(new java.io.File(modelname));
this.fg = featureg;
} catch (IOException e) {
e.printStackTrace();
}
}
示例3: saveClassifier
import edu.cmu.minorthird.util.IOUtil; //導入依賴的package包/類
public void saveClassifier(String fileName){
try{
IOUtil.saveSerialized((Serializable)classifier,new File(fileName));
}
catch(Exception e){
e.printStackTrace(System.err);
}
}
示例4: loadClassifier
import edu.cmu.minorthird.util.IOUtil; //導入依賴的package包/類
public void loadClassifier(String fileName){
try{
classifier=(Classifier)IOUtil.loadSerialized(new File(fileName));
}
catch(Exception e){
e.printStackTrace(System.err);
}
}