gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 22:52:40 27 4
gpt4 key购买 nike

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

YDate.getType介绍

暂无

代码示例

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

private Map<String, YDate> processYDates(final List<YDate> yDates) {
  Map<String, YDate> dates = new HashMap<>();
  if (yDates != null) {
    for (final YDate yDate : yDates) {
      dates.put(yDate.getType(), yDate);
    }
  }
  return dates;
}

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

/**
 * Selects most apropriate (English if available) description.
 * 
 * @param descriptions
 *            list of available descriptions
 * @return best found description or null if list is empty
 */
protected static String selectBestDate(List<YDate> dates) {
  if (dates == null || dates.size() == 0) {
    return null;
  }
  StringBuilder text = new StringBuilder();
    
  for (YDate date : dates) {
    text.append(date.getType() + ":"+date.getYear()+YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
  }
  return text.toString();
}

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

/**
 * Selects most appropriate (Publication's if available) data.
 */
protected static String selectBestDate(List<YDate> dates) {
  if (dates == null || dates.size() == 0) {
    return null;
  }
        int py = dates.get(0).getYear();
  for (YDate date: dates) { //Search for English version
    if (date.getType().equals(YConstants.DT_PUBLISHED)) {
      py = date.getYear();
    }
  }
  
  if (py > 1000) {
    return new Integer(py).toString();
  } else {
    return null;    
  } 
}

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

@Override
  void compare(YElement expected, YElement actual, EvalResult result) {
    List<YDate> expDates = expected.getDates();
    Map<String, YDate> actDatesMap = new HashMap<String, YDate>();
    for (YDate date : actual.getDates()) {
      String type = date.getType();
      actDatesMap.put(type, date);
    }
    for (YDate date : expDates) {
      String type = date.getType();
      if (actDatesMap.containsKey(type)) {
        if (date.equals(actDatesMap.get(type))) {
          result.append("Date - " + type, ResultStatus.RECOGNIZED, 1);
        } else {
          result.append("Date - " + type, ResultStatus.FAILED, 1);
        }
        actDatesMap.remove(type);
      } else {
        result.append("Date - " + type, ResultStatus.FAILED, 1);
      }
    }
    for (String type : actDatesMap.keySet()) {
      result.append("Date - " + type, ResultStatus.REDUNDANT, 1);
    }
  }
},

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

@Override
protected void postProcessELements(List<YElement> elements) {
  Optional<YElement> chapterElement = getElementByPredicate(elements, this::hasChapterLevel);
  Optional<YElement> bookElement = getElementByPredicate(elements, this::hasBookLevel);
  if (chapterElement.isPresent() && bookElement.isPresent()) {
    for(YDate date:chapterElement.get().getDates()){
      if(bookElement.get().getDate(date.getType()) == null){
        bookElement.get().addDate(date);
      }
    }
  }
}

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

private DateDTO dateDTOFromYDate(YDate date) {
  return new DateDTO(date.getType(), date.getText());
}

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

private Map<String, Object> prepareDates(YElement element,
    IFilteringContext filteringContext) {
  Map<String, List<String>> datesMap = new HashMap<String, List<String>>();
  ArrayList<DateDTO> datesList = new ArrayList<DateDTO>();
  DateDTO publicationDate = null;
  for (YDate date : element.getDates()) {
    String type = date.getType();
    if (!datesMap.containsKey(type)) {
      datesMap.put(type, new ArrayList<String>());
    }
    datesMap.get(type).add(
        detailsFilter.filter(date.getText(), InputType.IDENTIFIER,
            filteringContext));
    if (!type.equals(YConstants.DT_PUBLISHED)) {
      datesList.add(dateDTOFromYDate(date));
    } else {
      publicationDate = dateDTOFromYDate(date);
    }
  }
  Collections.sort(datesList);
  publicationDateFirst(datesList, publicationDate);
  Map<String, Object> result = new HashMap<String, Object>();
  result.put("chronology", datesList);
  result.put("bytype", datesMap);
  Map<String, String> labels = createLabelsByType(datesMap);
  result.put("labels", labels);
  return result;
}

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

protected void fillDates(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        date element
  if (!yElement.getDates().isEmpty()) {
    ret.put(E_DATE, new ArrayList<StringWithAttributes>());
  }
  for (YDate yDate : yElement.getDates()) {
    String yDateStr;
    String y = String.format("%02d", yDate.getYear());
    String m = String.format("%02d", yDate.getMonth());
    String d = String.format("%02d", yDate.getDay());
    if (y != null && m != null && d != null) {
      yDateStr = y + "-" + m + "-" + d;
    } else if (y != null && m != null) {
      yDateStr = y + "-" + m;
    } else if (y != null) {
      yDateStr = y;
    } else {
      yDateStr = yDate.getText();
    }
    StringWithAttributes dat = new StringWithAttributes(yDateStr);
    dat.addAttribute("dateType", yDate.getType());
    ret.get(E_DATE).add(dat);
    // root.addContent(date);
  }
}

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

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  element.getDates().addAll(getDates(pm.getEventGroup()));
  for (YElement ancestor : ancestors) {
    for (YDate date : ancestor.getDates()) {
      if (element.getDate(date.getType()) == null) {
        element.addDate(date);
      }
    }
  }
}

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

@Override
public BasicDBObject convert(YDate source) {
  if(source == null){
    return null;
  }
  BasicDBObject object = new BasicDBObject();
  object.put("year", source.getYear());
  object.put("day", source.getDay());
  object.put("month", source.getMonth());
  object.put("type", source.getType());
  object.put("text", source.getText());
  DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
  String dateString = String.format("%04d%02d%02d", getOneIfZero(source.getYear()), getOneIfZero(source.getMonth()), getOneIfZero(source.getDay()));
  try {
    Date parsedDate = dateFormat.parse(dateString);
    object.put("date", parsedDate);
  } catch (ParseException e) {
    LOGGER.warn("Couldn't parse date: " + dateString);
  }
  return object;
}

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

protected void fillPublicationDate(HtmlMetaHeaders metadata, YElement yElement) {
  for (YDate date : yElement.getDates()) {
    if (StringUtils.equals(DateTypes.DT_PUBLISHED, date.getType())) {
      String parsedDate = parseDate(date);
      if (parsedDate != null) {
        metadata.addMetadataName(WP_PUBLICATION_DATE, parseDate(date));
        return;
      }
    }
  }
  if (yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL) != null) {
    YAncestor yAncestor = yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL).getAncestor(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
    if (yAncestor != null && yAncestor.getOneName() != null) {
      metadata.addMetadataName(WP_PUBLICATION_DATE, yAncestor.getOneName().getText());
    }
  }
}

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

if (!YConstants.DT_PUBLISHED.equals(elementDate.getType())) {
  continue;

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