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

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

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

YName.setText介绍

暂无

代码示例

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

@SuppressWarnings({ "rawtypes", "unchecked" })
private static YElement correctContentByPhantomRemoval(YElement yelement) {
  LinkedList<YContentEntry> ycel = new LinkedList<YContentEntry>();
  for(YContentEntry yce : yelement.getContents()){
    LinkedList<YName> ynl = new LinkedList<YName>();
    for(YName yn : (List<YName>)(yce.getNames())){
      List<Part> lp = putNameNodesIntoLeafs(yn.getRichText().toParts());
      if(lp.size()>0){
        yn.setText(new YRichText(lp));
        ynl.add(yn);
      }
    }
    if(ynl.size()>0){
      yce.setNames(ynl);
      ycel.add(yce);
    }
  }
  yelement.setContents(ycel);
  return yelement;
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  String partNumber = element.getStructures().get(0).getCurrent().getPosition();
  if(StringUtils.isNotBlank(partNumber)){
    String id = ancestors.get(ancestors.size() - 1).getId() + "-p-" + partNumber;
    id = WileyUtils.processId(id);
    element.setId(id);
  }
  if (element.getNames().size() == 1) {
    YName name = YModelUtils.fetchDefaultName(element);
    if(StringUtils.equals(NameTypes.NM_ALTERNATIVE, name.getType()) && StringUtils.isNotBlank(partNumber)){
      name.setText(BaseYModelUtils.buildRichText(name.getText() + StringUtils.SPACE + partNumber));
    }
    name.setType(NameTypes.NM_CANONICAL);
  }
}

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

@SuppressWarnings({ "rawtypes", "unchecked" })
  private static YElement correctContentByPhantomRemoval(YElement yelement) {
    LinkedList<YContentEntry> ycel = new LinkedList<YContentEntry>();
    int i =0;
    for(YContentEntry yce : yelement.getContents()){
      i++;
//            if(i==6){
//                System.out.println();
//            }
      LinkedList<YName> ynl = new LinkedList<YName>();
      for(YName yn : (List<YName>)(yce.getNames())){
        List<Part> lp = putNameNodesIntoLeafs(yn.getRichText().toParts());
        if(lp.size()>0){
          yn.setText(new YRichText(lp));
          ynl.add(yn);
        }
      }
      if(ynl.size()>0){
        yce.setNames(ynl);
        ycel.add(yce);
      }
    }
    yelement.setContents(ycel);
    return yelement;
  }

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

protected List<YContributor> parseBibEntryPersons(List<String> persons, String role) {
  List<YContributor> yContributorList = new ArrayList<YContributor>();
  for (String person : persons) {
    YContributor yContributor = new YContributor();
    yContributor.setPerson(true);
    yContributor.setRole(role);
    yContributor.addName(new YName().setType(YConstants.NM_CANONICAL).setText(person));
    String[] split = person.split(", ");
    if (split.length > 0) {
      yContributor.addName(new YName().setType(YConstants.NM_SURNAME).setText(split[0]));
    }
    if (split.length > 1) {
      yContributor.addName(new YName().setType(YConstants.NM_FORENAMES).setText(split[1]));
    }
    if (split.length > 2) {
      yContributor.addName(new YName().setType(YConstants.NM_SUFFIX).setText(split[2]));
    }
    yContributorList.add(yContributor);
  }
  return yContributorList;
}

代码示例来源:origin: pl.edu.icm.synat/synat-process-common

name.setText(cleared.trim());
modify = true;

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

private static YElement putNameNodesIntoLeafs(YElement yelement) {
  for(YName yn : yelement.getNames()){
    YRichText yrt = new YRichText(putNameNodesIntoLeafs(yn.getRichText().toParts()));
    yn.setText(yrt);
  }
  return yelement;
}

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

private static void putAuthor(YElement element, String author, List<String> refs) {
  author = author.replaceAll(" +\\.", ".");
  YName name = new YName().setType(YConstants.NM_CANONICAL).setText(author);
  YContributor contributor = new YContributor().setRole(YConstants.CR_AUTHOR).addName(name);
  for (String ref : refs) {
    if (ref.equals("*") || ref.equals("†")) {
      // Currently nothing is done
    } else {
      String id = Enhancers.affiliationIdFromIndex(ref);
      if (element.getAffiliation(id) != null) {
        contributor.addAffiliationRef(id);
      }
    }
  }
  element.addContributor(contributor);
}

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

private static YElement putNameLeafsIntoNodes(YElement yelement) {
  for(YName yn : yelement.getNames()){
    YRichText yrt = new YRichText(putLeafsIntoNodes(yn.getRichText().toParts()));
    yn.setText(yrt);
  }
  return yelement;
}

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

private static YElement putNameNodesIntoLeafs(YElement yelement) {
  for(YName yn : yelement.getNames()){
    YRichText yrt = new YRichText(putNameNodesIntoLeafs(yn.getRichText().toParts()));
    yn.setText(yrt);
  }
  return yelement;
}

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

private static YElement putNameLeafsIntoNodes(YElement yelement) {
  for(YName yn : yelement.getNames()){
    YRichText yrt = new YRichText(putLeafsIntoNodes(yn.getRichText().toParts()));
    yn.setText(yrt);
  }
  return yelement;
}

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

private static void putEditor(YElement element, String editor) {
  YName name = new YName().setType(YConstants.NM_CANONICAL).setText(editor);
  YContributor contributor = new YContributor().setRole(YConstants.CR_EDITOR).addName(name);
  element.addContributor(contributor);
}

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

for(YName n : zblc.getNames()){
  if ("canonical".equals(n.getType())){
    n.setText(NameProceeder.unifyCanonical(n.getText()));
  }else if ("forenames".equals(n.getType())){
    n.setText(NameProceeder.unifyForenames(n.getText()));
  }else if ("forename".equals(n.getType())){
    n.setText(NameProceeder.unifyForenames(n.getText()));
  }else if ("surname".equals(n.getType())){
    n.setText(NameProceeder.unifySurname(n.getText()));
for(YName n : nc.getNames()){
  if ("canonical".equals(n.getType())){
    n.setText(NameProceeder.unifyCanonical(n.getText()));
  }else if ("forenames".equals(n.getType())){
    n.setText(NameProceeder.unifyForenames(n.getText()));
  }else if ("forename".equals(n.getType())){
    n.setText(NameProceeder.unifyForenames(n.getText()));
  }else if ("surname".equals(n.getType())){
    n.setText(NameProceeder.unifySurname(n.getText()));

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

public void convertContributors(BibEntry source, YElement yElement) {
  List<YContributor> yContributors = new ArrayList();
  //authors
  List<YContributor> yAuthors = parseBibEntryPersons(source.getAllFieldValues(BibEntry.FIELD_AUTHOR), YConstants.CR_AUTHOR);
  //editors
  List<YContributor> yEditors = parseBibEntryPersons(source.getAllFieldValues(BibEntry.FIELD_EDITOR), YConstants.CR_EDITOR);
  yContributors.addAll(yAuthors);
  yContributors.addAll(yEditors);
  //publisher
  if (source.getFirstFieldValue(BibEntry.FIELD_ADDRESS) != null
      && source.getFirstFieldValue(BibEntry.FIELD_PUBLISHER) != null) {
    String publisher = source.getFirstFieldValue(BibEntry.FIELD_PUBLISHER);
    String address = source.getFirstFieldValue(BibEntry.FIELD_ADDRESS);
    YContributor yPublisher = new YContributor();
    yPublisher.setRole(YConstants.CR_PUBLISHER);
    yPublisher.addName(new YName().setType(YConstants.NM_CANONICAL).setText(publisher));
    yPublisher.addAttribute(YConstants.AT_ADDRESS_CITY, address);
    yContributors.add(yPublisher);
  }
  yElement.setContributors(yContributors);
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

private static void buildPersonContributor(YContributor cont, Object name) {
  PersonName pn = (PersonName) name;
  for (Object o : pn.getGivenNamesOrFamilyNamePrefixOrFamilyName()) {
    if (o instanceof GivenNames) {
      YName nam = new YName();
      nam.setType(NameTypes.NM_FORENAMES);
      nam.setText(((GivenNames) o).getvalue());
      cont.addName(nam);
    } else if (o instanceof FamilyName) {
      YName nam = new YName();
      nam.setType(NameTypes.NM_SURNAME);
      nam.setText(((FamilyName) o).getvalue());
      cont.addName(nam);
    } else if (o instanceof FamilyNamePrefix) {
      cont.addAttribute(WileyComponentConstants.WILEY_ATT_FAMILY_NAME_PREFIX, ((FamilyNamePrefix) o).getvalue().trim());
    }
  }
  if (pn.getNameSuffix() != null) {
    YName nam = new YName();
    nam.setType(NameTypes.NM_SUFFIX);
    nam.setText(pn.getNameSuffix().getvalue());
    cont.addName(nam);
  }
  cont.setInstitution(false);
}

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

YName name = new YName();
  name.setType(NameTypes.NM_FORENAMES);
  name.setText(personName.getGivenName());
  contributor.addName(name);
  YName name = new YName();
  name.setType(NameTypes.NM_SURNAME);
  name.setText(personName.getSurname());
  contributor.addName(name);
  name.setText(personName.getGivenName() + SPACE + personName.getSurname());
  contributor.addName(name);
if (StringUtils.isNotBlank(organization.getValue())) {
  YName name = new YName();
  name.setText(organization.getValue());
  contributor.addName(name);

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

name.setText(prepareFileName(element, format));
ocrContent.addName(name);

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

YContributor ycont = new YContributor();
if (StringUtils.isNotBlank(aut.getForenames())) {
  ycont.addName(new YName().setText(aut.getForenames()).setType(NameTypes.NM_FORENAMES));
  ycont.addName(new YName().setText(aut.getSurname()).setType(NameTypes.NM_SURNAME));

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

.setText(xmc.getArticle().getJournal().getPubDate().getYear())
.setLanguage(YLanguage.NoLinguisticContent)
.setType(NameTypes.NM_CANONICAL));

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

.setText(volumevalue)
.setLanguage(YLanguage.NoLinguisticContent)
.setType(NameTypes.NM_CANONICAL));

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

.setText(issuevalue)
.setLanguage(YLanguage.NoLinguisticContent)
.setType(NameTypes.NM_CANONICAL));

相关文章