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


Java Type.getRange方法代码示例

本文整理汇总了Java中edu.cornell.cs.nlp.spf.mr.language.type.Type.getRange方法的典型用法代码示例。如果您正苦于以下问题:Java Type.getRange方法的具体用法?Java Type.getRange怎么用?Java Type.getRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.cornell.cs.nlp.spf.mr.language.type.Type的用法示例。


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

示例1: isPartialLiteral

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //导入方法依赖的package包/类
protected boolean isPartialLiteral(Literal literal) {
	// Count number of arguments on predicate type
	Type type = literal.getPredicateType();
	int numArgs = 0;
	while (type.isComplex()) {
		if (type instanceof RecursiveComplexType) {
			numArgs += ((RecursiveComplexType) type).getMinArgs();
			type = ((RecursiveComplexType) type).getFinalRange();
		} else {
			++numArgs;
			type = type.getRange();
		}
	}

	return literal.numArgs() < numArgs;
}
 
开发者ID:clic-lab,项目名称:spf,代码行数:17,代码来源:Evaluation.java

示例2: getFinalType

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //导入方法依赖的package包/类
public static Type getFinalType(Type type) {
	Type currentType = type;
	while (!(currentType instanceof RecursiveComplexType)
			&& currentType.isComplex()) {
		currentType = currentType.getRange();
	}
	return currentType;
}
 
开发者ID:clic-lab,项目名称:amr,代码行数:9,代码来源:AMRServices.java

示例3: typeShiftSemantics

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //导入方法依赖的package包/类
/**
 * (lambda $0:x (g $0)) ==> (lambda $0:<x,t> (lambda $1:x (and:<t*,t> ($0
 * $1) (g $1))))
 */
protected LogicalExpression typeShiftSemantics(LogicalExpression sem) {
	final Type semType = sem.getType();
	final Type range = semType.getRange();

	if (semType.isComplex()
			&& range.equals(LogicLanguageServices.getTypeRepository()
					.getTruthValueType())) {

		// Make sure the expression is wrapped with lambda operators, since
		// the variables are required
		final Lambda lambda = (Lambda) sem;

		// Variable for the new outer lambda
		final Variable outerVariable = new Variable(LogicLanguageServices
				.getTypeRepository().getTypeCreateIfNeeded(
						LogicLanguageServices.getTypeRepository()
								.getTruthValueType(),
						lambda.getArgument().getType()));

		// Create the literal applying the function to the original
		// argument
		final LogicalExpression[] args = new LogicalExpression[1];
		args[0] = lambda.getArgument();
		final Literal newLiteral = new Literal(outerVariable, args);

		// Create the conjunction of newLitral and the original body
		final Literal conjunction = new Literal(
				LogicLanguageServices.getConjunctionPredicate(),
				ArrayUtils.create(newLiteral, lambda.getBody()));

		// The new inner lambda
		final Lambda innerLambda = new Lambda(lambda.getArgument(),
				conjunction);

		// The new outer lambda
		final Lambda outerLambda = new Lambda(outerVariable, innerLambda);

		// Simplify the output and return it
		final LogicalExpression ret = Simplify.of(outerLambda);

		return ret;
	}

	return null;
}
 
开发者ID:clic-lab,项目名称:spf,代码行数:50,代码来源:SententialAdverbialTypeShifting.java

示例4: typeShiftSemantics

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //导入方法依赖的package包/类
/**
 * (lambda $0:x (g $0)) ==> (lambda $0:<x,t> (lambda $1:x (and:<t*,t> ($0
 * $1) (g $1))))
 */
protected LogicalExpression typeShiftSemantics(LogicalExpression sem) {
	final Type semType = sem.getType();
	final Type range = semType.getRange();

	if (semType.isComplex() && range.equals(LogicLanguageServices
			.getTypeRepository().getTruthValueType())) {

		// Make sure the expression is wrapped with lambda operators, since
		// the variables are required
		final Lambda lambda = (Lambda) sem;

		// Variable for the new outer lambda
		final Variable outerVariable = new Variable(LogicLanguageServices
				.getTypeRepository().getTypeCreateIfNeeded(
						LogicLanguageServices.getTypeRepository()
								.getTruthValueType(),
						lambda.getArgument().getType()));

		// Create the literal applying the function to the original
		// argument
		final LogicalExpression[] args = new LogicalExpression[1];
		args[0] = lambda.getArgument();
		final Literal newLiteral = new Literal(outerVariable, args);

		// Create the conjunction of newLitral and the original body
		final Literal conjunction = new Literal(
				LogicLanguageServices.getConjunctionPredicate(),
				ArrayUtils.create(newLiteral, lambda.getBody()));

		// The new inner lambda
		final Lambda innerLambda = new Lambda(lambda.getArgument(),
				conjunction);

		// The new outer lambda
		final Lambda outerLambda = new Lambda(outerVariable, innerLambda);

		// Simplify the output and return it
		final LogicalExpression ret = Simplify.of(outerLambda);

		return ret;
	}

	return null;
}
 
开发者ID:clic-lab,项目名称:spf,代码行数:49,代码来源:AbstractShiftingRule.java


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