本文整理汇总了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);
}
}