- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中pl.edu.icm.model.bwmeta.y.YLanguage.getShortCode()
方法的一些代码示例,展示了YLanguage.getShortCode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YLanguage.getShortCode()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YLanguage
类名称:YLanguage
方法名:getShortCode
暂无
代码示例来源: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.yadda/yaddaweb-lite-core
protected String prepareLanguages(YElement element) {
StringBuilder langs = new StringBuilder();
boolean wasFirst = false;
for (YLanguage lang : element.getLanguages()) {
if (wasFirst) {
langs.append(",");
langs.append(" ");
}
langs.append(languageDictionary.getShortDescription(lang.getShortCode()));
wasFirst = true;
}
return langs.toString().trim();
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<LocalizedString> prepareLanguagesSeparated(YElement element) {
List<LocalizedString> langs = new ArrayList<LocalizedString>();
for (YLanguage lang : element.getLanguages()) {
langs.add(new LocalizedString( languageDictionary.getShortDescription(lang.getShortCode()), languageDictionary.getShortDescription(lang.getShortCode())));
}
return langs;
}
代码示例来源: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-process-common
public static synchronized void loadData() {
if (loaded) {
return;
}
loaded = true;
List<String> profileData = new ArrayList<String>();
try {
Charset encoding = Charset.forName("UTF-8");
for (YLanguage language : detectableLanguages) {
try (InputStream stream = new ClassPathResource("langdetect-profiles/" + language.getShortCode()).getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, encoding));) {
profileData.add(new String(IOUtils.toCharArray(reader)));
}
}
DetectorFactory.loadProfile(profileData);
DetectorFactory.setSeed(System.currentTimeMillis());
} catch (IOException | LangDetectException e) {
throw new GeneralBusinessException(e);
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
public static Locale getUserLocale(final UserProfile profile) {
if (profile.getLanguage() == null) {
return Locale.ENGLISH; // TODO What should be the default locale if UserProfile has no language? Does situation when user don't have language is possible?
}
return new Locale(profile.getLanguage().getyLanguage().getShortCode());
}
代码示例来源: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
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.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-portal-core
@Override
public Locale resolveLocale(HttpServletRequest request) {
try {
UserProfile userProfile = userBusinessService.getCurrentUserProfile();
if (userProfile != null && userProfile.getLanguage() != null) {
return StringUtils.parseLocaleString(userProfile.getLanguage().getyLanguage().getShortCode());
}
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
return super.resolveLocale(request);
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
public LanguageInfo asLanguageInfo(YLanguage yLanguage, Locale inLocale) {
String shortCode = yLanguage.getShortCode();
String code = languageExtractor.extractLanguageCode(yLanguage);
Locale langLocale = new Locale(code);
String name = langLocale.getDisplayLanguage(inLocale);
return new LanguageInfo.Builder()
.code(code)
.shortCode(shortCode)
.name(name)
.build();
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private Map<String, List<LocalizedString>> prepareTypedNames(YElement element,
IFilteringContext filteringContext) {
Map<String, List<LocalizedString>> result = new HashMap<String, List<LocalizedString>>();
for (YName name : element.getNames()) {
String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
String text = detailsFilter.filter(YRTHelper.toXmlFragment(name.getRichText()),
InputType.RICH_TEXT, filteringContext);
LocalizedString ls = new LocalizedString(lang, text);
List<LocalizedString> list;
String type = name.getType();
if (!result.containsKey(type)) {
list = new ArrayList<LocalizedString>();
result.put(type, list);
} else {
list = result.get(type);
}
list.add(ls);
}
return result;
}
代码示例来源:origin: pl.edu.icm.synat/synat-console-core
@Override
public List<GroupTimePeriod> getTimePeriods(Organisation organisation) {
List<GroupTimePeriod> timePeriods = new ArrayList<GroupTimePeriod>();
int i = 0;
Page<GroupTimePeriod> page = null;
do {
GroupTimePeriodQuery query = new GroupTimePeriodQuery();
query.setPageNo(i++);
query.setPageSize(Integer.parseInt(DEFAULT_PAGE_SIZE));
query.setOrganisationId(organisation.getId());
page = licensingService.fetchOrganisationGroupAssignments(query);
timePeriods.addAll(page.getResult());
} while (page.getTotalPages() > i);
final Locale polish = Locale.forLanguageTag(YLanguage.Polish.getShortCode());
final Collator polishCollator = Collator.getInstance(polish);
Collections.sort(timePeriods, new Comparator<GroupTimePeriod>() {
@Override
public int compare(final GroupTimePeriod object1, final GroupTimePeriod object2) {
return polishCollator.compare(object1.getOrganisationGroup().getName(), object2.getOrganisationGroup().getName());
}
});
return timePeriods;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<LocalizedString> getDescription(YInstitution element,
IFilteringContext filteringContext, String type) {
List<LocalizedString> result = new ArrayList<LocalizedString>();
for (YDescription description : element.getDescriptions()) {
if (type.equals(description.getType())) {
result.add(new LocalizedString(languageDictionary.getShortDescription(
description.getLanguage().getShortCode()),
detailsFilter.filter(YRTHelper.toXmlFragment(description.getRichText()), InputType.RICH_TEXT,
filteringContext)));
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<LocalizedString> getDescription(YElement element,
IFilteringContext filteringContext, String type) {
List<LocalizedString> result = new ArrayList<LocalizedString>();
for (YDescription description : element.getDescriptions()) {
if (type.equals(description.getType())) {
result.add(new LocalizedString(languageDictionary.getShortDescription(
description.getLanguage().getShortCode()),
detailsFilter.filter(YRTHelper.toXmlFragment(description.getRichText()), InputType.RICH_TEXT,
filteringContext)));
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
private LanguageEnum convertLanguage(YElement yElement) {
LanguageEnum result = DEFAULT_LANGUAGE;
YLanguage ylanguage = yElement.getOneLanguage();
if (YLanguage.Undetermined != ylanguage) {
try {
result = LanguageEnum.fromValue( ylanguage.getShortCode() );
} catch (IllegalArgumentException e) {
logArticleWarning(yElement.getId(), "language {} can not be converted to polindex language, default language ({}) is set", ylanguage, DEFAULT_LANGUAGE);
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private Object prepareTitles(List<YName> names, YName defaultName, IFilteringContext filteringContext) {
List<LocalizedString> res = new ArrayList<LocalizedString>();
if (names != null)
for (YName name : names) {
if (defaultName != name && YNameAndYDescriptionSorter.isMainOrAlternativeName(name.getType())) {
String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
res.add(new LocalizedString(lang, detailsFilter.filter(YRTHelper.toXmlFragment(name.getRichText()),
InputType.RICH_TEXT, filteringContext)));
}
}
return res;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<LocalizedString> prepareTitles(YElement element, IFilteringContext filteringContext) {
YName oneName = element.getDefaultName();
List<LocalizedString> res = new ArrayList<LocalizedString>();
for (YName name : element.getNames()) {
if (name != oneName && YNameAndYDescriptionSorter.isMainOrAlternativeName(name.getType())) {
String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
res.add(new LocalizedString(lang, detailsFilter.filter(
YRTHelper.toXmlFragment(name.getRichText()),
InputType.RICH_TEXT, filteringContext)));
}
}
return res;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
/**
* Handler for user settings edit page BASIC IMPLEMENTATION
*
* @return view name
*/
@RequestMapping(value = USER_SETTINGS_EDIT, method = RequestMethod.GET)
public ModelAndView settingsEditHandler(HttpServletRequest request) {
ModelAndView results = new ModelAndView(USER_SETTINGS_EDIT);
UserSettingsForm userSettingsForm = new UserSettingsForm();
UserProfile loggedUserProfile = userBusinessService.getCurrentUserProfile();
if (loggedUserProfile != null) {
userSettingsForm.setHighContrastFacilitation(loggedUserProfile.isHighContrastFacilitation());
userSettingsForm.setLanguage(loggedUserProfile.getLanguage()!=null?loggedUserProfile.getLanguage().getyLanguage().getShortCode():"pl");
userSettingsForm.setNotificationsSendInterval(loggedUserProfile.getNotificationsSendInterval());
} else {
Locale locale = localeResolver.resolveLocale(request);
String themeName = themeResolver.resolveThemeName(request);
userSettingsForm.setLanguage(locale.getLanguage());
userSettingsForm.setHighContrastFacilitation(themeName.equals(PortalThemeResolver.PORTAL_HIGH_CONTRAST_THEME));
}
results.addObject("userSettingsForm", userSettingsForm);
return results;
}
我使用此方法进行了 .edu 电子邮件验证 - jQuery Form Validation, Only Allow .EDU Email Addresses 但我不想只使用 .edu 或 .edu.
我不明白它要我做什么。分配给 sentence正在工作: val sentences : java.util.List[CoreMap] = document.get(classOf[Sentence
嗨, 我正在尝试通过以下命令使用powershell连接到live @ edu。 发射命令: $ SessionNew = New-PSSession -ConfigurationName Micro
本文整理了Java中edu.stanford.nlp.process.WordToSentenceProcessor类的一些代码示例,展示了WordToSentenceProcessor类的具体用法。
我正在使用位于此处的 jquery 验证函数和插件。 http://docs.jquery.com/Plugins/Validation 我正在检查 js 文件,并且找到了电子邮件验证 block ,
大家好,美好的一天。 我有 JS 代码可以验证所有类型的电子邮件,但我想将电子邮件的验证限制为一种类型的电子邮件,例如:示例 @my.csun.edu 例如,我希望使用 @my.csun.edu 作为
我需要为我正在从事的一个项目编写一个函数,我们正在为这个项目制作一个仅供机构的学生、教职员工和校友访问的网站。 假设学校网站是:school.edu。 我在编写用于检查提交的电子邮件地址是否具有“sc
本文整理了Java中edu.isi.karma.controller.update.WorksheetListUpdate类的一些代码示例,展示了WorksheetListUpdate类的具体用法。这
本文整理了Java中edu.umd.cs.findbugs.ba.XField类的一些代码示例,展示了XField类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Mave
本文整理了Java中pl.edu.icm.yadda.service2.YaddaError类的一些代码示例,展示了YaddaError类的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中pl.edu.icm.yadda.common.YaddaException类的一些代码示例,展示了YaddaException类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中pl.edu.icm.ceon.commons.YaddaCollectionsUtils类的一些代码示例,展示了YaddaCollectionsUtils类的具体用法。这些代码示
本文整理了Java中pl.edu.icm.model.bwmeta.YElement类的一些代码示例,展示了YElement类的具体用法。这些代码示例主要来源于Github/Stackoverflow
本文整理了Java中pl.edu.icm.model.bwmeta.YContributor类的一些代码示例,展示了YContributor类的具体用法。这些代码示例主要来源于Github/Stack
所以我一直在思考如何正确使用正则表达式,我正在创建一个注册表单,其中使用的电子邮件必须包含 @pin.edu.sh。例如,如果用户决定使用。 johndoe@gmail.com,它不会接受,但是如果用
我在PC(Win 10 Edu,AMD 5 3600X 3.80 GHz,16 GB RAM,5700XT 8 GB GDDR)和PC笔记本Huawai Matebook X Pro(Win 10 H
我是一个菜鸟,但正在大力尝试简单地验证仅以“.edu”或“.ac”结尾的电子邮件地址,是否有一个简单的函数/脚本/解决方案来解决这个看似简单的问题?能够使用php、javascript或jquery。
给定一个列表, url = ["www.annauniv.edu", "www.google.com", "www.ndtv.com", "www.website.org", "www.bis.org
在应用程序线程转储中,我可以看到具有五个线程的线程池,如下所示: "pool-1-thread-5" prio=10 tid=0x000000000101a000 nid=0xe1f in Objec
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector类的一些代码示例,展示了WeightVector类的具体用法。这些代码示例主要来源于Gith
我是一名优秀的程序员,十分优秀!