gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 07:00:40 32 4
gpt4 key购买 nike

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

YLanguage.getBibliographicCode介绍

暂无

代码示例

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

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result
      + ((yLanguage == null) ? 0 : yLanguage.getBibliographicCode().hashCode());
  return result;
}

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

@Override
public LanguageData getLocalizedLanguage(YLanguage language, Locale locale) {
  String longDesc = languageDictionary.getLongDescription(language.getBibliographicCode(), locale);
  return new LanguageData(language, language.getBibliographicCode(), longDesc);
}

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

/**
 * Creates Language with specified single parameters
 *
 * @param id
 *            identification
 * @param name
 *            Displayed name
 */
public LanguageData(YLanguage yLanguage) {
  super(yLanguage.getBibliographicCode(), yLanguage.getName());
  this.yLanguage = yLanguage;
}

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

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  LanguageData other = (LanguageData) obj;
  if (!yLanguage.getBibliographicCode().equals(other.yLanguage.getBibliographicCode()) ||
     !yLanguage.getName().equals(other.yLanguage.getName()))
    return false;
  return true;
}

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

@Override
public String getTranslation(String languageId, Locale locale, DictionaryDataTypes type) {
  final String code = YLanguage.byCode(languageId, YLanguage.Undetermined).getBibliographicCode();
  if (StringUtils.isNotEmpty(code)) {
    return languageDictionary.getLongDescription(code, locale);
  }
  return languageId;
}

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

public String extractLanguageCode(YLanguage yLanguage){
  
  String code = yLanguage.getShortCode();
  if(code.isEmpty())
    code = yLanguage.getTerminologyCode();
  if(code.isEmpty())
    code = yLanguage.getBibliographicCode();
  if(code.isEmpty())
    code = yLanguage.getName();
  
  return code;
}

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

@RequestMapping(value = KEY_WORD_SUGGESTION, method = RequestMethod.GET)
public @ResponseBody Map<String, List<String>> keyWordSuggestion(HttpServletRequest request) {
  Map<String, List<String>> allKeywords = new HashMap<String, List<String>>();
    try {
      for (YLanguage lang : metadataGenerator.getSupportedLanguages()) {
        String desc = ServletRequestUtils.getStringParameter(request, "desc_" + lang.getBibliographicCode(), StringUtils.EMPTY);;
        String title = ServletRequestUtils.getStringParameter(request, "title_" + lang.getBibliographicCode(), StringUtils.EMPTY);;
        if (StringUtils.isNotBlank(desc) || StringUtils.isNotBlank(title)) {
          String text = buildKeywordBaseText(title, desc);
          List<String> keywords = metadataGenerator.generateKeywords(lang, text);
          allKeywords.put(lang.getBibliographicCode(), keywords);
        }
      }
    } catch (Exception e) {
      logger.warn("Exception while generating keywords", e);
    }
  return allKeywords;
}

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

public YLanguage byCodeName(String code, YLanguage fallback) {
  if (code == null || code.isEmpty())
    return fallback;
  code = code.toLowerCase(Locale.ENGLISH);
  for (YLanguage lang : YLanguage.values()) {
    if (code.equals(lang.getShortCode()))
      return lang;
    if (code.equals(lang.getBibliographicCode()))
      return lang;
    if (code.equals(lang.getTerminologyCode()))
      return lang;
    if (isInArrayIgnoreCase(lang.getNames(), code))
      return lang;
  }
  return fallback;
}

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

protected void cleanKeywords(ResourceData resource) {
  List<KeywordsData> result = new ArrayList<KeywordsData>();
  for (KeywordsData data : resource.getKeywords()) {
    if (data.getLanguage() != null && !YLanguage.NoLinguisticContent.getBibliographicCode().equals(data.getLanguage().getId())) {
      result.add(data);
    }
  }
  resource.setKeywords(result);
}

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

protected void cleanDescriptions(ResourceData resource) {
  List<LocalizedData<String>> result = new ArrayList<LocalizedData<String>>();
  for (LocalizedData<String> data : resource.getDescriptions()) {
    if (data.getLanguage() != null && !YLanguage.NoLinguisticContent.getBibliographicCode().equals(data.getLanguage().getId())) {
      result.add(data);
    }
  }
  resource.setDescriptions(result);
}

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

private LanguageData makeLanguageData(final YLanguage yLanguage, final Locale locale) {
  final String longDesc = languageDictionary.getLongDescription(yLanguage.getBibliographicCode(), locale);
  return new LanguageData(yLanguage, yLanguage.getShortCode(), longDesc);
}

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

@Override
public void buildReferenceData(RequestWrapper requestWrapper, Model model, Locale locale) {
  LinkedHashSet<LanguageData> preferredLanguages = new LinkedHashSet<LanguageData>(
      languageService.getPreferedLanguagesBibliographicFormat(locale));
  List<AdvancedFormFieldCondition> conditions = StringUtils.isEmpty(requestWrapper.getSearchQuery()) ? buildInitialConditions()
      : buildSearchConditions(requestWrapper.getSearchQuery());
  preferredLanguages.addAll(fetchAdditionalLanguagesFromConditions(conditions, locale));
  model.addAttribute("advancedQuery", conditions);
  model.addAttribute("datasets", datasetDictionary.listDataSets());
  model.addAttribute("levels", levelDictionary.listAvailableLevels());
  model.addAttribute("allLanguages", languageService.getAllLanguagesBibliographicFormat(locale));
  model.addAttribute("defaultSelectedLanguage", YLanguage.byCode(locale.getLanguage(), YLanguage.Polish)
      .getBibliographicCode());
  model.addAttribute("languages", preferredLanguages);
}

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

/**
 * Iterates over titles and removes elements without language definition or
 * with {@link YLanguage#NoLinguisticContent} language
 *
 * @param resource
 */
protected void cleanTitles(ResourceData resource) {
  List<LocalizedData<String>> result = new ArrayList<LocalizedData<String>>();
  for (LocalizedData<String> data : resource.getTitles()) {
    if (data.getLanguage() != null && !YLanguage.NoLinguisticContent.getBibliographicCode().equals(data.getLanguage().getId())) {
      result.add(data);
    }
  }
  resource.setTitles(result);
}

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

private YLanguage extractYLanguage(Attribute langAttribute) {
  if (langAttribute == null) {
    return null;
  }
  String langStr = langAttribute.getValue();
  if (langStr == null) {
    return null;
  }
  langStr = langStr.trim();
  for (YLanguage lang : YLanguage.values()) {
    if (lang.getBibliographicCode().equals(langStr) || lang.getShortCode().equals(langStr)
        || lang.getTerminologyCode().equals(langStr)) {
      return lang;
    }
    for (String langName : lang.getNames()) {
      if (langName != null && langName.equals(langStr)) {
        return lang;
      }
    }
  }
  return null;
}

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

private KeywordsData makeLocalizedKeywordsData(final YTagList yTagList, final YLanguage yLanguage, Locale locale) {
  if (yTagList.getType().equals(TG_KEYWORD)) {
    List<String> tags = new ArrayList<String>();
    for (YRichText richTag : yTagList.getRichValues()) {
      tags.add(richTag.toText().replaceAll(YModelUtils.LF_CR, YModelUtils.CR));
    }
    String longDesc = languageDictionary.getLongDescription(yLanguage.getBibliographicCode(), locale);
    LanguageData data = new LanguageData(yLanguage, yLanguage.getShortCode(), longDesc);
    return new KeywordsData(data).setStringData(tags);
  }
  return null;
}

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

@Override
public Set<DBUserProfileCustomProperty> apply(LanguageData input) {
  DBUserProfileCustomProperty property = new DBUserProfileCustomProperty();
  setLanguage(property, input.getyLanguage().getBibliographicCode());
  setCustomValue(property, input.getId());
  setName(property, input.getName());
  return Sets.newHashSet(property);
}

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

@Override
public Set<DBUserProfileCustomProperty> apply(CoverableValue<KeywordsData> input) {
  Set<DBUserProfileCustomProperty> properties = Sets.newHashSet();
  KeywordsData keywordsData = input.getValue();
  String level = input.getLevel();
  if (keywordsData == null || keywordsData.getLanguage() == null) {
    return properties;
  }
  String language = keywordsData.getLanguage().getyLanguage().getBibliographicCode();
  Integer position = 0;
  if(keywordsData.getData() == null || keywordsData.getData().isEmpty()){
    DBUserProfileCustomProperty property = new DBUserProfileCustomProperty();
    property.setSupplementaryKey(position.toString());
    setLevel(property, level);
    setLanguage(property, language);
    properties.add(property);
    return properties;
  }else {
    for (String data : keywordsData.getStringData()) {
      DBUserProfileCustomProperty property = new DBUserProfileCustomProperty();
      property.setSupplementaryKey(position.toString());
      setLevel(property, level);
      setLanguage(property, language);
      setValue(property, data);
      properties.add(property);
      position++;
    }
  }
  return properties;
}

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

protected ElementCollection convert(CollectionData data) {
  ElementCollection collection = new ElementCollection();
  collection.setId(data.getId());
  collection.setDescription(data.getDescription());
  collection.setName(data.getName());
  collection.setVisibility(data.getVisibility());
  collection.setType(data.getType().getTypeName());
  collection.setCreationTimestamp(data.getCreationTimestamp());
  collection.setModifyTimestamp(data.getModifyTimestamp());
  collection.setDisciplines(new HashSet<String>(Arrays.asList(data.getDisciplines())));
  for (KeywordsData kd : data.getKeywords()) {
    if (StringUtils.isNotBlank(kd.getContentString())) {
      collection.getKeywords().add(new KeywordSet(kd.getLanguage().getyLanguage().getBibliographicCode(),kd.getStringData()));
    }
  }
  for (CollectionUserData contributor : data.getUsers()) {
    if(StringUtils.isNotBlank(contributor.getUserId())){
      collection.getAssignedUsers().add(new CollectionUser(contributor.getUserId(), contributor.getRole()));
    }
  }
  return collection;
}

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

bibEntry.setField(BibEntry.FIELD_LANGUAGE, yElement.getOneLanguage().getBibliographicCode());

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