- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers.getWord()
方法的一些代码示例,展示了WordHelpers.getWord()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordHelpers.getWord()
方法的具体详情如下:
包路径:edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers
类名称:WordHelpers
方法名:getWord
暂无
代码示例来源: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 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-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: edu.illinois.cs.cogcomp/illinois-prep-srl
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: CogComp/cogcomp-nlp
public static Constituent isBigramPrep(TextAnnotation ta, int tokenId, String viewName) {
String word = WordHelpers.getWord(ta, tokenId);
if (tokenId < ta.size() - 1) {
String nextWord = WordHelpers.getWord(ta, tokenId + 1);
if (mwPrepositionsList.contains(word + " " + nextWord))
return new Constituent("", viewName, ta, tokenId, tokenId + 2);
}
return null;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-prep-srl
public static Constituent isBigramPrep(TextAnnotation ta, int tokenId, String viewName) {
String word = WordHelpers.getWord(ta, tokenId);
if (tokenId < ta.size() - 1) {
String nextWord = WordHelpers.getWord(ta, tokenId + 1);
if (mwPrepositionsList.contains(word + " " + nextWord))
return new Constituent("", viewName, ta, tokenId, tokenId + 2);
}
return null;
}
代码示例来源: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: 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<>();
}
}
代码示例来源: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-coref-ace
public static boolean isPreviousWordEqual(Constituent m, String[] strs, boolean caseSensitive){
for(String s: strs){
if(!caseSensitive)
s = s.toLowerCase();
String[] split = s.split(" ");
int size = split.length;
boolean find = true;
for(int k = 0; k < size; k++){
if(m.getStartSpan()-size>=0){
String pword = WordHelpers.getWord(m.getTextAnnotation(), m.getStartSpan()-size+k);
if(!caseSensitive)
pword = pword.toLowerCase();
if(!pword.equals(split[k]))
find = false;
}
else
find = false;
}
if(find)
return true;
}
return false;
}
public static void saveObject(String fileName, Object obj){
代码示例来源: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 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/LBJCoref
public static boolean isPreviousWordEqual(Constituent m, String[] strs, boolean caseSensitive){
for(String s: strs){
if(!caseSensitive)
s = s.toLowerCase();
String[] split = s.split(" ");
int size = split.length;
boolean find = true;
for(int k = 0; k < size; k++){
if(m.getStartSpan()-size>=0){
String pword = WordHelpers.getWord(m.getTextAnnotation(), m.getStartSpan()-size+k);
if(!caseSensitive)
pword = pword.toLowerCase();
if(!pword.equals(split[k]))
find = false;
}
else
find = false;
}
if(find)
return true;
}
return false;
}
public static void saveObject(String fileName, Object obj){
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public static List<String> getSynsetMostFrequentSense(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, true);
} else {
return new ArrayList<>();
}
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
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 List<String> getSynsetMostFrequentSense(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, true);
} else {
return new ArrayList<>();
}
}
代码示例来源: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: edu.illinois.cs.cogcomp/illinois-edison
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: edu.illinois.cs.cogcomp/LBJCoref
public static boolean isAfterWordEqual(Constituent m, String[] strs, boolean caseSensitive){
for(String s: strs){
if(!caseSensitive)
s = s.toLowerCase();
String[] split = s.split(" ");
int size = split.length;
boolean find = true;
for(int k = 0; k < size; k++){
if(m.getEndSpan()+size <= m.getTextAnnotation().getTokens().length) {
String pword =WordHelpers.getWord(m.getTextAnnotation(), m.getEndSpan()+k);
if(!caseSensitive)
pword = pword.toLowerCase();
if(!pword.equals(split[k]))
find = false;
}
else
find = false;
}
if(find)
return true;
}
return false;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-coref-ace
public static boolean isRefenentialMention(Constituent c) {
if (invalidMentionFile == null)
return true;
if (invalidMentionReference == null)
invalidMentionReference = loadInvalidReference(invalidMentionFile);
String headWord = WordHelpers.getWord(c.getTextAnnotation(), DocTextAnnotation.getRobustHeadWordPosition(c));
if(querryRefentialMention(c.getSurfaceString(),c))
return false;
if(!Character.isUpperCase(headWord.charAt(0)) && querryRefentialMention("|"+headWord+"|",c))
return false;
TextAnnotation ta = c.getTextAnnotation();
if (c.getStartSpan() > 0) {
String pWord = WordHelpers.getWord(ta, c.getStartSpan() - 1);
if(querryRefentialMention(pWord+"[" + c.getSurfaceString() + "]",c))
return false;
if(querryRefentialMention(pWord+"|"+headWord+"|",c))
return false;
}
if (c.getEndSpan() <= ta.getTokens().length - 1) {
String nWord = WordHelpers.getWord(ta, c.getStartSpan() + 1);
if(querryRefentialMention("[" + c.getSurfaceString() + "]"+ nWord,c))
return false;
if(querryRefentialMention("|"+headWord+"|"+nWord,c))
return false;
}
return true;
}
link-to帮助程序返回以下错误: Uncaught Error: each doesn't match link-to - 5:10 模板:
默认情况下,ember-cli 生成的帮助程序如下所示: import Ember from 'ember'; export function boundLoc(input) { return i
我正在发现 .Net Core 标签助手,我只是想知道是否有任何标签助手可以复制 @Html.DisplayFor。我认为 label tag helper 复制了 @Html.DisplayName
在本地访问我的 Rails 应用程序时,加载任何页面时出现以下错误: /!\ FAILSAFE /!\ Tue Jul 06 15:08:17 -0500 2010 Status: 500 Inte
m.ResetDayComponent.WeightedAverageMethodID, DropDownData.AveragingMethodList(), "", new { @class =
我正在使用 yii\helpers\Url 助手来访问我网站的菜单中的 url。但是应该有一个 url 去另一个网站,比如 www.anothersite.com/action . 如何通过 yii\
我不确定这是否可能。 我有一堆@Helper位于 View 内以及其他 View 中: @helper ViewHelper1() { ... } @helper ViewHelper2() {
有没有办法在 @helper 声明中访问完整的 @Url 帮助程序对象? 我想做这样的事情...... @helper Button(System.Web.Mvc.ActionResult actio
ASP.Net MVC 6 引入了标签助手功能。 为什么我们应该使用标签助手而不是以前版本提供的 Helper 类? 最佳答案 引入标签助手有几个原因。 Scott Hanselman talks i
我正在尝试从我的 ember.js 应用程序中的另一个助手调用助手,但不知道 blazes 在 2.x 中如何执行此操作。作为引用,我使用 Ember 2.4 和 Ember-CLI。 有几个答案在旧
我想在 Twitter 意图按钮上使用一个图标。 "btn" %> 这可能吗? 页面上还有 2 个其他按钮使用 button_tag 助手,我可以将图标插入到这些按钮中。我应该将 button_to
我一直在基于 Scott Gu's post 在 Razor 中实现一些 @helper 函数,事情进展顺利。 但我想知道的是,是否可以从另一个调用一个 @helper。例如,我有以下助手显示 Dat
我需要创建自定义 html 辅助方法。据我所知有两种方式: 使用@helper razor 语法。 http://weblogs.asp.net/scottgu/archive/2011/05/12/
我刚刚从另一台计算机上克隆了一个我正在使用的存储库。当我尝试通过运行“rake db:migrate”进行数据库迁移时,出现以下错误: AbstractController::Helpers::Mis
我的助手是这样工作的: def some_help(in_string) in_string + " and more" end 但我希望它在输出之前对 执行操作,并且我一直按字面意思获取 字符本
除了在 .Net Core 2 中,我正在尝试解决这个问题。 Can I use a Tag Helper in a custom Tag Helper that returns html? ” 我想
是否可以在另一个 View 助手中使用 View 助手?我们必须查看助手: 帮助我1 use Zend\View\Helper\AbstractHelper; class HelpMe1 extend
Creating MVC3 Razor Helper like Helper.BeginForm() 说它可以使用扩展方法和实现 IDisposable 来完成。可以通过使用声明性 Razor 助手来
所以如果我有一个模板: {{foo}} 和模板助手: Template.myTemplate.foo = function() { blah = Session.get('blah');
我正在尝试为我的 Reddit 机器人运行代码。它可以毫无问题地登录 Reddit,但是当它到达这段代码时,它会抛出一个错误: all_comments = praw.helpers.flatten_
我是一名优秀的程序员,十分优秀!