gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YDescription.getText()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 14:18:40 25 4
gpt4 key购买 nike

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

YDescription.getText介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private boolean notEmpty(YDescription ydescription){
  return (ydescription != null && ydescription.getText() != null);
}

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

/**
 * Selects most apropriate (English if available) description.
 * 
 * @param descriptions
 *            list of available descriptions
 * @return best found description or null if list is empty
 */
protected static String selectBestDescription(List<YDescription> descriptions) {
  if (descriptions == null || descriptions.size() == 0) {
    return null;
  }
  for (YDescription description : descriptions) { // Search for English version
    if (description.getLanguage().equals(YLanguage.English)) {
      return description.getText();
    }
  }
  return descriptions.get(0).getText();
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

public List<String> getDescription(AbstractNDA<?> abstractNDA, String type){
  List<YDescription> descriptions = abstractNDA.getDescriptions();
  if(descriptions != null){
    List<String> desc = new ArrayList<String>();
    for(YDescription description: descriptions){
      if(type.equals(description.getType())){
        desc.add(description.getText());
      }
    }
    
    return desc;
    
  } else {
    return Collections.emptyList();
  }
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected void fillDescriptions(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //      description element
  if (!yElement.getDescriptions().isEmpty()) {
    ret.put(E_DESCRIPTION, new ArrayList<StringWithAttributes>());
  }
  for (YDescription yDescription : yElement.getDescriptions()) {
    ret.get(E_DESCRIPTION).add(new StringWithAttributes(yDescription.getText()));
  }
}

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

protected void fillDescriptions(HtmlMetaHeaders metadata, YElement yElement) {
  for (YDescription yDescription : yElement.getDescriptions()) {
    if (DescriptionTypes.DS_ABSTRACT.equals(yDescription.getType())) {
      metadata.addMetadataName(DCTERMS_NAMESPACE + SEPARATOR + T_ABSTRACT, yDescription.getText());
    } else {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_DESCRIPTION, yDescription.getText());
    }
  }
}

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

/**
 * Utility function retrieving default description of NDA element in
 * specified language
 *
 * @param element
 * @return
 */
public static YDescription getDefaultDescription(AbstractNDA<?> element, YLanguage language) {
  List<YDescription> acceptableDescriptions = fetchDescriptions(element, language);
  if (acceptableDescriptions.isEmpty()) {
    return null;
  }
  if (acceptableDescriptions.size() == 1) {
    return acceptableDescriptions.get(0);
  }
  int bestDescription = 0, maxLength = 0;
  for (int i = 0; i < acceptableDescriptions.size(); i++) {
    YDescription description = acceptableDescriptions.get(i);
    String text = description.getText();
    int length = text.replaceAll("\\s", "").length();
    if (length > maxLength) {
      maxLength = length;
      bestDescription = i;
    }
  }
  return acceptableDescriptions.get(bestDescription);
}

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

protected void convertDescription(YElement yElement, BibEntry bibEntry) {
  List<YDescription> descriptions = yElement.getDescriptions();
  for (YDescription description : descriptions) {
    if (description.getType().equals(YConstants.DS_ABSTRACT)) {
      bibEntry.setField(BibEntry.FIELD_ABSTRACT, description.getText());
    }
    if (description.getType().equals(YConstants.DS_NOTE)) {
      bibEntry.setField(BibEntry.FIELD_NOTE, description.getText());
    }
  }
}

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

@Override
  void compare(YElement expected, YElement actual, EvalResult result) {
    Map<String, YDescription> actYDescMap = new HashMap<String, YDescription>();
    for (YDescription ydescr : actual.getDescriptions()) {
      String type = ydescr.getType();
      actYDescMap.put(type, ydescr);
    }
    for (YDescription ydescr : expected.getDescriptions()) {
      String type = ydescr.getType();
      if (actYDescMap.containsKey(type)) {
        if (ydescr.getText().equals(actYDescMap.get(type).getText())) {
          result.append(type, ResultStatus.RECOGNIZED, 1);
        } else {
          result.append(type, ResultStatus.FAILED, 1);
        }
        actYDescMap.remove(type);
      } else {
        result.append(type, ResultStatus.FAILED, 1);
      }
    }
    for (String type : actYDescMap.keySet()) {
      result.append(type, ResultStatus.REDUNDANT, 1);
    }
  }
},

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

/**
 * accomplished
 */
private void parseDescriptions() {
  if(!in_item.getDescriptions().isEmpty()){
    int descriptionid = 0;
    for(YDescription yd : in_item.getDescriptions()){
      descriptionid++;
      Statements s_desc = new Statements();statements.add(s_desc);
      s_desc.setSubject(RelConstants.NS_DESCRIPTION+in_item.getId()+"/"+descriptionid);
      LinkedList<PredicateAndObject> paos_description = new LinkedList<PredicateAndObject>();
      paos_description.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, yd.getLanguage().getName()));
      paos_description.add(new PredicateAndObject(RelConstants.RL_TYPE, yd.getType()));
      paos_description.add(new PredicateAndObject(RelConstants.RL_TEXT, yd.getText()));				
      paos_doc.add(new PredicateAndObject(RelConstants.RL_HAS_DESCRIPTION , RelConstants.NS_DESCRIPTION+in_item.getId()+"/"+descriptionid));
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

final YDescription oneDescription = institution.getOneDescription(YConstants.DS_ABSTRACT);
if (notEmpty(oneDescription)) {
  result.put("description", oneDescription.getText());
  result.put(YConstants.DS_NOTE, noteDescription.getText());

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

private String extractTextFromYElement(final YElement yElement) throws IOException {
  final String sep = " ";
  final YLanguage lang = YLanguage.Polish;
  StringBuilder builder = new StringBuilder();
  for (YName data : yElement.getNames()) {
    if(lang.equals(data.getLanguage())){
      builder.append(data.getText());
      builder.append(sep);
    }
  }
  for (YDescription data : yElement.getDescriptions()) {
    if(lang.equals(data.getLanguage())){
      builder.append(data.getText());
      builder.append(sep);
    }
  }
  
  for(FilteredContentEntry<?> plainTextFile:ResourceDisplayUtilsImpl.fetchPlainTextContentEntries(yElement)){
    if(plainTextFile.getSource() instanceof YContentFile){
      YContentFile file = (YContentFile)plainTextFile.getSource();
      ElementContent elementContent = repositoryFacade.fetchContent(yElement.getId(), file.getLocations().get(0));
      
      builder.append(IOUtils.toString(elementContent.getStream()));
      builder.append(sep);
    }
  }
  return builder.toString().trim();
}

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

/**
 * accomplished
 */
private void parseDescriptions() {
  if(!in_item.getDescriptions().isEmpty()){
    int descriptionid = 0;
    for(YDescription yd : in_item.getDescriptions()){
      descriptionid++;
      Statements s_desc = new Statements();statements.add(s_desc);
      s_desc.setSubject(RelConstants.NS_DESCRIPTION+in_item.getId()+"#"+descriptionid);
      LinkedList<PredicateAndObject> paos_description = new LinkedList<PredicateAndObject>();
      paos_description.add(new PredicateAndObject(RelConstants.RL_LANGUAGE, yd.getLanguage().getName()));
      paos_description.add(new PredicateAndObject(RelConstants.RL_TYPE, yd.getType()));
      paos_description.add(new PredicateAndObject(RelConstants.RL_TEXT, yd.getText()));				
      paos_doc.add(new PredicateAndObject(RelConstants.RL_HAS_DESCRIPTION , RelConstants.NS_DESCRIPTION+in_item.getId()+"#"+descriptionid));
    }
  }
}

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

if (YConstants.DS_ABSTRACT.equalsIgnoreCase(desc.getType())) {
  if (lang==null || lang.equals(desc.getLanguage())) {
   textsTexts.add(new Pair<String, TextType>(normalize(desc.getText()), TextType.ABSTRACT));
   hasAbstarct = true;
  textsTexts.add(new Pair<String, TextType>(normalize(desc.getText()), TextType.ABSTRACT));
  hasAbstarct = true;

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

if (YConstants.DS_ABSTRACT.equalsIgnoreCase(desc.getType())) {
  if (lang==null || lang.equals(desc.getLanguage())) {
    textsTexts.add(new Pair<String, TextType>(normalize(desc.getText()), TextType.ABSTRACT));
    hasAbstarct = true;

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

for (YDescription desc : elem.getDescriptions()) {
  if (YConstants.DS_ABSTRACT.equalsIgnoreCase(desc.getType())) {
    textsTexts.add(new Pair<String, TextType>(normalize(desc.getText()), TextType.ABSTRACT));
    hasAbstarct = true;

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

metadata.setTitle(defaultName);
final String defaultDescription = element.getOneDescription() == null ? null : element.getOneDescription()
    .getText();
metadata.setAbstract(defaultDescription);

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

YRichText yRichText = description.getRichText();
if(isSimple(yRichText)){
  page.setContent(description.getText());
} else {
  String text = YRTHelper.toXmlFragmentWithoutNamespaces(yRichText);

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