本文整理了Java中pl.edu.icm.model.bwmeta.y.YTagList.getType()
方法的一些代码示例,展示了YTagList.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YTagList.getType()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YTagList
类名称:YTagList
方法名:getType
暂无
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private List<YTagList> removeKeywordsFromTags() {
List<YTagList> tagListsList = new ArrayList<>();
for (YTagList yTagList : safe(article.getTagLists())) {
if(!yTagList.getType().equals(YConstants.TG_KEYWORD)) {
tagListsList.add(yTagList);
}
}
return tagListsList;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected String getMergedKeywords(YElement element) {
StringBuffer result = new StringBuffer();
boolean comma = false;
for (YTagList tags : element.getTagLists()) {
if (YConstants.TG_KEYWORD.equals(tags.getType())) {
for (String s : tags.getValues()) {
if (comma) {
result.append(", ");
} else {
comma = true;
}
result.append(s);
}
}
}
String stringResult = result.toString();
if (stringResult.isEmpty())
return null;
return stringResult;
}
代码示例来源: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.yadda/yadda-analysis-impl
@Override
void compare(YElement expected, YElement actual, EvalResult result) {
Map<String, List<String>> actTagLists = new HashMap<String, List<String>>();
for (YTagList yTagList : actual.getTagLists()) {
String type = yTagList.getType();
List<String> values = yTagList.getValues();
actTagLists.put(type, values);
}
for (YTagList yTagList : expected.getTagLists()) {
String type = yTagList.getType();
if (actTagLists.containsKey(type)) {
compareLists(yTagList.getValues(), actTagLists.get(type), type, result);
actTagLists.remove(type);
} else {
result.append(type, ResultStatus.FAILED, yTagList.size());
}
}
for (String type : actTagLists.keySet()) {
result.append(type, ResultStatus.REDUNDANT, actTagLists.get(type).size());
}
}
},
代码示例来源: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/yaddaweb-lite-core
Map<String, List<ViewSubject> > keywordsMap = new HashMap<String, List<ViewSubject>>();
for (YTagList tags : element.getTagLists()) {
if (YConstants.TG_SUBJECT_PRIMARY.equals(tags.getType())
|| YConstants.TG_SUBJECT_SECONDARY.equals(tags.getType())) {
List<ViewSubject> words = new ArrayList<ViewSubject>();
for (String s : tags.getValues()) {
代码示例来源: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.yadda/yaddaweb-lite-core
Map<String, List<ViewKeyword> > keywordsMap = new HashMap<String, List<ViewKeyword>>();
for (YTagList tags : element.getTagLists()) {
if (YConstants.TG_KEYWORD.equals(tags.getType())) {
List<ViewKeyword> words = new ArrayList<ViewKeyword>();
for (String s : tags.getValues()) {
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
if (YConstants.TG_KEYWORD.equals(kws.getType())) {
for (final String kw : kws.getValues()) {
keywords.append(" ").append(kw);
代码示例来源: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
if (tag != null && TagTypes.TG_KEYWORD.equals(tag.getType())) {
result.addKeyword(new KeywordsData(new LanguageData(tag.getLanguage())).setStringData(new ArrayList<String>(tag.getValues())));
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
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.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));
内容来源于网络,如有侵权,请联系作者删除!