本文整理了Java中pl.edu.icm.model.bwmeta.y.YTagList.size()
方法的一些代码示例,展示了YTagList.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YTagList.size()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YTagList
类名称:YTagList
方法名:size
暂无
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements, YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
if (articles.size() == 0) {
return null;
}
if (articles.size() > 1) {
log.error("More than one article found in package of yelements!");
}
YElement article = articles.get(0);
YTagList kwList = article.getTagList(YConstants.TG_KEYWORD);
if (kwList == null || kwList.size()==0) {
return null;
}
StringBuilder keywords = new StringBuilder();
for (String kw: kwList.getValues()) {
keywords.append(kw);
keywords.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
}
return keywords.toString();
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
void compare(YElement expected, YElement actual, EvalResult result) {
Map<String, List<String>> actTagLists = new HashMap<String, List<String>>();
for (YTagList yTagList : actual.getTagLists()) {
String type = yTagList.getType();
List<String> values = yTagList.getValues();
actTagLists.put(type, values);
}
for (YTagList yTagList : expected.getTagLists()) {
String type = yTagList.getType();
if (actTagLists.containsKey(type)) {
compareLists(yTagList.getValues(), actTagLists.get(type), type, result);
actTagLists.remove(type);
} else {
result.append(type, ResultStatus.FAILED, yTagList.size());
}
}
for (String type : actTagLists.keySet()) {
result.append(type, ResultStatus.REDUNDANT, actTagLists.get(type).size());
}
}
},
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private void updateKeywords(YElement article, org.jdom.Element kg) {
YTagList kwds = new YTagList(YLanguage.English, TagTypes.TG_KEYWORD);
List<org.jdom.Element> ks = JDOMHelper.getChildren(kg, "kwd");
for (org.jdom.Element k : ks) {
kwds.addValue(JDOMHelper.textOfElement(k));
}
Attribute kwdLang = kg.getAttribute("lang", Namespace.XML_NAMESPACE);
YLanguage lang = extractYLanguage(kwdLang);
if (lang != null) {
kwds.setLanguage(lang);
}
if (kwds.size() > 0) {
// System.out.println("[NlmToYTransformer] Adding keywords");
article.addTagList(kwds);
}
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
if (kwds.size() > 0) {
article.addTagList(kwds);
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
if (kwds.size() > 0) {
article.addTagList(kwds);
内容来源于网络,如有侵权,请联系作者删除!