當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.equals方法代碼示例

本文整理匯總了Java中edu.cornell.cs.nlp.spf.mr.language.type.Type.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.equals方法的具體用法?Java Type.equals怎麽用?Java Type.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.cornell.cs.nlp.spf.mr.language.type.Type的用法示例。


在下文中一共展示了Type.equals方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCoordinationPredicate

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //導入方法依賴的package包/類
/**
 * Given a coordination predicate, as initiated by
 * {@link CoordinationC1Rule}, return the appropriate coordination instance
 * of conjunction predicate.
 *
 * @param coordinationWrapper
 *            Coordination predicate, as initiated by
 *            {@link CoordinationC1Rule}.
 * @param coordinatedType
 *            The type of the coordinated items.
 */
public static LogicalConstant getCoordinationPredicate(
		String coordinationWrapperBaseName, Type coordinatedType) {
	if (coordinatedType.equals(LogicLanguageServices.getTypeRepository()
			.getTruthValueType())) {
		return coordinationWrapperBaseName
				.equals(INSTANCE.conjunctionLabel) ? LogicLanguageServices
				.getConjunctionPredicate() : LogicLanguageServices
				.getDisjunctionPredicate();
	} else if (coordinatedType.equals(LogicLanguageServices
			.getTypeRepository().getEntityType())) {
		return coordinationWrapperBaseName
				.equals(INSTANCE.conjunctionLabel) ? INSTANCE.entityConjunctionInstance
				: INSTANCE.entityDisjunctionInstance;
	} else {
		LOG.debug("Unsupported coordinationw wrapper type: %s with %s",
				coordinationWrapperBaseName, coordinatedType);
		return null;
	}
}
 
開發者ID:clic-lab,項目名稱:amr,代碼行數:31,代碼來源:CoordinationServices.java

示例2: skolemize

import edu.cornell.cs.nlp.spf.mr.language.type.Type; //導入方法依賴的package包/類
public static Literal skolemize(LogicalExpression set) {
	if (set.getType().isComplex()) {
		final Type range = set.getType().getRange();
		if (range.equals(LogicLanguageServices.getTypeRepository()
				.getTruthValueType())) {
			final Type domain = set.getType().getDomain();
			return new Literal(createSkolemPredicate(domain), ArrayUtils
					.create(SkolemServices.getIdPlaceholder(), set));
		}
	}
	return null;
}
 
開發者ID:clic-lab,項目名稱:amr,代碼行數:13,代碼來源: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.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。