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


Java Predicate.getMySentence方法代码示例

本文整理汇总了Java中se.lth.cs.srl.corpus.Predicate.getMySentence方法的典型用法代码示例。如果您正苦于以下问题:Java Predicate.getMySentence方法的具体用法?Java Predicate.getMySentence怎么用?Java Predicate.getMySentence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在se.lth.cs.srl.corpus.Predicate的用法示例。


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

示例1: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,Map<Word, String> proposition) {
	Sentence s=pred.getMySentence();
	StringBuffer ret=new StringBuffer();
	for(int i=1;i<s.size();++i){
		Word w=s.get(i);
		if(pred==w){
			ret.append(" ").append(pred.getSense());
			if(useVoice)
				ret.append(isPassive(pred)?"/P":"/A"); 
		}
		if(proposition.containsKey(w)){
			Matcher m=CALSPattern.matcher(proposition.get(w));
			if(m.matches())
				ret.append(" ").append(m.group(1));
		}
	}
	return ret.toString();
}
 
开发者ID:rudaoshi,项目名称:mate,代码行数:20,代码来源:Spanish.java

示例2: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,Map<Word, String> proposition) {
	Sentence sen=pred.getMySentence();
	StringBuilder ret=new StringBuilder();
	for(int i=1,size=sen.size();i<size;++i){
		Word w=sen.get(i);
		if(pred==w){
			ret.append(" "+pred.getSense());
		}
		if(proposition.containsKey(w)){
			String label=proposition.get(w);
			if(CALSPattern.matcher(label).matches())
				ret.append(" "+label);
		}
	}
	return ret.toString();
}
 
开发者ID:rudaoshi,项目名称:mate,代码行数:18,代码来源:Chinese.java

示例3: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred, Map<Word, String> proposition) {
	Sentence sen=pred.getMySentence();
	StringBuilder ret=new StringBuilder();
	for(int i=1,size=sen.size();i<size;++i){
		Word word=sen.get(i);
		if(pred==word){
			ret.append(" "+pred.getSense()+"/");
			ret.append(isPassiveVoice(pred) ? "P" : "A");
		} //Don't make this else if, since the predicate can also be its on argument
		if(proposition.containsKey(word)){
			String label=proposition.get(word);
			if(CALSPattern.matcher(label).matches())
				ret.append(" "+label);
		}
	}
	return ret.toString();
}
 
开发者ID:rudaoshi,项目名称:mate,代码行数:19,代码来源:English.java

示例4: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,Map<Word, String> proposition) {
	Sentence sen=pred.getMySentence();
	StringBuilder ret=new StringBuilder();
	for(int i=1,size=sen.size();i<size;++i){
		Word word=sen.get(i);
		if(pred==word){
			ret.append(" "+pred.getSense()+"/");
			ret.append(isPassiveVoice(pred) ? "P" : "A");
		}
		if(proposition.containsKey(word)){
			ret.append(" "+proposition.get(word));
		}
	}
	
	
	return ret.toString();
}
 
开发者ID:rudaoshi,项目名称:mate,代码行数:19,代码来源:German.java

示例5: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,
		Map<Word, String> proposition) {
	Sentence s = pred.getMySentence();
	StringBuffer ret = new StringBuffer();
	for (int i = 1; i < s.size(); ++i) {
		Word w = s.get(i);
		if (pred == w) {
			ret.append(" ").append(pred.getSense());
			if (useVoice)
				ret.append(isPassive(pred) ? "/P" : "/A");
		}
		if (proposition.containsKey(w)) {
			Matcher m = CALSPattern.matcher(proposition.get(w));
			if (m.matches())
				ret.append(" ").append(m.group(1));
		}
	}
	return ret.toString();
}
 
开发者ID:microth,项目名称:mateplus,代码行数:21,代码来源:Spanish.java

示例6: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,
		Map<Word, String> proposition) {
	Sentence sen = pred.getMySentence();
	StringBuilder ret = new StringBuilder();
	for (int i = 1, size = sen.size(); i < size; ++i) {
		Word word = sen.get(i);
		if (pred == word) {
			ret.append(" " + pred.getSense() + "/");
			ret.append(isPassiveVoice(pred) ? "P" : "A");
		} // Don't make this else if, since the predicate can also be its on
			// argument
		if (proposition.containsKey(word)) {
			String label = proposition.get(word);
			if ((Parse.parseOptions != null
					&& Parse.parseOptions.globalFeats && Parse.parseOptions.framenetdir != null)
					|| ((Learn.learnOptions != null
							&& Learn.learnOptions.globalFeats && Learn.learnOptions.framenetdir != null))
					|| CALSPattern.matcher(label).matches())
				ret.append(" " + label);
		}
	}
	return ret.toString();
}
 
开发者ID:microth,项目名称:mateplus,代码行数:25,代码来源:English.java

示例7: getCoreArgumentLabelSequence

import se.lth.cs.srl.corpus.Predicate; //导入方法依赖的package包/类
@Override
public String getCoreArgumentLabelSequence(Predicate pred,
		Map<Word, String> proposition) {
	Sentence sen = pred.getMySentence();
	StringBuilder ret = new StringBuilder();
	for (int i = 1, size = sen.size(); i < size; ++i) {
		Word word = sen.get(i);
		if (pred == word) {
			ret.append(" " + pred.getSense() + "/");
			ret.append(isPassiveVoice(pred) ? "P" : "A");
		}
		if (proposition.containsKey(word)) {
			ret.append(" " + proposition.get(word));
		}
	}

	return ret.toString();
}
 
开发者ID:microth,项目名称:mateplus,代码行数:19,代码来源:German.java


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