gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 17:26:40 25 4
gpt4 key购买 nike

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

YCurrent.getPosition介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

public static String articlePosition(YElement element) {
  String position = null;
  YStructure anc = element.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL);
  if (anc != null) {
    YCurrent cAnc = anc.getCurrent();
    if (cAnc != null && !StringUtils.isEmpty(cAnc.getPosition()))
      position = cAnc.getPosition();
  }
  return position;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

@Deprecated
private String getPosition(YElement element) {
  String position = null;
  for(YStructure structure : element.getStructures()) {
    YCurrent current = structure.getCurrent();
    position = current.getPosition();
    if(position != null) {
      break;
    }
  }
  return position;
}

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

protected void fillJournalPages(HtmlMetaHeaders metadata, YStructure yJournalStructure) {
  YCurrent journalCurrent = yJournalStructure.getCurrent();
  if (journalCurrent != null) {
    String position = journalCurrent.getPosition();
    if (position.contains("-")) {
      metadata.addMetadataName(WP_FIRST_PAGE, position.substring(0, position.indexOf('-')));
      if (position.indexOf('-') != position.length() - 1) {
        metadata.addMetadataName(WP_LAST_PAGE, position.substring(position.indexOf('-') + 1));
      }
    } else if (StringUtils.isNotBlank(position)) {
      metadata.addMetadataName(WP_FIRST_PAGE, position);
    }
  }
}

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

public String getPosition(YElement yElement){
  YStructure structure = yElement.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL);
  YCurrent current = structure.getCurrent();
  return current.getPosition();
}

代码示例来源: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);
  YStructure structure = article.getStructure(YConstants.EXT_HIERARCHY_JOURNAL);
  if (structure == null) {
    return null;
  }
  YCurrent curr = structure.getCurrent();
  if (curr == null) {
    return null;
  }
  
  return YElementsParsingToolbox.removeEmptyValues(curr.getPosition());
}

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

public static String pages(final YElement element) {
  final YCurrent current = yCurrentInJournalHierarchy(element);
  String result = current.getPosition();
  if (StringUtils.isEmpty(result)) {
    // try to get it from description
    final String bibDesc = element.getOneAttributeSimpleValue("bibliographical.description");
    if (StringUtils.isNotEmpty(bibDesc)) {
      final int[] position = PositionMatcher.match(bibDesc);
      if (position != null && position.length == 2) {
        if (position[0] == position[1]) {
          result = Integer.toString(position[0]);
        } else {
          result = position[0] + "-" + position[1];
        }
      } else {
        final Pattern p = Pattern.compile("\\d");
        final Matcher m = p.matcher(bibDesc);
        if (m.find()) {
          log.warn("Unable to extract pages from description ({}):{}", element.getId(), bibDesc);
        }
      }
    }
  }
  return result;
}

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

private PositionExtractor getPosition(YElement element) {
  String position = null;
  List<YStructure> yStrictures = element.getStructures();
  for(YStructure structure : yStrictures){
    YCurrent current = structure.getCurrent();
    position = current.getPosition();
    if(position!=null){
      break;
    }
  }
  
  return new PositionExtractor(position);
}

代码示例来源: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.synat/synat-portal-core

private Map<String, AncestorData> extractHierarchy(YElement yElement) {
  Map<String, AncestorData> result = new HashMap<String, AncestorData>();
  for (final String hierarhyId : YModelUtils.ALLOWED_HIERARCHY_ID) {
    YStructure yStructure = yElement.getStructure(hierarhyId);
    if (yStructure != null) {
      for (YAncestor ancestor : yStructure.getAncestors()) {
        if (ResourceDataConstants.MAP_ANCESTOR_TYPE_TO_LEVEL.containsValue(ancestor.getLevel())) {
          final YName ancestorName = ancestor.getOneName();
          if (ancestorName != null) {
            result.put(ResourceDataConstants.MAP_ANCESTOR_TYPE_TO_LEVEL.inverse().get(ancestor.getLevel()),
                new AncestorData().setId(ancestor.getIdentity()).setName(ancestorName.getText()));
          }
        }
      }
      YCurrent current = yStructure.getCurrent();
      if(current!=null && StringUtils.isNotBlank(current.getPosition())){
        result.put(ResourceDataConstants.ANCESTOR_LEVEL_NAME_PAGES, new AncestorData().setName(current.getPosition()));
      }
    }
  }
  return result;
}

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

if(ha != null && ha.getPosition()!=null){
  if(ha.getPosition().length()!=0)
    text.append("journal_pages2:"+ha.getPosition());

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

private List<StructureData> prepareStructure(YElement yElement, String hierarchy, String[] levels, String... topLevelIds) {
  List<String> topLevels = Arrays.asList(topLevelIds);
  String topId = null;
  String topLevelId = null;
  List<StructureData> ancestors = new ArrayList<StructureData>();
  final YStructure structure = yElement.getStructure(hierarchy);
  if (structure != null) {
    ListMultimap<String, YAncestor> mappedAncestors = getMappedAncestors(structure.getAncestors());
    for (String level : levels) {
      final YAncestor ancestor = getAncestor(mappedAncestors, level);
      if (ancestor != null && ArrayUtils.contains(StructureData.LEVELS_ALLOWED, ancestor.getLevel())) {
        if (topLevels.contains(ancestor.getLevel())) {
          topId = ancestor.getIdentity();
          topLevelId = ancestor.getLevel();
          ancestors.add(new StructureData(ancestor.getIdentity(), YModelUtils.getDefaultName(ancestor), ancestor.getLevel(), topId, topLevelId));
        } else {
          ancestors.add(new StructureData(ancestor.getIdentity(), IndexUtils.encodeNameValue(YModelUtils.getDefaultName(ancestor)),
              ancestor.getLevel(), topId, topLevelId));
        }
      }
    }
    if (StringUtils.isNotBlank(structure.getCurrent().getPosition())
        && ArrayUtils.contains(StructureData.ALLOWED_LEVELS_OF_CURRENT_POSITION, structure.getCurrent().getLevel())) {
      ancestors.add(new StructureData(null, structure.getCurrent().getPosition()));
    }
  }
  return ancestors;
}

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

if(ha != null && ha.getPosition()!=null){
  if(ha.getPosition().length()!=0) paos_doc.add(new PredicateAndObject(RelConstants.RL_PAGES, ha.getPosition()));

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

if(ha != null && ha.getPosition()!=null){
  if(ha.getPosition().length()!=0) paos_doc.add(new PredicateAndObject(RelConstants.RL_PAGES, ha.getPosition()));

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

if(ha != null && ha.getPosition()!=null){
  if(ha.getPosition().length()!=0) paos_doc.add(new PredicateAndObject(RelConstants.RL_PAGES, ha.getPosition()));

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

String pages = yElementJournalStructure.getCurrent().getPosition();
bibEntry.setField(BibEntry.FIELD_PAGES, pages);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com