当前位置: 首页>>代码示例>>Java>>正文


Java PipeUtils类代码示例

本文整理汇总了Java中cc.mallet.pipe.PipeUtils的典型用法代码示例。如果您正苦于以下问题:Java PipeUtils类的具体用法?Java PipeUtils怎么用?Java PipeUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PipeUtils类属于cc.mallet.pipe包,在下文中一共展示了PipeUtils类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testConcatenatePipes

import cc.mallet.pipe.PipeUtils; //导入依赖的package包/类
public void testConcatenatePipes ()
{
  Pipe p1 = new StupidPipe ();
  Pipe p2 = new SimpleTagger.SimpleTaggerSentence2FeatureVectorSequence ();
  // initialize p2's dict
  p2.instanceFrom(new Instance (data, null, null, null));

  assertEquals (3, p2.getDataAlphabet ().size());

  Pipe serial = PipeUtils.concatenatePipes (p1, p2);
  Alphabet dict = serial.getDataAlphabet ();

  assertEquals (3, dict.size ());
  assertTrue (dict == p2.getDataAlphabet ());
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:16,代码来源:TestPipeUtils.java

示例2: testConcatenateBadPipes

import cc.mallet.pipe.PipeUtils; //导入依赖的package包/类
public void testConcatenateBadPipes ()
{
  Pipe p1 = new SimpleTaggerSentence2TokenSequence ();
  // force resolving data alphabet
  Alphabet dict1 = p1.getDataAlphabet ();

  Pipe p2 = new SimpleTaggerSentence2TokenSequence ();
  // force resolving data alphabet
  Alphabet dict2 = p2.getDataAlphabet ();

  assertTrue (dict1 != dict2);

  try {
    PipeUtils.concatenatePipes (p1, p2);
    assertTrue ("Test failed: concatenatePipes() allowed putting together incompatible alphabets.", false);

  } catch (IllegalArgumentException e) {
    // Exception expected
  }
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:21,代码来源:TestPipeUtils.java

示例3: ignoretestConcatenateBadPipes

import cc.mallet.pipe.PipeUtils; //导入依赖的package包/类
public void ignoretestConcatenateBadPipes ()
{
  Pipe p1 = new SimpleTaggerSentence2TokenSequence ();
  // force resolving data alphabet
  Alphabet dict1 = p1.getDataAlphabet ();

  Pipe p2 = new SimpleTaggerSentence2TokenSequence ();
  // force resolving data alphabet
  Alphabet dict2 = p2.getDataAlphabet ();

  assertTrue (dict1 != dict2);

  try {
    PipeUtils.concatenatePipes (p1, p2);
    assertTrue ("Test failed: concatenatePipes() allowed putting together incompatible alphabets.", false);

  } catch (IllegalArgumentException e) {
    // Exception expected
  }
}
 
开发者ID:cmoen,项目名称:mallet,代码行数:21,代码来源:TestPipeUtils.java

示例4: setPipes

import cc.mallet.pipe.PipeUtils; //导入依赖的package包/类
public ACRFExtractorTrainer setPipes (Pipe tokPipe, Pipe featurePipe)
{
  RememberTokenizationPipe rtp = new RememberTokenizationPipe ();
  this.featurePipe = PipeUtils.concatenatePipes (rtp, featurePipe);
  this.tokPipe = tokPipe;
  return this;
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:8,代码来源:ACRFExtractorTrainer.java

示例5: testConcatenateNullPipes

import cc.mallet.pipe.PipeUtils; //导入依赖的package包/类
public void testConcatenateNullPipes ()
{
  Pipe p1 = new StupidPipe ();
  Pipe p2 = new SimpleTagger.SimpleTaggerSentence2FeatureVectorSequence ();

  Pipe serial = PipeUtils.concatenatePipes (p1, p2);

  p2.instanceFrom(new Instance (data, null, null, null));
  assertEquals (3, serial.getDataAlphabet ().size ());
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:11,代码来源:TestPipeUtils.java


注:本文中的cc.mallet.pipe.PipeUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。