本文整理汇总了Java中cc.mallet.util.FileUtils.readObject方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.readObject方法的具体用法?Java FileUtils.readObject怎么用?Java FileUtils.readObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cc.mallet.util.FileUtils
的用法示例。
在下文中一共展示了FileUtils.readObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: skiptestOldCrf
import cc.mallet.util.FileUtils; //导入方法依赖的package包/类
public void skiptestOldCrf() {
CRF crf = (CRF) FileUtils.readObject(new File(oldCrfFile));
Instance inst = crf.getInputPipe().instanceFrom(
new Instance(testString, null, null, null));
Sequence output = crf.transduce((Sequence) inst.getData());
String std = output.toString();
assertEquals(" B-PER I-PER O O", std);
}
示例2: testPlusEqualsFromSaved
import cc.mallet.util.FileUtils; //导入方法依赖的package包/类
public void testPlusEqualsFromSaved () throws IOException, ClassNotFoundException
{
HashedSparseVector s1 = (HashedSparseVector) FileUtils.readObject (oldSv);
HashedSparseVector s2 = new HashedSparseVector (new int[] { 1 }, new double[] { 1.0 });
s1.plusEqualsSparse (s2, 1.0);
assertEquals (1.0, s1.value (0), 1e-5);
assertEquals (0.0, s1.value (1), 1e-5);
}
示例3: ignoretestPlusEqualsFromSaved
import cc.mallet.util.FileUtils; //导入方法依赖的package包/类
public void ignoretestPlusEqualsFromSaved () throws IOException, ClassNotFoundException
{
HashedSparseVector s1 = (HashedSparseVector) FileUtils.readObject (oldSv);
HashedSparseVector s2 = new HashedSparseVector (new int[] { 1 }, new double[] { 1.0 });
s1.plusEqualsSparse (s2, 1.0);
assertEquals (1.0, s1.value (0), 1e-5);
assertEquals (0.0, s1.value (1), 1e-5);
}
示例4: ReferenceLineAnnotator
import cc.mallet.util.FileUtils; //导入方法依赖的package包/类
public ReferenceLineAnnotator(File crfModelFile) throws AnalysisException {
this.crf = (CRF) FileUtils.readObject(crfModelFile);
this.pipe = this.crf.getInputPipe();
}