- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers
类的一些代码示例,展示了WordHelpers
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordHelpers
类的具体详情如下:
包路径:edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers
类名称:WordHelpers
暂无
代码示例来源:origin: CogComp/cogcomp-nlp
private static String getSafePOS(TextAnnotation ta, int wordPosition) {
String pos = WordHelpers.getPOS(ta, wordPosition);
if (pos.length() == 0)
pos = "*";
return pos;
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static boolean isPrep(TextAnnotation ta, int tokenId) {
String pos = WordHelpers.getPOS(ta, tokenId);
String word = WordHelpers.getWord(ta, tokenId);
String lowerCase = word.toLowerCase().trim();
boolean validPreposition = prepositions.contains(lowerCase);
boolean isPrepositionPOS = POSUtils.isPOSPreposition(pos);
// we need to consider the case of "to + verb"
boolean isToVP = false;
if (tokenId < ta.size() - 1) {
if (lowerCase.equals("to") && POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 1)))
isToVP = true;
}
return validPreposition && (isPrepositionPOS && !isToVP);
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
private static String getSafeLemma(TextAnnotation ta, int wordPosition) {
String lemma = WordHelpers.getLemma(ta, wordPosition);
if (lemma.length() == 0)
lemma = "*";
return lemma;
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static List<String> getHypernyms(TextAnnotation ta, int tokenId, WordNetManager wnManager)
throws JWNLException {
String word = getWord(ta, tokenId).toLowerCase();
String wordPOS = getPOS(ta, tokenId);
if (POSUtils.isPOSOpenSet(wordPOS)) {
POS wnPos = getWNPOS(wordPOS);
return wnManager.getHypernyms(word, wnPos, true);
} else {
return new ArrayList<>();
}
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static boolean isCapitalized(TextAnnotation ta, int tokenId) {
String word = getWord(ta, tokenId);
String firstCharacter = word.substring(0, 1);
String upperCase = firstCharacter.toUpperCase();
return upperCase.matches("[A-Z]") && upperCase.equals(firstCharacter);
}
代码示例来源:origin: CogComp/cogcomp-nlp
public Option<String> getLemma(TextAnnotation ta, int tokenId) {
String pos = WordHelpers.getPOS(ta, tokenId);
String token = ta.getToken(tokenId).toLowerCase();
String lemma = WordHelpers.getLemma(ta, tokenId);
if (have && WordHelpers.getLemma(ta, tokenId + 1).equals("be")) {
predicate = false;
if ((have || doVerb) && POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 1)))
predicate = false;
&& POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 2)))
predicate = false;
代码示例来源:origin: CogComp/cogcomp-nlp
public static String getPOS(TextAnnotation ta, int tokenId) {
return getTokenLabel(ta, tokenId, ViewNames.POS);
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static List<String> getSynset(TextAnnotation ta, int tokenId, WordNetManager wnManager)
throws JWNLException {
String word = getWord(ta, tokenId).toLowerCase();
String wordPOS = getPOS(ta, tokenId);
if (POSUtils.isPOSOpenSet(wordPOS)) {
POS wnPos = getWNPOS(wordPOS);
return wnManager.getSynonyms(word, wnPos, false);
} else {
return new ArrayList<>();
}
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static Constituent isTrigramPrep(TextAnnotation ta, int tokenId, String viewName) {
String word = WordHelpers.getWord(ta, tokenId);
if (tokenId < ta.size() - 2) {
String nextWord = WordHelpers.getWord(ta, tokenId + 1);
String nextNextWord = WordHelpers.getWord(ta, tokenId + 2);
if (mwPrepositionsList.contains(word + " " + nextWord + " " + nextNextWord))
return new Constituent("", viewName, ta, tokenId, tokenId + 3);
}
return null;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-verbsense
public Option<String> getLemma(TextAnnotation ta, int tokenId) {
String pos = WordHelpers.getPOS(ta, tokenId);
String token = ta.getToken(tokenId).toLowerCase();
String lemma = WordHelpers.getLemma(ta, tokenId);
if (have && WordHelpers.getLemma(ta, tokenId + 1).equals("be")) {
predicate = false;
if ((have || doVerb) && POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 1)))
predicate = false;
&& POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 2)))
predicate = false;
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public static String getPOS(TextAnnotation ta, int tokenId) {
return getTokenLabel(ta, tokenId, ViewNames.POS);
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
private static String getSafePOS(TextAnnotation ta, int wordPosition) {
String pos = WordHelpers.getPOS(ta, wordPosition);
if (pos.length() == 0)
pos = "*";
return pos;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-prep-srl
public static boolean isPrep(TextAnnotation ta, int tokenId) {
String pos = WordHelpers.getPOS(ta, tokenId);
String word = WordHelpers.getWord(ta, tokenId);
String lowerCase = word.toLowerCase().trim();
boolean validPreposition = prepositions.contains(lowerCase);
boolean isPrepositionPOS = POSUtils.isPOSPreposition(pos);
// we need to consider the case of "to + verb"
boolean isToVP = false;
if (tokenId < ta.size() - 1) {
if (lowerCase.equals("to") && POSUtils.isPOSVerb(WordHelpers.getPOS(ta, tokenId + 1)))
isToVP = true;
}
return validPreposition && (isPrepositionPOS && !isToVP);
}
代码示例来源:origin: CogComp/cogcomp-nlp
public static List<String> getHypernymsMostFrequentSense(TextAnnotation ta, int tokenId,
WordNetManager wnManager) throws JWNLException {
String word = getWord(ta, tokenId).toLowerCase();
String wordPOS = getPOS(ta, tokenId);
if (POSUtils.isPOSOpenSet(wordPOS)) {
POS wnPos = getWNPOS(wordPOS);
return wnManager.getHypernyms(word, wnPos, false);
} else {
return new ArrayList<>();
}
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public static boolean isCapitalized(TextAnnotation ta, int tokenId) {
String word = getWord(ta, tokenId);
String firstCharacter = word.substring(0, 1);
String upperCase = firstCharacter.toUpperCase();
return upperCase.matches("[A-Z]") && upperCase.equals(firstCharacter);
}
代码示例来源:origin: CogComp/cogcomp-nlp
private static String getSafeLemma(TextAnnotation ta, int wordPosition) {
String lemma = WordHelpers.getLemma(ta, wordPosition);
if (lemma.length() == 0)
lemma = "*";
return lemma;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public static String getLemma(TextAnnotation ta, int tokenId) {
return getTokenLabel(ta, tokenId, ViewNames.LEMMA).toLowerCase();
}
代码示例来源:origin: CogComp/cogcomp-nlp
@Override
public Boolean transform(Constituent input) {
TextAnnotation ta = input.getTextAnnotation();
boolean found = false;
for (int i = input.getStartSpan(); i < input.getEndSpan(); i++) {
if (WordHelpers.getPOS(ta, i).equals("MD")) {
found = true;
break;
}
}
return found;
}
};
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-srl
String[] pos = new String[ta.size()];
for (int i = 0; i < ta.size(); i++) {
form[i] = WordHelpers.getWord(ta, i);
pos[i] = WordHelpers.getPOS(ta, i);
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public static List<String> getHypernymsMostFrequentSense(TextAnnotation ta, int tokenId,
WordNetManager wnManager) throws JWNLException {
String word = getWord(ta, tokenId).toLowerCase();
String wordPOS = getPOS(ta, tokenId);
if (POSUtils.isPOSOpenSet(wordPOS)) {
POS wnPos = getWNPOS(wordPOS);
return wnManager.getHypernyms(word, wnPos, false);
} else {
return new ArrayList<>();
}
}
本文整理了Java中edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers.getPOS()方法的一些代码示例,展示了WordHelpe
本文整理了Java中edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers.getLemma()方法的一些代码示例,展示了WordHel
本文整理了Java中edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers.getWord()方法的一些代码示例,展示了WordHelp
我是一名优秀的程序员,十分优秀!