本文整理了Java中pl.edu.icm.model.bwmeta.y.YTagList.getValues()
方法的一些代码示例,展示了YTagList.getValues()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YTagList.getValues()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YTagList
类名称:YTagList
方法名:getValues
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
public static List<String> mergeYTagList(List<YTagList> tagList) {
List<String> result = new LinkedList<>();
for (YTagList tags : tagList) {
result.addAll(tags.getValues());
}
return result;
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private void resizeAndSetValues(YTagList orgTags, final int maxSize) {
if (orgTags.getValues().size() < maxSize) {
orgTags.setValues(orgTags.getValues());
} else {
orgTags.setValues(orgTags.getValues().subList(BEG, maxSize));
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private void prepareElementKeywords(YElement element, final String to, YTagList tags, YTagList orgTags) {
Object[] orgValuesArray = orgTags.getValues().toArray();
for (String tagValue : tags.getValues()) {
if (ArrayUtils.contains(orgValuesArray, tagValue)) {
continue;
}
orgTags.addValue(tagValue);
}
resizeAndSetValues(orgTags, maxKeywords);
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
protected void convertKeywords(YElement yElement, BibEntry bibEntry) {
YTagList tagList = yElement.getTagList(YConstants.TG_KEYWORD);
List<String> keywordsList = new ArrayList<String>();
if (tagList != null) {
keywordsList = tagList.getValues();
StringBuilder bibEntryKeywords = new StringBuilder();
for (int i = 0; i < keywordsList.size() - 1; i++) {
bibEntryKeywords.append(keywordsList.get(i));
bibEntryKeywords.append("; ");
}
bibEntryKeywords.append(keywordsList.get(keywordsList.size() - 1));
bibEntry.setField(BibEntry.FIELD_KEYWORDS, bibEntryKeywords.toString());
}
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
protected void fillSubjects(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
// subject element
if (!yElement.getTagLists().isEmpty()) {
ret.put(E_SUBJECT, new ArrayList<StringWithAttributes>());
}
for (YTagList yTagList : yElement.getTagLists()) {
for (String tag : yTagList.getValues()) {
ret.get(E_SUBJECT).add(new StringWithAttributes(tag));
}
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public HtmlMetaHeaders prepareKeywordsMetadata(final YElement yElement) {
HtmlMetaHeaders keywordsMetadata = new HtmlMetaHeaders();
StringBuilder keywordsSb = new StringBuilder();
for (YTagList tagList : yElement.getTagLists(TG_KEYWORD)) {
for (String keyword : tagList.getValues()) {
keywordsSb.append((keywordsSb.length() == 0) ? keyword : ", " + keyword);
}
keywordsMetadata.addMetadataName("keywords", keywordsSb.toString());
}
return keywordsMetadata;
}
代码示例来源: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/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements, YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
if (articles.size() == 0) {
return null;
}
if (articles.size() > 1) {
log.error("More than one article found in package of yelements!");
}
YElement article = articles.get(0);
YTagList kwList = article.getTagList(YConstants.TG_KEYWORD);
if (kwList == null || kwList.size()==0) {
return null;
}
StringBuilder keywords = new StringBuilder();
for (String kw: kwList.getValues()) {
keywords.append(kw);
keywords.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
}
return keywords.toString();
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
protected void fillSubjects(HtmlMetaHeaders metadata, YElement yElement) {
for (YTagList yTagList : yElement.getTagLists()) {
for (String value : yTagList.getValues()) {
metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_SUBJECT, value);
}
}
}
代码示例来源: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/yadda-cli
for (String s : el.getTagList(YConstants.TG_KEYWORD).getValues()) {
String t = normalize(s);
KeyPhraseStats stat = stats.get(t);
代码示例来源: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
|| YConstants.TG_SUBJECT_SECONDARY.equals(tags.getType())) {
List<ViewSubject> words = new ArrayList<ViewSubject>();
for (String s : tags.getValues()) {
String eKw = detailsFilter.filter(s,
InputType.PLAIN_TEXT, filteringContext);
代码示例来源:origin: pl.edu.icm.yadda/yadda-cli
for (String s : el.getTagList(YConstants.TG_KEYWORD).getValues()) {
String t = normalize(s);
KeyPhraseStats stat = stats.get(t);
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
if (YConstants.TG_KEYWORD.equals(tags.getType())) {
List<ViewKeyword> words = new ArrayList<ViewKeyword>();
for (String s : tags.getValues()) {
String eKw = detailsFilter.filter(s,
InputType.PLAIN_TEXT, filteringContext);
代码示例来源: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.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-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);
}
}
内容来源于网络,如有侵权,请联系作者删除!