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

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

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

YTagList.setType介绍

暂无

代码示例

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

private YTagList getTaglist(YLanguage yLanguage, Map<YLanguage, YTagList> tags) {
  if(tags.containsKey(yLanguage)){
    return tags.get(yLanguage);
  }
  YTagList tagList = new YTagList();
  tagList.setLanguage(yLanguage);
  tagList.setType(TagTypes.TG_KEYWORD);
  tags.put(yLanguage, tagList);
  return tagList;
}

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

private void prepareElementKeywords(YElement element, final String to, YTagList tags) {
  tags.setType(to);
  resizeAndSetValues(tags, maxKeywords);
  element.addTagList(tags);
}

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

@Override
  protected boolean enhanceMetadata(BxDocument document, YElement metadata) {
    for (BxPage page : filterPages(document)) {
      for (BxZone zone : filterZones(page)) {
        YTagList tagList = new YTagList().setType(YConstants.TG_KEYWORD);
        String text = zone.toText().replace("\n", " ");
        text = PREFIX.matcher(text).replaceFirst("");
        String separator = text.indexOf(";") > -1 ? ";" : ",";
        for (String keyword : text.split(separator)) {
          tagList.addValue(keyword.trim().replaceFirst("\\.$", ""));
        }
        metadata.addTagList(tagList);
        return true;
      }
    }
    return false;
  }
}

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

protected void convertKeywords(BibEntry source, YElement yElement) {
  String bibEntryKeywords = source.getFirstFieldValue(BibEntry.FIELD_KEYWORDS);
  if (bibEntryKeywords != null) {
    YTagList yTagList = new YTagList();
    String[] split = bibEntryKeywords.split("; ");
    yTagList.setType(YConstants.TG_KEYWORD);
    for (String keyword : split) {
      yTagList.addValue(keyword);
    }
    yElement.addTagList(yTagList);
  }
}

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

public void fillArticleInformation(YElement article, JSONObject message){
  if (message.containsKey("title")) {
    for (Object o : (JSONArray) message.get("title")) {
      YName tit = new YName(o.toString());
      article.addName(tit);
    }
  }
  
  fillAuthorsInformation(article, message);
  
  JSONArray tagList=(JSONArray)message.get("subject");
  if (tagList!=null && tagList.size()>0) {
    YTagList tl=new YTagList();
    tl.setType(TagTypes.TG_KEYWORD);
    for (Object o : (JSONArray) message.get("subject")) {
       tl.addValue(o.toString());
    }
    article.addTagList(tl);
  }
      }

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

private YElement prepareYElement(String id, Properties prop) {
  YElement yElement = new YElement();
  yElement.setId(id);
  if (!prop.getProperty("title").isEmpty()) {
    yElement.addName(new YName(prepareProperty("title", prop)));
  }
  
  yElement.addDescription(new YDescription(YLanguage.Undetermined, prepareProperty("description", prop), DescriptionTypes.DS_SUMMARY));
  
  if (!prop.getProperty("key-words").isEmpty()) {
    List<String> tags = new ArrayList<String>(Arrays.asList(prepareProperty("key-words", prop).split(",")));
    yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
  }
  
  if (!prop.getProperty("supplier").isEmpty()) {
    yElement.addAttribute("copyright-holder", prepareProperty("supplier", prop));
  }
  
  if (!prop.getProperty("duration").isEmpty()) {
    yElement.addAttribute("duration", prepareProperty("duration", prop));
  }
  yElement.addLanguage(YLanguage.Undetermined);
  
  return yElement;
}

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

protected void updateYElement(final DataSet dataSet, final YElement yElement) {
  YStructure yStructure = new YStructure(DATA_SET_YSTRUCTURE);
  YCurrent yCurrent = new YCurrent(DATA_SET_YLEVEL);
  yStructure.setCurrent(yCurrent);
  Collection<YStructure> structures = Collections.singletonList(yStructure);
  yElement.setStructures(structures);
  
  if (StringUtils.isNotBlank(dataSet.getId())) {
    yElement.setId(DATA_SET_YELEMENT_ID_PREFIX + dataSet.getId());
  }
  
  if (StringUtils.isNotBlank(dataSet.getName())) {
    yElement.setNames(Collections.singletonList(new YName(dataSet.getName())));
  }
  
  if (StringUtils.isNotBlank(dataSet.getDescription())) {
    yElement.setDescriptions(Collections.singletonList(new YDescription(YLanguage.Undetermined, dataSet.getDescription())));
  }
  if (dataSet.getDefaultLicense() != null) {
    YTagList tagList = new YTagList();
    tagList.setType(YModelUtils.LICENSE);
    tagList.addValue(dataSet.getDefaultLicense().getId());
    yElement.addTagList(tagList);
  }
}

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

private void prepareYElementFromApi(Video video, YElement yElement) throws ParseException {
  yElement.addName(new YName(video.getSnippet().getTitle()));
  yElement.addDescription(new YDescription(YLanguage.Undetermined, video.getSnippet().getDescription()
          , DescriptionTypes.DS_SUMMARY));
  
  prepareDate(video, yElement);
  
  String license = video.getStatus().getLicense();
  if(null != license && license.contains("creativeCommon")) {
    yElement.addTagList(new YTagList().setType(YModelUtils.LICENSE).addValue("cc0"));
  }
  
  prepareContent(video, yElement);
  
  List<String> tags = video.getSnippet().getTags();
  if (CollectionUtils.isNotEmpty(tags)) {
    yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
  }
  
  YCurrent currentLevel = new YCurrent().setLevel(VideoConstants.VIDEO_CURRENT_LEVEL);
  yElement.addStructure(new YStructure()
      .setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_PUBLICATION)
      .setCurrent(currentLevel));
  
  prepareAttributes(video, yElement);
}

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

tl.setType(TagTypes.TG_KEYWORD);
for (String s : at.getKeywords().split(",")) {
  tl.addValue(s);

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

tagList.setType(YModelUtils.LICENSE);
if (resource.getCopyright().equals(PortalResourceCopyright.PUBLIC_DOMAIN)) {
  tagList.addValue(PortalResourceCopyright.PUBLIC_DOMAIN.toString());

相关文章