• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Noop类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PagedInstanceList

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/** Creates a PagedInstanceList where "instancesPerPage" instances
 * are swapped to disk in directory "swapDir" if the amount of free
 * system memory drops below "minFreeMemory" bytes
 * @param pipe instance pipe
 * @param numPages number of pages to keep in memory
 * @param instancesPerPage number of Instances to store in each page
 * @param swapDir where the pages on disk live.
 */
public PagedInstanceList (Pipe pipe, int numPages, int instancesPerPage, File swapDir) {
    super (pipe, numPages * instancesPerPage);
    this.instancesPerPage = instancesPerPage;
    this.swapDir = swapDir;
    this.inMemoryPageIds = new int[numPages];
    this.inMemoryPages = new InstanceList[numPages];
    this.noopPipe = new Noop(pipe.getDataAlphabet(), pipe.getTargetAlphabet());
    for (int i = 0; i < numPages; i++) {
        this.inMemoryPageIds[i] = -1;
    }

    try {
        if (!swapDir.exists()) {
            swapDir.mkdir();
        }
    } catch (SecurityException e) {
        System.err.println ("No permission to make directory " + swapDir);
        System.exit(-1);
    }
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:29,代码来源:PagedInstanceList.java


示例2: testParenGroupIterator

import cc.mallet.pipe.Noop; //导入依赖的package包/类
public void testParenGroupIterator ()
{
	String input = "(a (b c) ((d))  ) f\n\n (3\n 4) (  6) ";
	Reader reader = new StringReader (input);
	ParenGroupIterator it = new ParenGroupIterator (reader);
	Pipe pipe = new Noop();
	pipe.setTargetProcessing (false);

	InstanceList lst = new InstanceList (pipe);
	lst.addThruPipe (it);

	assertEquals (3, lst.size());
	assertEquals ("(a (b c) ((d))  )", lst.get(0).getData());
	assertEquals ("(3\n 4)", lst.get(1).getData());
	assertEquals ("(  6)", lst.get(2).getData());
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:17,代码来源:TestIterators.java


示例3: setWeights

import cc.mallet.pipe.Noop; //导入依赖的package包/类
@Test
	public void setWeights() {
	
	InstanceList instances = new InstanceList(new Noop());
	Instance instance1 = new Instance("test", null, null, null);
	Instance instance2 = new Instance("test", null, null, null);
	
	instances.add(instance1, 10.0);
	instances.add(instance2);

	assertEquals("#1", instances.getInstanceWeight(0), 10.0, 0.0);
	assertEquals("#2", instances.getInstanceWeight(instance1), 10.0, 0.0);
	assertEquals("#3", instances.getInstanceWeight(1), 1.0, 0.0);
	assertEquals("#4", instances.getInstanceWeight(instance2), 1.0, 0.0);

	// Reset an existing weight
	instances.setInstanceWeight(0, 1.0);
	assertEquals("#5", instances.getInstanceWeight(0), 1.0, 0.0);

	// Reset an existing default (and therefore not represented) weight
	instances.setInstanceWeight(1, 5.0);
	assertEquals("#6", instances.getInstanceWeight(1), 5.0, 0.0);
}
 
开发者ID:mimno,项目名称:Mallet,代码行数:24,代码来源:TestInstanceListWeights.java


示例4: testParenGroupIterator

import cc.mallet.pipe.Noop; //导入依赖的package包/类
public void testParenGroupIterator ()
{
	String input = "(a (b c) ((d))  ) f\n\n (3\n 4) (  6) ";
	Reader reader = new StringReader(input);
	ParenGroupIterator it = new ParenGroupIterator (reader);
	Pipe pipe = new Noop();
	pipe.setTargetProcessing (false);

	InstanceList lst = new InstanceList (pipe);
	lst.addThruPipe (it);

	assertEquals (3, lst.size());
	assertEquals ("(a (b c) ((d))  )", lst.get(0).getData());
	assertEquals ("(3\n 4)", lst.get(1).getData());
	assertEquals ("(  6)", lst.get(2).getData());
}
 
开发者ID:mimno,项目名称:Mallet,代码行数:17,代码来源:TestIterators.java


示例5: CorpusRepresentationMalletTarget

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/**
 * Constructor for creating a new CorpusRepresentation from a FeatureInfo. 
 * @param fi
 * @param sm 
 */
public CorpusRepresentationMalletTarget(FeatureInfo fi, ScalingMethod sm, TargetType targetType) {
  featureInfo = fi;
  scalingMethod = sm;

  LabelAlphabet targetAlphabet = (targetType == TargetType.NOMINAL) ? new LabelAlphabet() : null;
  Pipe innerPipe = new Noop(new Alphabet(), targetAlphabet);
  List<Pipe> pipes = new ArrayList<Pipe>();
  pipes.add(innerPipe);
  pipe = new LFPipe(pipes);
  pipe.setFeatureInfo(fi);
  instances = new InstanceList(pipe);
}
 
开发者ID:GateNLP,项目名称:gateplugin-LearningFramework,代码行数:18,代码来源:CorpusRepresentationMalletTarget.java


示例6: CorpusRepresentationMalletSeq

import cc.mallet.pipe.Noop; //导入依赖的package包/类
public CorpusRepresentationMalletSeq(FeatureInfo fi, ScalingMethod sm) {
  featureInfo = fi;
  scalingMethod = sm;

  Pipe innerPipe = new Noop(new Alphabet(), new LabelAlphabet());
  List<Pipe> pipes = new ArrayList<Pipe>();
  pipes.add(innerPipe);
  pipe = new LFPipe(pipes);
  pipe.setFeatureInfo(fi);
  instances = new InstanceList(pipe);
}
 
开发者ID:GateNLP,项目名称:gateplugin-LearningFramework,代码行数:12,代码来源:CorpusRepresentationMalletSeq.java


示例7: CRF

import cc.mallet.pipe.Noop; //导入依赖的package包/类
public CRF (Alphabet inputAlphabet, Alphabet outputAlphabet)
{
	super (new Noop(inputAlphabet, outputAlphabet), null);
	inputAlphabet.stopGrowth();
	logger.info ("CRF input dictionary size = "+inputAlphabet.size());
	//xxx outputAlphabet.stopGrowth();
	this.inputAlphabet = inputAlphabet;
	this.outputAlphabet = outputAlphabet;
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:10,代码来源:CRF.java


示例8: SegmentIterator

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/**
	 Iterates over {@link Segment}s for only one {@link Instance}.
 */
public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
												Object[] segmentContinueTags) {
	InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
	ilist.add (instance);
	setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:10,代码来源:SegmentIterator.java


示例9: makeList

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/**
 *
 * @param i
 * @param j
 * @return A new {@link InstanceList} containing the two argument {@link Instance}s.
 */
public static InstanceList makeList (Instance i, Instance j) {
	InstanceList list = new InstanceList(new Noop(i.getDataAlphabet(), i.getTargetAlphabet()));
	list.add(i);
	list.add(j);
	return list;
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:13,代码来源:ClusterUtils.java


示例10: SegmentIterator

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/**
	 Iterates over {@link cc.mallet.fst.Segment}s for only one {@link Instance}.
 */
public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
												Object[] segmentContinueTags) {
	InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
	ilist.add (instance);
	setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
}
 
开发者ID:shalomeir,项目名称:tctm,代码行数:10,代码来源:SegmentIterator.java


示例11: makeList

import cc.mallet.pipe.Noop; //导入依赖的package包/类
/**
 *
 * @param i
 * @param j
 * @return A new {@link cc.mallet.types.InstanceList} containing the two argument {@link cc.mallet.types.Instance}s.
 */
public static InstanceList makeList (Instance i, Instance j) {
	InstanceList list = new InstanceList(new Noop(i.getDataAlphabet(), i.getTargetAlphabet()));
	list.add(i);
	list.add(j);
	return list;
}
 
开发者ID:shalomeir,项目名称:tctm,代码行数:13,代码来源:ClusterUtils.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PlayerMoveEvent类代码示例发布时间:2022-05-22
下一篇:
Java JasperLoader类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap