本文整理了Java中pl.edu.icm.model.bwmeta.y.YAttribute.getKey()
方法的一些代码示例,展示了YAttribute.getKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAttribute.getKey()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YAttribute
类名称:YAttribute
方法名:getKey
暂无
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* TODO, so far: ignore
* @param ya
* @param paos_ref
* @param refno
* @return
*/
private boolean parseReferenceType(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_REFERENCE_PARSED_TYPE.equals(ya.getKey())){/*2*/
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private static boolean attributeHasOneOfKeys(YAttribute attribute, String... keys) {
final String key = attribute.getKey();
for (String matchKey : keys) {
if (matchKey.equals(key)) {
return true;
}
}
return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* TODO, so far: ignore
* @param ya
* @param paos_ref
* @param refno
* @return
*/
private boolean parseReferenceType(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_REFERENCE_PARSED_TYPE.equals(ya.getKey())){/*2*/
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
* @param ya
* @param paos_ref
* @param refno
* @return
*/
private boolean parseReferenceName(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_ENHANCED_FROM_ZBL_NAME.equals(ya.getKey())){/*8*/
for(YAttribute inner : ya.getAttributes()){
if(YConstants.AT_ENHANCED_FROM_ZBL_TYPE.equals(inner.getKey())){/*8.1*/
}else if(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE.equals(inner.getKey())){/*8.2*/
}else if(YConstants.AT_ENHANCED_FROM_ZBL_VALUE.equals(inner.getKey())){/*8.3*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_TITLE, inner.getValue()));
}
}
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
* @param ya
* @param paos_ref
* @param refno
* @return
*/
private boolean parseReferenceName(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_ENHANCED_FROM_ZBL_NAME.equals(ya.getKey())){/*8*/
for(YAttribute inner : ya.getAttributes()){
if(YConstants.AT_ENHANCED_FROM_ZBL_TYPE.equals(inner.getKey())){/*8.1*/
}else if(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE.equals(inner.getKey())){/*8.2*/
}else if(YConstants.AT_ENHANCED_FROM_ZBL_VALUE.equals(inner.getKey())){/*8.3*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_TITLE, inner.getValue()));
}
}
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private List<YAttribute> removeDocumentTypeAttribute() {
List<YAttribute> yAttributes = new ArrayList<>();
for (YAttribute yAttr : safe(article.getAttributes())) {
if(!yAttr.getKey().equals(CS.DOCUMENT_TYPE)) {
yAttributes.add(yAttr);
}
}
return yAttributes;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* transplantation form RelationStatementBuilder
* @param ya
* @param paos_ref
* @param refno
* @return
*/
private boolean parseReferenceText(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_REFERENCE_TEXT.equals(ya.getKey())){/*3*/
parseReferenceText(ya.getValue(), paos_ref, refno);
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
* @param ya
* @param paos_ref
* @param refno
* @param refid
* @return
*/
private boolean parseReferenceId(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_REFERENCE_PARSED_ID_MR.equals(ya.getKey())){/*1.1*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_MR_DOCUMENT+ ya.getValue()));
return true;
}else if(YConstants.AT_REFERENCE_PARSED_ID_ZBL.equals(ya.getKey())){/*1.2*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_ZBL_DOCUMENT+ ya.getValue()));
return true;
}else if(YConstants.AT_REFERENCE_PARSED_ID_ISBN.equals(ya.getKey())){
paos_ref.add(new PredicateAndObject(RelConstants.RL_HAS_ISBN, RelConstants.NS_ISBN+ ya.getValue()));
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* transplantation form RelationStatementBuilder
* @param ya
* @param paos_ref
* @param refno
* @param sb
* @return
* @throws YaddaException
*/
private boolean parseReferenceText(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno, StringBuffer sb) throws YaddaException {
if(YConstants.AT_REFERENCE_TEXT.equals(ya.getKey())){/*3*/
sb.append(ya.getValue().toString());
paos_ref.add(new PredicateAndObject(RelConstants.RL_TEXT, ya.getValue().toString()));
//further parsing of reference-parsed-text is done in parseReferences() method,
//hence parsing here is not allowed
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.synat/synat-core-services-impl
@Override
public DBObject convert(Collection<YAttribute> source) {
DBObject dbObject = new BasicDBObject();
for(YAttribute attribute : source){
Object attributeValue = getAttributeValue(attribute);
Object object = dbObject.get(attribute.getKey());
attributeValue = processValue(attributeValue, object);
String key = converter.potentiallyEscapeMapKey(attribute.getKey());
dbObject.put(key, attributeValue);
}
return dbObject;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private void proceedReferenceAuthorZblFingerPrint(YAttribute ya,
LinkedList<PredicateAndObject> pao) {
for(YAttribute inner : ya.getAttributes()){
if(YConstants.AT_ZBL_AUTHOR_FINGERPRINT.equals(inner.getKey()) && !"-".equals(inner.getValue())){/*5.1*/
String zblfingerprint=inner.getValue();
pao.add(new PredicateAndObject(RelConstants.RL_IS_PERSON, RelConstants.NS_ZBL_PERSON + zblfingerprint));
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
* @param ya
* @param paos_ref
* @param refno
* @param refid
* @return
*/
private boolean parseReferenceId(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
if(YConstants.AT_REFERENCE_PARSED_ID_MR.equals(ya.getKey())){/*1.1*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_MR_DOCUMENT+ ya.getValue()));
return true;
}else if(YConstants.AT_REFERENCE_PARSED_ID_ZBL.equals(ya.getKey())){/*1.2*/
paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_ZBL_DOCUMENT+ ya.getValue()));
return true;
}else if(YConstants.AT_REFERENCE_PARSED_ID_ISBN.equals(ya.getKey())){
paos_ref.add(new PredicateAndObject(RelConstants.RL_HAS_ISBN, RelConstants.NS_ISBN+ ya.getValue()));
return true;
}else return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<ViewContact> resolveContacts(final YInstitution personality) {
final List<ViewContact> contacts = new LinkedList<ViewContact>();
final List<String> contactKeys = new ArrayList<String>();
contactKeys.add(YConstants.AT_CONTACT);
contactKeys.add(YConstants.AT_CONTACT_LOCATION);
contactKeys.add(YConstants.AT_CONTACT_URL);
contactKeys.add(YConstants.AT_CONTACT_EMAIL);
contactKeys.add(YConstants.AT_CONTACT_PHONE);
contactKeys.add(YConstants.AT_CONTACT_FAX);
for (final String contactKey : contactKeys) {
final List<YAttribute> ycontacts = personality.getAttributes(contactKey);
if (ycontacts != null) {
for (final YAttribute contact : ycontacts) {
final ViewContact viewContact = new ViewContact(contact.getKey(), detailsFilter.filter(
contact.getValue(), InputType.PLAIN_TEXT));
contacts.add(viewContact);
}
}
}
return contacts;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
void compare(YElement expected, YElement actual, EvalResult result) {
List<YAttribute> expAttributes = expected.getAttributes();
Map<String, List<String>> actAttMap = new HashMap<String, List<String>>();
for (YAttribute yatt : actual.getAttributes()) {
String key = yatt.getKey();
if (actAttMap.get(key) == null) {
actAttMap.put(key, new ArrayList<String>());
}
actAttMap.get(key).add(yatt.getValue());
}
for (YAttribute yatt : expAttributes) {
String key = yatt.getKey();
if (actAttMap.containsKey(key)) {
if (actAttMap.get(key).contains(yatt.getValue())) {
result.append(key, ResultStatus.RECOGNIZED, 1);
} else {
result.append(key, ResultStatus.FAILED, 1);
}
//actAttMap.remove(key);
} else {
result.append(key, ResultStatus.FAILED, 1);
}
}
for (String key : actAttMap.keySet()) {
result.append(key, ResultStatus.REDUNDANT, 1);
}
}
},
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
private static YAttribute extractOneReferenceTextAttributeScNode(YAttribute ya) {
if(! ll.contains(ya.getKey())) return ya;
for(Part p:ya.getRichValue().toParts()){
if(p instanceof Node){
if("sc".equals(((Node)p).getTag()))
return new YAttribute(ya.getKey(),new YRichText(((Node)p).getParts().get(0).toString()));
}else if(p instanceof Leaf)
return new YAttribute(ya.getKey(),new YRichText(((Leaf)p).toPlainText()));
}
return ya;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private static YAttribute extractOneReferenceTextAttributeScNode(YAttribute ya) {
if(! ll.contains(ya.getKey())) return ya;
for(Part p:ya.getRichValue().toParts()){
if(p instanceof Node){
if("sc".equals(((Node)p).getTag()))
return new YAttribute(ya.getKey(),new YRichText(((Node)p).getParts().get(0).toString()));
}else if(p instanceof Leaf)
// if(p.toPlainText()!=null && !p.toPlainText().matches("[\\s]+"))
return new YAttribute(ya.getKey(),new YRichText(((Leaf)p).toPlainText()));
}
return ya;
}
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<ViewContact> resolveContributorContacts(final YContributor contributor,
final IFilteringContext filteringContext) {
final List<ViewContact> contacts = new LinkedList<ViewContact>();
for (final YAttribute contact : contributor.getAttributes()) {
if (contact.getKey().equals(YConstants.AT_AC_CONTACT_EMAIL)) {
final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_EMAIL,
filterEmail(contact.getValue(), filteringContext));
contacts.add(viewContact);
} else if (contact.getKey().equals(YConstants.AT_INSTITUTION)) {
for (final YAttribute contact2 : contact.getAttributes()) {
if (contact2.getKey().equals(YConstants.AT_INSTITUTION_MAIL)) {
final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_EMAIL,
filterEmail(contact2.getValue(), filteringContext));
contacts.add(viewContact);
} else if (contact2.getKey().equals(YConstants.AT_INSTITUTION_WWW)) {
final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_URL,
detailsFilter.filter(contact2.getValue(), InputType.RICH_TEXT, filteringContext));
contacts.add(viewContact);
} else if (contact2.getKey().equals(YConstants.AT_INSTITUTION_PHONE)) {
final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_PHONE,
detailsFilter.filter(contact2.getValue(), InputType.RICH_TEXT, filteringContext));
contacts.add(viewContact);
}
}
}
}
return contacts;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
if(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES.equals(inner.getKey())){/*5.2*/
String tmp = inner.getValue();
fname+=" "+ tmp;
}else if(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME.equals(inner.getKey())){/*5.3*/
sname=inner.getValue();
sname = NameProceeder.unifySurname(sname);
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
private static YElement putRelationReferenceToLeafsIntoNodes(YElement yelement) {
for(YRelation yr : yelement.getRelations()){
for(YAttribute ya : yr.getAttributes()){
if(! ll.contains(ya.getKey()))continue;
removeGivenTag("sc", ya.getRichValue().toParts());
ya.setValue(new YRichText(extractLeafs(removeNodeWithGivenTag("ext-link", ya.getRichValue().toParts()))));
}
}
return yelement;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private static YElement putRelationReferenceToLeafsIntoNodes(YElement yelement) {
for(YRelation yr : yelement.getRelations()){
// LinkedList<YAttribute> lya = new LinkedList<YAttribute>();
for(YAttribute ya : yr.getAttributes()){
if(! ll.contains(ya.getKey()))continue;
removeGivenTag("sc", ya.getRichValue().toParts());
ya.setValue(new YRichText(extractLeafs(removeNodeWithGivenTag("ext-link", ya.getRichValue().toParts()))));
// lya.add(ya);
}
// if(lya.size()>0)yr.setAttributes(lya);
}
return yelement;
}
内容来源于网络,如有侵权,请联系作者删除!