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

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

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

YTagList.getLanguage介绍

暂无

代码示例

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

private void prepareTagsWithExistedTags(YElement enrichedElement,
    final String from, YElement element, final String to) {
  for (YTagList tags : enrichedElement.getTagLists(from)) {
    for (YTagList orgTags : element.getTagLists(to)) {
      if ( ! tags.getLanguage().equals(orgTags.getLanguage())) {
        continue;
      }
      prepareElementKeywords(element, to, tags, orgTags);
    }
  }
}

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

public Set<TagsInfo> getTagsInfo(AbstractElementInfo<?> abstractElementInfo, String tagType){
  
  
  Map<String, Set<String>> langsTagsMap = new HashMap<String, Set<String>>();
  
  for(YTagList tagList : abstractElementInfo.getTagLists()){
    if(tagType.equals(tagList.getType())){
      String lang = languageExtractor.extractLanguageCode(tagList.getLanguage());
      Set<String> tags = new TreeSet<String>(tagList.getValues());
      
      if(langsTagsMap.containsKey(lang))
        langsTagsMap.get(lang).addAll(tags);
      else
        langsTagsMap.put(lang, tags);
    }
  }
  
  Set<TagsInfo> infos = convertIntoSetTagsInfo(langsTagsMap);
  return infos;
}

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

protected void fillRights(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //copyrigths
  //rights
  if (yElement.getOneAttributeSimpleValue(CommonAttributeTypes.AT_COPYRIGHT_HOLDER) != null) {
    if (!ret.containsKey(E_RIGHTS)) {
      ret.put(E_RIGHTS, new ArrayList<StringWithAttributes>());
    }
    ret.get(E_RIGHTS).add(new StringWithAttributes(yElement.getOneAttributeSimpleValue(CommonAttributeTypes.AT_COPYRIGHT_HOLDER)));
  }
  //From synat;) 
  YTagList licenses = yElement.getTagList("License");
  if (licenses != null) {
    for (String licenseText : licenses.getValues()) {
      if (!ret.containsKey(E_RIGHTS)) {
        ret.put(E_RIGHTS, new ArrayList<StringWithAttributes>());
      }
      StringWithAttributes swa = new StringWithAttributes(licenseText);
      if (licenses.setLanguage(YLanguage.Sandawe) != null && StringUtils.isNotBlank(licenses.getLanguage().getShortCode())) {
        swa.addAttribute("lang", licenses.getLanguage().getShortCode());
      }
      ret.get(E_RIGHTS).add(swa);
    }
  }
}

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

private List<String> trySoncaKeywords(YElement element, String finalText) {
  try {
    YDescription description = new YDescription(YLanguage.Polish, finalText);
    element.addDescription(description);
    YElement enrich = soncaMetadataEnricher.enrich(Lists.newArrayList(element));
    List<YTagList> tagLists = enrich.getTagLists("sonca.keywords");
    YTagList polishTagList = null;
    for (YTagList yTagList : tagLists) {
      if (yTagList.getLanguage() == YLanguage.Polish) {
        polishTagList = yTagList;
      }
    }
    if (polishTagList != null) {
      return polishTagList.getValues();
    } else {
      return new ArrayList<String>();
    }
  } catch (Exception e) {
    e.printStackTrace();
    return new ArrayList<String>();
  }
}

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

tags.getLanguage().getShortCode());
if (!keywordsMap.containsKey(lang)) {
  keywordsMap.put(lang, words);

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

tags.getLanguage().getShortCode());
if (!keywordsMap.containsKey(lang)) {
  keywordsMap.put(lang, words);

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

/**
 * Method for preparation of keywords list
 * 
 * @param yElement
 *            Ymodel element
 * @return List of keywords in yElement
 */
@Override
public List<KeywordsData> prepareKeywords(YElement yElement, Locale locale) {
  final YLanguage yDefaultLanguage = YModelUtils.getDefaultLanguage(yElement);
  List<KeywordsData> keywords = new ArrayList<KeywordsData>();
  for (YTagList tagList : yElement.getTagLists()) {
    final YLanguage yLanguage = tagList.getLanguage();
    final KeywordsData localizedKeywordsData = makeLocalizedKeywordsData(tagList, yLanguage, locale);
    if (null != localizedKeywordsData && yLanguage.equals(yDefaultLanguage)) {
      keywords.add(localizedKeywordsData);
    }
  }
  for (YTagList tagList : yElement.getTagLists()) {
    final YLanguage yLanguage = tagList.getLanguage();
    final KeywordsData localizedKeywordsData = makeLocalizedKeywordsData(tagList, yLanguage, locale);
    if (null != localizedKeywordsData && !yLanguage.equals(yDefaultLanguage)) {
      keywords.add(localizedKeywordsData);
    }
  }
  return keywords;
}

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

/**
 * accomplished
 */
private void proceedTags() {/*9*/
  int tagid=0;
  for(YTagList yt : in_item.getTagLists()){
    YLanguage lang = yt.getLanguage();
    String id = null;
    for(String tag : yt.getValues()){
      id = RelConstants.NS_TAG+"-"+in_item.getId()+"-"+tagid;
      paos_doc.add(new PredicateAndObject(RelConstants.RL_TAG, id));
      tagid++;
      Statements t_affil = new Statements(); 
      t_affil.setSubject(id);
      LinkedList<PredicateAndObject> paos_affil = new LinkedList<PredicateAndObject>();
      paos_affil.add(new PredicateAndObject(RelConstants.RL_TYPE, tag.toLowerCase()));
      paos_affil.add(new PredicateAndObject(RelConstants.RL_TEXT, tag.toLowerCase()));
      paos_affil.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, lang.toString()));
      t_affil.setContinuations(paos_affil);
      statements.add(t_affil);    
    }
  }    
}

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

/**
   * accomplished
   */
  private void proceedTags() {/*9*/
    int tagid=0;
    for(YTagList yt : in_item.getTagLists()){
      YLanguage lang = yt.getLanguage();
      String id = null;
      for(String tag : yt.getValues()){
        id = RelConstants.NS_TAG+in_item.getId()+"/t"+tagid;
        paos_doc.add(new PredicateAndObject(RelConstants.RL_TAG, id));
        tagid++;
        Statements t_affil = new Statements(); 
        t_affil.setSubject(id);
        LinkedList<PredicateAndObject> paos_affil = new LinkedList<PredicateAndObject>();
//                paos_affil.add(new PredicateAndObject(RelConstants.RL_TYPE, tag.toLowerCase()));
        paos_affil.add(new PredicateAndObject(RelConstants.RL_TEXT, tag.toLowerCase()));
        paos_affil.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, lang.toString()));
        t_affil.setContinuations(paos_affil);
        statements.add(t_affil);    
      }
    }    
  }

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

YLanguage lang = yt.getLanguage();
String id = null;
for(String tag : yt.getValues()){

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

public static void updateYRelationWithZblTags(YRelation relye, YElement zblye) {
  for (YTagList tl : zblye.getTagLists()) {
    YAttribute ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TAG, "");
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));
    for (String t : tl.getValues()) {
      ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE, t));
    }
    relye.addAttribute(ya);
  }
}

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

result.addKeyword(new KeywordsData(new LanguageData(tag.getLanguage())).setStringData(new ArrayList<String>(tag.getValues())));

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

ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TAG, "");
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));

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

ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TAG, "");
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));

相关文章