本文整理汇总了Java中cc.mallet.types.SingleInstanceIterator类的典型用法代码示例。如果您正苦于以下问题:Java SingleInstanceIterator类的具体用法?Java SingleInstanceIterator怎么用?Java SingleInstanceIterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SingleInstanceIterator类属于cc.mallet.types包,在下文中一共展示了SingleInstanceIterator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import cc.mallet.types.SingleInstanceIterator; //导入依赖的package包/类
public static void main (String[] args)
{
try {
for (int i = 0; i < args.length; i++) {
Instance carrier = new Instance (new File(args[i]), null, null, null);
SerialPipes p = new SerialPipes (new Pipe[] {
new Input2CharSequence (),
new CharSequence2TokenSequence(new CharSequenceLexer())});
carrier = p.newIteratorFrom (new SingleInstanceIterator(carrier)).next();
TokenSequence ts = (TokenSequence) carrier.getData();
System.out.println ("===");
System.out.println (args[i]);
System.out.println (ts.toString());
}
} catch (Exception e) {
System.out.println (e);
e.printStackTrace();
}
}
示例2: main
import cc.mallet.types.SingleInstanceIterator; //导入依赖的package包/类
public static void main(String[] args) {
try {
for (int i = 0; i < args.length; i++) {
Instance carrier = new Instance(new File(args[i]), null, null, null);
SerialPipes p = new SerialPipes(new Pipe[]{
new Input2CharSequence(),
new ChineseSequence2TokenSequence()});
carrier = p.newIteratorFrom(new SingleInstanceIterator(carrier)).next();
TokenSequence ts = (TokenSequence) carrier.getData();
System.out.println("===");
System.out.println(args[i]);
System.out.println(ts.toString());
}
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
示例3: instancesFrom
import cc.mallet.types.SingleInstanceIterator; //导入依赖的package包/类
public Instance[] instancesFrom (Instance inst)
{
return instancesFrom (new SingleInstanceIterator(inst));
}