gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 10:50:40 24 4
gpt4 key购买 nike

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

YTagList.<init>介绍

暂无

代码示例

代码示例来源: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.yadda/yaddaweb-lite-core

private static void replaceKeywordsField(final YElement yElement, final String[] values) {
  if (values != null && values.length > 0) {
    final List<YTagList> tags = yElement.getTagLists();
    final List<YTagList> toRemove = new ArrayList<YTagList>();
    for (final YTagList tagList : tags) {
      if (YConstants.TG_KEYWORD.equals(tagList.getType())) {
        toRemove.add(tagList);
      }
    }
    tags.removeAll(toRemove);
    final Map<YLanguage, YTagList> langList = new HashMap<YLanguage, YTagList>();
    for (final String value : values) {
      final String[] langValue = StringUtils.split(value, " ", 2);
      final YLanguage lang = determineLang(langValue);
      if (lang != null) {
        YTagList list = langList.get(lang);
        if (list == null) {
          list = new YTagList(lang, YConstants.TG_KEYWORD);
          langList.put(lang, list);
        }
        list.addValue(langValue[1]);
      }
    }
    tags.addAll(langList.values());
  }
}

代码示例来源: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.yadda/bwmeta-import

/**
 * Reads keywords from field [ut] and writes to yElement.
 * 
 * @param src
 * @param yelement
 */
private void updateArticleKeywords(ZentralBlattRecord src, YElement yelement) {
  if (!src.hasField("ut")) {
    return;
  }
  YTagList tags = new YTagList(YLanguage.Undetermined, YConstants.TG_KEYWORD);
  String[] keywords = src.getField("ut").split(";");
  for (String keyword : keywords) {
    if (keyword.equals("-")) {
      continue;
    }
    tags.addValue(keyword.trim());
  }
  yelement.addTagList(tags);
}

代码示例来源: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.yadda.repowebeditor/repository-web-editor-core

public YTagList createYTagList(TagsInfoViewObject keyword) {
  YLanguage language = YLanguage.byCode(keyword.getLang(), YLanguage.English);
  YTagList tagList = new YTagList(language, YConstants.TG_KEYWORD);
  tagList.setValues(keyword.getTags());
  return tagList;
}

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

private void appendKeywords(ResourceData resource, YElement yElement) {
  for (KeywordsData keywordsData : resource.getKeywords()) {
    if (StringUtils.isNotEmpty(keywordsData.getContentString())) {
      YTagList tagList = new YTagList(keywordsData.getLanguage().getyLanguage(), TagTypes.TG_KEYWORD);
      for (Renderable tag : keywordsData.getData()) {
        tagList.addValue(StringEscapeUtils.unescapeHtml(tag.toString()));//TODO QQQ
      }
      yElement.addTagList(tagList);
    }
  }
}

代码示例来源: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.bwmeta/bwmeta-2-foreign-transformers

private void updateKeywords(YElement article, org.jdom.Element kg) {
  YTagList kwds = new YTagList(YLanguage.English, TagTypes.TG_KEYWORD);
  List<org.jdom.Element> ks = JDOMHelper.getChildren(kg, "kwd");
  for (org.jdom.Element k : ks) {
    kwds.addValue(JDOMHelper.textOfElement(k));
  }
  Attribute kwdLang = kg.getAttribute("lang", Namespace.XML_NAMESPACE);
  YLanguage lang = extractYLanguage(kwdLang);
  if (lang != null) {
    kwds.setLanguage(lang);
  }
  if (kwds.size() > 0) {
    // System.out.println("[NlmToYTransformer] Adding keywords");
    article.addTagList(kwds);
  }
}

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

YTagList kwds = new YTagList(YLanguage.Undetermined, TagTypes.TG_KEYWORD);
@SuppressWarnings("unchecked")
List<Element> kgs = ameta.getChildren("kwd-group");

代码示例来源: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.yadda/yadda-analysis-impl

YTagList kwds = new YTagList(YLanguage.Undetermined, TG_KEYWORD);
@SuppressWarnings("unchecked")
List<org.jdom.Element> kgs = ameta.getChildren("kwd-group");

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

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

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

YTagList tagList = new YTagList();
tagList.setType(YModelUtils.LICENSE);
if (resource.getCopyright().equals(PortalResourceCopyright.PUBLIC_DOMAIN)) {

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

YTagList tags = new YTagList(YLanguage.Undetermined, TagTypes.TG_KEYWORD);

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