- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中pl.edu.icm.model.bwmeta.y.YDescription.<init>()
方法的一些代码示例,展示了YDescription.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YDescription.<init>()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YDescription
类名称:YDescription
方法名:<init>
暂无
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
/**
* Creates a description given its language, text and type.
* If the text is empty or null, does not create a description but returns null.
*
* @param lang language of the description
* @param text text of the description, may be null
* @param type type of the description
* @return created description, or null if text was empty or null
*/
public YDescription description(YLanguage lang, YRichText text, String type) {
if (empty(text)) return null;
return new YDescription(lang, text, type);
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
/**
* Creates a description given its language, text and type.
* If the text is empty or null, does not create a description but returns null.
*
* @param lang language of the description
* @param text text of the description, may be null
* @param type type of the description
* @return created description, or null if text was empty or null
*/
public YDescription description(YLanguage lang, String text, String type) {
if (empty(text)) return null;
return new YDescription(lang, text, type);
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private static void replaceDescriptionsField(final YElement yElement, final String[] values) {
if (values != null && values.length > 0) {
final List<YDescription> descriptions = yElement.getDescriptions();
// remove abstracts
final List<YDescription> removed = clear(descriptions, YConstants.DS_ABSTRACT);
if (removed.size() != values.length) {
log.warn("Different count of field:{} values from search-{} and bwmeta-{}. Some values may be lost.",
new Object[] { IndexFields.F_DESCRIPTIONS, values.length, removed.size() });
}
// add highlighted values
for (final String value : values) {
final String[] langValue = StringUtils.split(value, " ", 2);
final YLanguage lang = determineLang(langValue);
if (lang != null) {
descriptions.add(new YDescription(lang, langValue[1], YConstants.DS_ABSTRACT));
}
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
protected boolean enhanceMetadata(BxDocument document, YElement metadata) {
String text = "";
for (BxPage page : filterPages(document)) {
for (BxZone zone : filterZones(page)) {
String[] lines = zone.toText().split("\n");
for (String line : lines) {
if (line.toLowerCase().startsWith("keywords")
|| line.toLowerCase().startsWith("key words")) {
break;
}
text += "\n" + line;
}
}
}
text = text.trim();
if (!text.isEmpty()) {
Matcher matcher = PREFIX.matcher(text);
if (matcher.find()) {
text = text.substring(matcher.end()).trim();
}
metadata.addDescription(new YDescription().setType(YConstants.DS_ABSTRACT).setText(text));
return true;
}
return false;
}
代码示例来源: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.bwmeta/bwmeta-2-foreign-transformers
public void updateElementContentLinks(org.jdom.Element ameta, YElement article) {
List<org.jdom.Element> selfs = JDOMHelper.getChildren(ameta, "self-uri");
for (org.jdom.Element uri : selfs) {
String type = FileTypes.FT_FULL_TEXT;
String mime = uri.getAttributeValue("content-type");
if (mime == null) {
type = FileTypes.FT_ELEMENT_WEBPAGE;
mime = "text/html";
}
String href = uri.getAttributeValue("href", XLINK_NAMESPACE);
YContentFile contentFile = y.contentFile(href, type, mime, href);
if (contentFile!=null) {
contentFile.addDescription(new YDescription(YLanguage.English, uri.getValue()));
article.addContent(contentFile);
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public void convertDescription(BibEntry source, YElement yElement) {
//note
String note = source.getFirstFieldValue(BibEntry.FIELD_NOTE);
if (note != null) {
yElement.addDescription(new YDescription().setType(YConstants.DS_NOTE).setText(note));
}
//abstract
String abstractField = source.getFirstFieldValue(BibEntry.FIELD_ABSTRACT);
if (abstractField != null) {
yElement.addDescription(new YDescription().setType(YConstants.DS_ABSTRACT).setText(abstractField));
}
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private YDescription toYAbstract(LocalizedString abstractValue) {
YLanguage language = YLanguage.byCode(abstractValue.getLang(), YLanguage.English);
YRichText yAbstractText = yRichTextExtractor.extractFrom(abstractValue.getText());
YDescription description = new YDescription(language, yAbstractText, YConstants.DS_ABSTRACT);
return description;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-yadda
private YElement prepareYElement(String id, Properties prop) {
YElement yElement = new YElement();
yElement.setId(id);
if (!prop.getProperty("title").isEmpty()) {
yElement.addName(new YName(prepareProperty("title", prop)));
}
yElement.addDescription(new YDescription(YLanguage.Undetermined, prepareProperty("description", prop), DescriptionTypes.DS_SUMMARY));
if (!prop.getProperty("key-words").isEmpty()) {
List<String> tags = new ArrayList<String>(Arrays.asList(prepareProperty("key-words", prop).split(",")));
yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
}
if (!prop.getProperty("supplier").isEmpty()) {
yElement.addAttribute("copyright-holder", prepareProperty("supplier", prop));
}
if (!prop.getProperty("duration").isEmpty()) {
yElement.addAttribute("duration", prepareProperty("duration", prop));
}
yElement.addLanguage(YLanguage.Undetermined);
return yElement;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
private YDescription createDescription(String descriptionType, YLanguage yLanguage, Abstract abs) {
String abstractContent = abs.getAbstractContent();
YRichText richText = BaseYModelUtils.buildRichText(abstractContent);
YDescription desc = new YDescription();
desc.setLanguage(yLanguage);
desc.setType(descriptionType);
desc.setText(richText);
return desc;
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
private void updateArticleDescription(ZentralBlattRecord src, YElement yelement) {
if (src.hasField("ab")) {
String abText = src.getField("ab").trim();
if (isValidDescription(abText)) {
YDescription desc = new YDescription();
desc.setType(isSummary(abText) ? YConstants.DS_SUMMARY : YConstants.DS_ABSTRACT);
desc.setText(filterAbstractPrefixes(abText));
yelement.addDescription(desc);
}
}
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
protected YDescription convert(Abstract abs) {
YDescription description = new YDescription();
if (StringUtils.isNotBlank(abs.getLang())) {
description.setLanguage(YLanguage.byCode(abs.getLang()));
}
final List<Part> parts;
if (!abs.getPS().isEmpty()) {
parts = convertToParts(abs.getPS());
} else if (!abs.getSecs().isEmpty()) {
parts = convertToParts(abs.getSecs());
} else {
return null;
}
YRichText richText = new YRichText(parts);
description.setText(richText);
return description;
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
protected void updateYElement(final DataSet dataSet, final YElement yElement) {
YStructure yStructure = new YStructure(DATA_SET_YSTRUCTURE);
YCurrent yCurrent = new YCurrent(DATA_SET_YLEVEL);
yStructure.setCurrent(yCurrent);
Collection<YStructure> structures = Collections.singletonList(yStructure);
yElement.setStructures(structures);
if (StringUtils.isNotBlank(dataSet.getId())) {
yElement.setId(DATA_SET_YELEMENT_ID_PREFIX + dataSet.getId());
}
if (StringUtils.isNotBlank(dataSet.getName())) {
yElement.setNames(Collections.singletonList(new YName(dataSet.getName())));
}
if (StringUtils.isNotBlank(dataSet.getDescription())) {
yElement.setDescriptions(Collections.singletonList(new YDescription(YLanguage.Undetermined, dataSet.getDescription())));
}
if (dataSet.getDefaultLicense() != null) {
YTagList tagList = new YTagList();
tagList.setType(YModelUtils.LICENSE);
tagList.addValue(dataSet.getDefaultLicense().getId());
yElement.addTagList(tagList);
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean addMetadataIfNeeded(HarvestingResult harvestingResult, YElement element) {
boolean metadataModified = false;
if (shouldAbstractBeAdded(harvestingResult, element)) {
Node htmlNode = new Node(BaseYModelUtils.XHTML_NAMESPACE, BaseYModelUtils.HTML_TAG);
htmlNode.addPart(new Leaf(StringUtils.trim(harvestingResult.getDesciption())));
YRichText richText = new YRichText(Arrays.asList(htmlNode));
YDescription newAbstract = new YDescription(YLanguage.Undetermined, richText, DescriptionTypes.DS_ABSTRACT);
element.addDescription(newAbstract);
metadataModified = true;
}
if (shouldImpactFactorBeAdded(harvestingResult, element)) {
element.addAttribute(new YAttribute(YModelUtils.IMPACT_FACTOR, harvestingResult.getImpactFactor().toEngineeringString()));
metadataModified = true;
}
if (shouldFrequencyBeAdded(harvestingResult, element)) {
element.addAttribute(new YAttribute(YModelUtils.FREQUENCY, harvestingResult.getFrequency()));
metadataModified = true;
}
List<YCategoryRef> refs = element.getCategoryRefs();
if (shouldCategoryRefsBeAdded(harvestingResult, refs)) {
refs.addAll(harvestingResult.getCategories());
metadataModified = true;
}
if (shouldTitlesBeAdded(harvestingResult, element)) {
metadataModified |= addTitleHistory(harvestingResult.getOtherTitles(), element);
}
return metadataModified;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
for (LocalizedData<String> description : resource.getDescriptions()) {
if (StringUtils.isNotEmpty(description.getData())) {
yElement.addDescription(new YDescription(description.getLanguage().getyLanguage(), extractor.extractFrom(description.getData())));
代码示例来源:origin: pl.edu.icm.synat/synat-importer-speech-to-text
private void prepareYElementFromApi(Video video, YElement yElement) throws ParseException {
yElement.addName(new YName(video.getSnippet().getTitle()));
yElement.addDescription(new YDescription(YLanguage.Undetermined, video.getSnippet().getDescription()
, DescriptionTypes.DS_SUMMARY));
prepareDate(video, yElement);
String license = video.getStatus().getLicense();
if(null != license && license.contains("creativeCommon")) {
yElement.addTagList(new YTagList().setType(YModelUtils.LICENSE).addValue("cc0"));
}
prepareContent(video, yElement);
List<String> tags = video.getSnippet().getTags();
if (CollectionUtils.isNotEmpty(tags)) {
yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
}
YCurrent currentLevel = new YCurrent().setLevel(VideoConstants.VIDEO_CURRENT_LEVEL);
yElement.addStructure(new YStructure()
.setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_PUBLICATION)
.setCurrent(currentLevel));
prepareAttributes(video, yElement);
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
if(abstrakt!=null){
if(abstrakt.getAbstractText()!=null){
article.addDescription(new YDescription(YLanguage.English,xmc.getArticle().getAbstract().getAbstractText(),DescriptionTypes.DS_ABSTRACT));
if(otherAbstrakt!=null){
if(otherAbstrakt.getAbstractText()!=null){
article.addDescription(new YDescription(YLanguage.Undetermined,otherAbstrakt.getAbstractText(),DescriptionTypes.DS_ABSTRACT));
if(generalNotes!=null){
for(String note:generalNotes){
article.addDescription(new YDescription(YLanguage.Undetermined,note, DescriptionTypes.DS_NOTE));
何时使用 init、带参数的 init 或 iOS 8 (Swift) 中的便利 init, Objective-C 中的 convenience init 等价于什么? 最佳答案 你的类将有一个必需
我正在阅读这个 First Search Program - Artificial Intelligence for Robotics 算法,我正在阅读它的 Python 代码。在这里,我们创建了一个
我觉得答案很明显,但我一直无法弄清楚,这对我来说似乎是一个反复出现的问题。基本上我想做这样的事情: extension NSData { convenience init(JSONObject
cloud-init 是在首次启动时在虚拟机上执行各种配置的包。您必须使用您的配置配置一个文件,然后将其扔到您的 VM 上,然后对其进行虚拟化。 但它究竟是如何工作的呢?用户数据如何发送到 VM,cl
我目前正在与 CoreOS 打交道,到目前为止,我认为我已经掌握了总体思路和概念。我还没有得到的一件事是执行 cloud-init . 我明白 cloud-init是一个为 CoreOS 做一些配置的
部署项目后,当客户端第一次向 TestServlet 发送请求时,服务器会创建 testServlet 对象,然后调用第一个 init() 方法(init(ServletConfig config))
是否有可能在 convenience init 中以某种方式解包可选 init? convenience init(...) { self.init?(...) ?? self.init() }
使用时 write_files使用 cloud-init,是否可以附加内容?如果是这样,如何? write_files: [ { "path": "/home/user/some-file
我对 Ansible 比较陌生,我创建了一个剧本,可以在“裸”服务器上安装 Tomcat 配置。我想知道如何解决能够更新 init.d 脚本的问题,同时避免在脚本没有更改时在剧本开始时停止服务。这是基
我打算在 iOS 中使用参数调用 init 方法中的默认 init 方法。像这样: -(id)init{ self = [super init]; if (self) {
Objective C 规范(来自 Apple)第 49 页指出每个声明实例变量的类都必须提供一个 init 方法来初始化它们 我的问题 -为什么这是必要的? NSObject 不会为实例初始化 iV
所以我有一个带有指定初始化器的类,它为每个存储的属性取值。我所有存储的属性也有一个默认值,所以我假设这个类有一个默认的初始化。 在我指定的 init 中,我调用 super.init() 问题是,如果
我对此有些困惑: class Person { var name: String var age: Int init(){ name = “Tim”
我有一个带有两个初始化方法的对象。其中一个接受 NSDictionary,另一个接受一大堆 String 变量。我想调用 NSDictionary init,然后从那里将我的字典转换为字符串,然后用我
我正在尝试为我的类创建一个方便的初始化:User。我之前为另一个类(class)做过这个,并且 - 再次创建它 - 我使用了相同的代码,只是我的用户类(class)有所不同。 这是我的用户类: imp
我已经通读了以下秘诀,它展示了一种使用 Google Cloud Endpoints 后端为 AngularJS 前端提供动力的方法: https://cloud.google.com/resourc
本文整理了Java中com.netflix.zuul.init.ZuulFiltersModule.()方法的一些代码示例,展示了ZuulFiltersModule.()的具体用法。这些代码示例主要来
我想实现一个 初始化 下功能 box.once() 在 Tarantool 中只执行一次,但是,只有在 时才对我有用初始化 已成功执行。 问题 : 如何使“onceinit”记录只有在 init 成功
如果在Xcode中创建新的游戏模板项目,则默认GameViewController将使用以下初始化程序实例化游戏场景: let scene = SKScene(fileNamed: "GameScen
我有一个 MKPolyline我要实现的 subblas NSCoding , IE。 @interface RSRoutePolyline : MKPolyline I asked a quest
我是一名优秀的程序员,十分优秀!