gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YLanguage类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 06:12:40 27 4
gpt4 key购买 nike

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

YLanguage介绍

暂无

代码示例

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

public LanguageData(String languageCode) {
  this(YLanguage.byCode(languageCode, YLanguage.Undetermined));
}

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

protected void fillLanguages(HtmlMetaHeaders metadata, YElement yElement) {
  for (YLanguage yLanguage : yElement.getLanguages()) {
    if (StringUtils.isNotEmpty(yLanguage.getShortCode())) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_LANGUAGE, yLanguage.getShortCode());
    }
  }
}

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

private List<YName> returnNameInLang(AbstractNDA<?> element, YLanguage language) {
  final List<YName> yNameList = new ArrayList<YName>();
  for (YName name : element.getNames()) {
    if (name.getLanguage().equals(language)) {
      yNameList.add(name);
    }
  }
  return yNameList;
}

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

@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 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-process-common

public static YLanguage processLanguage(Collection<String> inputs, YLanguage currentLanguage) {
  loadData();
  boolean inputsEmpty = true;
  for (String input : inputs) {
    inputsEmpty = inputsEmpty && input.isEmpty();
  }
  if (currentLanguage.getShortCode().isEmpty() && unknownLanguages.contains(currentLanguage) && !inputsEmpty) {
    try {
      Detector detector = DetectorFactory.create(0.5);
      for (String input : inputs) {
        detector.append(input);
      }
      for (Language lang : detector.getProbabilities()) {
        YLanguage yLang = YLanguage.byCode(lang.lang);
        if (isSupported(yLang))
          return yLang;
      }
      return currentLanguage;
    } catch (LangDetectException e) {
      log.debug("Couldn't determine content language", e);
    }
  }
  return currentLanguage;
}

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

/**
 * accomplished
 */
private void proceedLanguage() {
  for(YLanguage yl : in_item.getLanguages()){
    paos_doc.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, yl.getName().toLowerCase()));
  }
}

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

@Override
@Cacheable("datasetTranslationResult")
public String getTranslation(String dataSetId, Locale locale, DictionaryDataTypes type) {
  try {
    YElement element = dataSetDictionary.getYElement(dataSetId);
    for (YName name : element.getNames()) {
      if (name.getLanguage() != null && name.getLanguage().equals(YLanguage.byCode(locale.getISO3Language()))) {
        return name.getText();
      }
    }
    final String name = YModelUtils.getDefaultName(element);
    if (StringUtils.isNotEmpty(name)) {
      return name;
    }
  } catch (NotFoundException e) {
    return dataSetId;
  }
  return dataSetId;
}

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

LinkedList<PredicateAndObject> paos_affil = new LinkedList<PredicateAndObject>();
  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);
  retL.add(t_affil);    
paos_doc.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, yl.getName().toLowerCase()));

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

@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

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-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.yadda/yadda-analysis-impl

/**
 * accomplished
 */
private void proceedLanguage() {
  for(YLanguage yl : in_item.getLanguages()){
    paos_doc.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, yl.getName().toLowerCase()));
  }
}

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

/**
 * Determine lang.
 *
 * @param langValue the lang value pair
 * @return the ylanguage or null if value has wrong format.
 */
private static YLanguage determineLang(final String[] langValue) {
  if (langValue.length != 2 || langValue[0].length() != 2) {
    log.warn("Unexpected value format (should be \"[LANG] [VALUE]\"): {}. Not highlighted.", langValue);
    return null;
  } else {
    YLanguage lang = null;
    if ("xx".equals(langValue[0])) {
      lang = YLanguage.Undetermined;
    } else {
      lang = YLanguage.byCode(langValue[0], YLanguage.Undetermined);
    }
    return lang;
  }
}

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