pl.edu.icm.model.bwmeta.y.YElement.getTagList()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.getTagList()方法的一些代码示例,展示了YElement.getTagList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.getTagList()方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:getTagList

YElement.getTagList介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

protected void convertKeywords(YElement yElement, BibEntry bibEntry) {
  YTagList tagList = yElement.getTagList(YConstants.TG_KEYWORD);
  List<String> keywordsList = new ArrayList<String>();
  if (tagList != null) {
    keywordsList = tagList.getValues();
    StringBuilder bibEntryKeywords = new StringBuilder();
    for (int i = 0; i < keywordsList.size() - 1; i++) {
      bibEntryKeywords.append(keywordsList.get(i));
      bibEntryKeywords.append("; ");
    }
    bibEntryKeywords.append(keywordsList.get(keywordsList.size() - 1));
    bibEntry.setField(BibEntry.FIELD_KEYWORDS, bibEntryKeywords.toString());
  }
}

代码示例来源: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-cli

ArrayList<KeyPhraseStats> getKeyPhrasesFromElement(YElement el) {
  if (el.getTagList(YConstants.TG_KEYWORD) == null) {
    return null;
  for (String s : el.getTagList(YConstants.TG_KEYWORD).getValues()) {
    String t = normalize(s);
    KeyPhraseStats stat = stats.get(t);

代码示例来源:origin: pl.edu.icm.yadda/yadda-cli

ArrayList<KeyPhraseStats> getKeyPhrases(YElement el) {
  if (el.getTagList(YConstants.TG_KEYWORD) == null) {
    return null;
  for (String s : el.getTagList(YConstants.TG_KEYWORD).getValues()) {
    String t = normalize(s);
    KeyPhraseStats stat = stats.get(t);

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected void fillRights(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //copyrigths
  //rights
  if (yElement.getOneAttributeSimpleValue(CommonAttributeTypes.AT_COPYRIGHT_HOLDER) != null) {
    if (!ret.containsKey(E_RIGHTS)) {
      ret.put(E_RIGHTS, new ArrayList<StringWithAttributes>());
    }
    ret.get(E_RIGHTS).add(new StringWithAttributes(yElement.getOneAttributeSimpleValue(CommonAttributeTypes.AT_COPYRIGHT_HOLDER)));
  }
  //From synat;) 
  YTagList licenses = yElement.getTagList("License");
  if (licenses != null) {
    for (String licenseText : licenses.getValues()) {
      if (!ret.containsKey(E_RIGHTS)) {
        ret.put(E_RIGHTS, new ArrayList<StringWithAttributes>());
      }
      StringWithAttributes swa = new StringWithAttributes(licenseText);
      if (licenses.setLanguage(YLanguage.Sandawe) != null && StringUtils.isNotBlank(licenses.getLanguage().getShortCode())) {
        swa.addAttribute("lang", licenses.getLanguage().getShortCode());
      }
      ret.get(E_RIGHTS).add(swa);
    }
  }
}

相关文章