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

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

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

YElement.addAffiliation介绍

暂无

代码示例

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

private static void putAffiliation(YElement element, String text, String ref) {
  text = text.replaceFirst(" and$", "").replaceFirst("\\S+@.*$", "").replaceFirst("[Ee]mails?:.*$", "");
  text = text.replaceFirst("[Ee]-[Mm]ails?:.*$", "").trim().replaceFirst("[\\.,;]$", "");
  YAffiliation affiliation = new YAffiliation(Enhancers.affiliationIdFromIndex(ref), text);
  element.addAffiliation(affiliation);
}

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

public static YAffiliation getOrCreateAffiliation(YElement element, String id) {
  YAffiliation affiliation = element.getAffiliation(id);
  if (affiliation == null) {
    affiliation = new YAffiliation().setId(id);
    element.addAffiliation(affiliation);
  }
  return affiliation;
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

public ArticleBuilder setAuthors(Map<Integer, PersonInfoViewObject> personsMap) {
  List<YContributor> contributors = new ArrayList<>();
  for (Map.Entry<Integer, PersonInfoViewObject> entry : personsMap.entrySet()) {
    PersonInfoViewObject personViewObject = entry.getValue();
    YContributor author = new YContributor(YConstants.CR_AUTHOR, false);
    author.setNames(extractPersonYNames(personViewObject));
    final List<String> affiliationNames = personViewObject.getAffiliations();
    Boolean isCorrespondingAuthor = personViewObject.getCorrespondingAuthor();
    boolean addCorrespondenceAff = isCorrespondingAuthor != null ? isCorrespondingAuthor : false;
    if (CollectionUtils.isNotEmpty(affiliationNames)) {
      for (String affiliationName : affiliationNames) {
        if (StringUtils.isNotBlank(affiliationName)) {
          final String affiliationId = UUID.randomUUID().toString();
          YAffiliation affiliation = new YAffiliation(affiliationId, affiliationName);
          author.addAffiliationRef(affiliationId);
          article.addAffiliation(affiliation);
          if (addCorrespondenceAff) {
            author.addAttribute(CommonAttributeTypes.AT_CORRESPONDENCE, affiliationName);
            addCorrespondenceAff = false;
          }
        }
      }
    }
    author.addAttribute(extractEmailAttributes(personViewObject));
    contributors.add(author);
  }
  article.setContributors(contributors);
  return this;
}

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

public void updateElementAuthors(org.jdom.Element ameta, YElement article) {
  List<YAffiliation> affs=extractAllAffiliations(ameta);
  for (YAffiliation aff:affs) {
    article.addAffiliation(aff);
          cont.addAffiliationRef(a);
        article.addContributor(cont).addAffiliation(y.affiliation(aref, address));
      } else {
        YContributor cont=new YContributor(ContributorRoles.CR_OTHER, false)
          cont.addAffiliationRef(a);
        article.addContributor(cont).addAffiliation(y.affiliation(aref, address));

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

num++;
        YAffiliation aff = new YAffiliation(affid, inName.getName());
        article.addAffiliation(aff);
        nameAffID.put(inName.getName(), affid);
        ycont.addAffiliationRef(affid);
article.addAffiliation(aff);

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

cont.addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));
} else {
  YContributor cont= new YContributor(ContributorRoles.CR_OTHER, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, (defName).trim()));
      cont.addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));

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

if (element.getAffiliation(affiliationRef) == null) {
  YAffiliation yAffiliation = new YAffiliation(affiliationRef, affiliation);
  element.addAffiliation(yAffiliation);

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

if (contributorRoles.contains(ctValue)) {
  article.addContributor(
      new YContributor(ctValue, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, canonicalName)).addName(y.name(YLanguage.NoLinguisticContent, surname, NM_SURNAME)).addName(y.name(YLanguage.NoLinguisticContent, forenames, NM_FORENAMES)).addAttribute(AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));
} else {
  article.addContributor(
      new YContributor(YConstants.CR_OTHER, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, canonicalName)).addName(y.name(YLanguage.NoLinguisticContent, surname, NM_SURNAME)).addName(y.name(YLanguage.NoLinguisticContent, forenames, NM_FORENAMES)).addAttribute(AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

yElement.addAffiliation(affTransformer.transform(aff));

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

for(String aff:affiliations){
  t=t+1;
  article.addAffiliation(new YAffiliation()
  .setText(aff)
  .setId("aff"+t));

相关文章