-
Notifications
You must be signed in to change notification settings - Fork 306
Fix issue #804: Support multiple template namespace prefixes for Macedonian #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c03cd94
eaecc68
110616a
fa4ba54
e5f5c5a
d0b9a27
33c43b5
3135600
f88669a
5dcc0a4
c2843c6
d81fe9e
078e419
6f2c149
9ffe0ef
3b9822a
570e0d9
41678fd
22d089e
7464414
b88ab6b
df0b449
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Homepage**: http://dbpedia.org <br/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Documentation**: http://dev.dbpedia.org/Extraction <br/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Get in touch with DBpedia**: https://wiki.dbpedia.org/join/get-in-touch <br/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) slack channel within the the [DBpedia Slack workspace](https://dbpedia-slack.herokuapp.com/) - the main point for [developement updates](https://github.com/dbpedia/extraction-framework/blob/master/.github/workflows/maven.yml) and discussions <br/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) slack channel within the the [DBpedia Slack workspace]( https://join.slack.com/t/dbpedia/shared_invite/zt-nffbn1ra-dRoi8oeWBlolJb_lKifEqA) - the main point for developement updates and discussions <br/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos and casing in the Slack line. Small wording issues in user-facing docs. ✏️ Proposed fix-**Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) slack channel within the the [DBpedia Slack workspace]( https://join.slack.com/t/dbpedia/shared_invite/zt-nffbn1ra-dRoi8oeWBlolJb_lKifEqA) - the main point for developement updates and discussions <br/>
+**Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) Slack channel within the [DBpedia Slack workspace](https://join.slack.com/t/dbpedia/shared_invite/zt-nffbn1ra-dRoi8oeWBlolJb_lKifEqA) - the main point for development updates and discussions <br/>📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[uncategorized] ~7-~7: Did you mean the communication tool “Slack” (= proper noun, capitalized)? (ON_SKYPE) [grammar] ~7-~7: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos and capitalization in the Slack sentence. ✅ Suggested edit-**Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) slack channel within the the [DBpedia Slack workspace]( https://join.slack.com/t/dbpedia/shared_invite/zt-nffbn1ra-dRoi8oeWBlolJb_lKifEqA) - the main point for developement updates and discussions <br/>
+**Slack**: join the [**#dev-team**](https://dbpedia.slack.com/archives/C0L9MJFU7) Slack channel within the [DBpedia Slack workspace](https://join.slack.com/t/dbpedia/shared_invite/zt-nffbn1ra-dRoi8oeWBlolJb_lKifEqA) - the main point for development updates and discussions <br/>📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[uncategorized] ~7-~7: Did you mean the communication tool “Slack” (= proper noun, capitalized)? (ON_SKYPE) [grammar] ~7-~7: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Contents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -61,7 +61,7 @@ The DBpedia extraction framework is structured into different modules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Core Module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a name="p27582-10"></a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -76,9 +76,9 @@ The DBpedia extraction framework is structured into different modules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| In addition to the core components, a number of utility packages offers essential functionality to be used by the extraction code: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **Ontology** Classes used to represent an ontology. Methods for both, reading and writing ontologies are provided. All classes are located in the namespace [org.dbpedia.extraction.ontology](tree/master/core/src/main/scala/org/dbpedia/extraction/ontology) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **DataParser** Parsers to extract data from nodes in the abstract syntax tree. All classes are located in the namespace [org.dbpedia.extraction.dataparser](tree/master/core/src/main/scala/org/dbpedia/extraction/dataparser) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **Util** Various utility classes. All classes are located in the namespace [org.dbpedia.extraction.util](tree/master/core/src/main/scala/org/dbpedia/extraction/util) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **Ontology** Classes used to represent an ontology. Methods for both, reading and writing ontologies are provided. All classes are located in the namespace `org.dbpedia.extraction.ontology`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **DataParser** Parsers to extract data from nodes in the abstract syntax tree. All classes are located in the namespace `org.dbpedia.extraction.dataparser`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **Util** Various utility classes. All classes are located in the namespace `org.dbpedia.extraction.util`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a name="dump-extraction-module"></a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Dump extraction Module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -104,25 +104,25 @@ Please make sure you have read the Developer's Certificate of Origin, further do | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8. Send a pull request from your branch into `extraction-framework/dev` via GitHub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * In the description, reference the associated commit (for example, _"Fixes #123 by ..."_ for issue number 123). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Your changes will be reviewed and discussed on GitHub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * In addition, [Travis-CI](http://about.travis-ci.org/) will test if the merged version passes the build. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * In addition, [Travis-CI](https://www.travis-ci.com/about-us/) will test if the merged version passes the build. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * If there are further changes you need to make, because Travis said the build fails or because somebody caught something you overlooked, go back to item 4. Stay on the same branch (if it is still related to the same issue). GitHub will add the new commits to the same pull request. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * When everything is fine, your changes will be merged into `extraction-framework/dev`, finally the `dev` together with your improvements will be merged with the `master` branch. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Please keep in mind: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Try *not* to modify the indentation. If you want to re-format, use a separate "formatting" commit in which no functionality changes are made. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Never** rebase the master onto a development branch (i.e. _never_ call `rebase` from `extraction-framework/master`). Only rebase your branch onto the dev branch, *if and only if* nobody already pulled from the development branch! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - If you already pushed a branch to GitHub, later rebased the master onto this branch and then tried to push again, GitHub won't let you saying _"To prevent you from losing history, non-fast-forward updates were rejected"_. If _(and only if)_ you are sure that nobody already pulled from this branch, add `--force` to the push command. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [_"Don’t rebase branches you have shared with another developer."_](http://www.jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [_"Rebase is awesome, I use rebase exclusively for everything local. Never for anything that I've already pushed."_](http://jeffkreeftmeijer.com/2010/the-magical-and-not-harmful-rebase/#comment-87479247) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [_"Never ever rebase a branch that you pushed, or that you pulled from another person_"](http://blog.experimentalworks.net/2009/03/merge-vs-rebase-a-deep-dive-into-the-mysteries-of-revision-control/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - _"[Don’t rebase branches you have shared with another developer.](http://www.jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell/)"_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - _"[Rebase is awesome, I use rebase exclusively for everything local. Never for anything that I've already pushed.](http://jeffkreeftmeijer.com/2010/the-magical-and-not-harmful-rebase/#comment-87479247)"_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - _"[Never ever rebase a branch that you pushed, or that you pulled from another person](https://web.archive.org/web/20150622064245/http://blog.experimentalworks.net/2009/03/merge-vs-rebase-a-deep-dive-into-the-mysteries-of-revision-control/)"_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - In general, we prefer Scala over Java. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| More tips: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Guides to setup your development environment for [Intellij](Setting up IntelliJ IDEA) or [Eclipse](Setting up eclipse). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Get help with the [Maven build](Build-from-Source-with-Maven) or another form of [installation](Installation). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - [Download](Downloads) some data to work with. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - How to run [from Scala/Java](Run-from-Java-or-Scala) or [from a JAR](Run-from-a-JAR). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Having different troubles? Check the [troubleshooting page](Troubleshooting) or post on https://forum.dbpedia.org. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Get help with the [Maven build](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html) or another form of [installation](https://maven.apache.org/install.html). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - [Download](https://dumps.wikimedia.org/) some data to work with. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - How to run [from Scala/Java](https://docs.scala-lang.org/tutorials/scala-with-maven.html) or [from a JAR](https://docs.oracle.com/javase/tutorial/deployment/jar/run.html). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Having different troubles? Check the [troubleshooting page](https://maven.apache.org/users/getting-help.html) or post on https://forum.dbpedia.org. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+107
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve markdownlint warnings in the guidelines section. Nested list indentation, emphasis style, and bare URL can be made lint-friendly. ✏️ Proposed fix- * In addition, [Travis-CI](https://www.travis-ci.com/about-us/) will test if the merged version passes the build.
- * If there are further changes you need to make, because Travis said the build fails or because somebody caught something you overlooked, go back to item 4. Stay on the same branch (if it is still related to the same issue). GitHub will add the new commits to the same pull request.
- * When everything is fine, your changes will be merged into `extraction-framework/dev`, finally the `dev` together with your improvements will be merged with the `master` branch.
+ * In addition, [Travis-CI](https://www.travis-ci.com/about-us/) will test if the merged version passes the build.
+ * If there are further changes you need to make, because Travis said the build fails or because somebody caught something you overlooked, go back to item 4. Stay on the same branch (if it is still related to the same issue). GitHub will add the new commits to the same pull request.
+ * When everything is fine, your changes will be merged into `extraction-framework/dev`, finally the `dev` together with your improvements will be merged with the `master` branch.
@@
-- Try *not* to modify the indentation. If you want to re-format, use a separate "formatting" commit in which no functionality changes are made.
-- **Never** rebase the master onto a development branch (i.e. _never_ call `rebase` from `extraction-framework/master`). Only rebase your branch onto the dev branch, *if and only if* nobody already pulled from the development branch!
+- Try _not_ to modify the indentation. If you want to re-format, use a separate "formatting" commit in which no functionality changes are made.
+- __Never__ rebase the master onto a development branch (i.e. _never_ call `rebase` from `extraction-framework/master`). Only rebase your branch onto the dev branch, _if and only if_ nobody already pulled from the development branch!
@@
-- Having different troubles? Check the [troubleshooting page](https://maven.apache.org/users/getting-help.html) or post on https://forum.dbpedia.org.
+- Having different troubles? Check the [troubleshooting page](https://maven.apache.org/users/getting-help.html) or post on [https://forum.dbpedia.org](https://forum.dbpedia.org).📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[style] ~108-~108: Consider an alternative to strengthen your wording. (CHANGES_ADJUSTMENTS) [style] ~116-~116: Consider using a more formal and expressive alternative to ‘awesome’. (AWESOME) 🪛 markdownlint-cli2 (0.18.1)107-107: Unordered list indentation (MD007, ul-indent) 108-108: Unordered list indentation (MD007, ul-indent) 109-109: Unordered list indentation (MD007, ul-indent) 112-112: Emphasis style (MD049, emphasis-style) 112-112: Emphasis style (MD049, emphasis-style) 113-113: Emphasis style (MD049, emphasis-style) 113-113: Emphasis style (MD049, emphasis-style) 125-125: Bare URL used (MD034, no-bare-urls) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Important: Developer's Certificate of Origin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| By sending a pull request to the [extraction-framework repository](https://github.com/dbpedia/extraction-framework) on GitHub, you implicitly accept the [Developer's Certificate of Origin 1.1](https://github.com/dbpedia/extraction-framework/blob/master/documentation/DeveloperCertificateOfOrigin.md) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,13 @@ | ||||||||||||||||||||||||
| package org.dbpedia.extraction.mappings | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import java.util.logging.Logger | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import org.dbpedia.extraction.annotations.ExtractorAnnotation | ||||||||||||||||||||||||
| import org.dbpedia.extraction.config.Config | ||||||||||||||||||||||||
| import org.dbpedia.extraction.config.provenance.DBpediaDatasets | ||||||||||||||||||||||||
| import org.dbpedia.extraction.ontology.Ontology | ||||||||||||||||||||||||
| import org.dbpedia.extraction.transform.{Quad, QuadBuilder} | ||||||||||||||||||||||||
| import org.dbpedia.extraction.util.{Language, MediaWikiConnector} | ||||||||||||||||||||||||
| import org.dbpedia.extraction.util.abstracts.AbstractUtils | ||||||||||||||||||||||||
| import org.dbpedia.extraction.util.{Language, MediaWikiConnector, WikiUtil} | ||||||||||||||||||||||||
| import org.dbpedia.extraction.wikiparser._ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import scala.language.reflectiveCalls | ||||||||||||||||||||||||
|
|
@@ -30,7 +30,7 @@ import scala.language.reflectiveCalls | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| @deprecated("replaced by NifExtractor.scala: which will extract the whole page content including the abstract", "2016-10") | ||||||||||||||||||||||||
| @ExtractorAnnotation("abstract extractor") | ||||||||||||||||||||||||
| class AbstractExtractor( | ||||||||||||||||||||||||
| class PlainAbstractExtractor( | ||||||||||||||||||||||||
| context : { | ||||||||||||||||||||||||
| def ontology : Ontology | ||||||||||||||||||||||||
| def language : Language | ||||||||||||||||||||||||
|
|
@@ -39,7 +39,7 @@ class AbstractExtractor( | |||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| extends WikiPageExtractor | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| protected val logger = Logger.getLogger(classOf[AbstractExtractor].getName) | ||||||||||||||||||||||||
| protected val logger = Logger.getLogger(classOf[PlainAbstractExtractor].getName) | ||||||||||||||||||||||||
| this.getClass.getClassLoader.getResource("myproperties.properties") | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -50,6 +50,8 @@ extends WikiPageExtractor | |||||||||||||||||||||||
| //private val apiParametersFormat = "uselang="+language+"&format=xml&action=parse&prop=text&title=%s&text=%s" | ||||||||||||||||||||||||
| protected val apiParametersFormat = context.configFile.abstractParameters.abstractQuery | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| protected val removeBrokenBrackets = context.configFile.abstractParameters.removeBrokenBracketsProperty | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // lazy so testing does not need ontology | ||||||||||||||||||||||||
| protected lazy val shortProperty = context.ontology.properties(context.configFile.abstractParameters.shortAbstractsProperty) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -63,7 +65,6 @@ extends WikiPageExtractor | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| private val mwConnector = new MediaWikiConnector(context.configFile.mediawikiConnection, context.configFile.abstractParameters.abstractTags.split(",")) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| override def extract(pageNode : WikiPage, subjectUri: String): Seq[Quad] = | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| //Only extract abstracts for pages from the Main namespace | ||||||||||||||||||||||||
|
|
@@ -79,16 +80,22 @@ extends WikiPageExtractor | |||||||||||||||||||||||
| // if(abstractWikiText == "") return Seq.empty | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| //Retrieve page text | ||||||||||||||||||||||||
| val text = mwConnector.retrievePage(pageNode.title, apiParametersFormat, pageNode.isRetry) match{ | ||||||||||||||||||||||||
| case Some(t) => AbstractExtractor.postProcessExtractedHtml(pageNode.title, replacePatterns(t)) | ||||||||||||||||||||||||
| val text = mwConnector.retrievePage(pageNode.title, apiParametersFormat, pageNode.isRetry) match { | ||||||||||||||||||||||||
| case Some(t) => PlainAbstractExtractor.postProcessExtractedHtml(pageNode.title, replacePatterns(t)) | ||||||||||||||||||||||||
| case None => return Seq.empty | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| val modifiedText = if (removeBrokenBrackets) { | ||||||||||||||||||||||||
| AbstractUtils.removeBrokenBracketsInAbstracts(text) | ||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||
| text | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| //Create a short version of the abstract | ||||||||||||||||||||||||
| val shortText = short(text) | ||||||||||||||||||||||||
| val shortText = short(modifiedText) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| //Create statements | ||||||||||||||||||||||||
| val quadLong = longQuad(pageNode.uri, text, pageNode.sourceIri) | ||||||||||||||||||||||||
| val quadLong = longQuad(pageNode.uri,modifiedText, pageNode.sourceIri) | ||||||||||||||||||||||||
| val quadShort = shortQuad(pageNode.uri, shortText, pageNode.sourceIri) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (shortText.isEmpty) | ||||||||||||||||||||||||
|
|
@@ -140,7 +147,7 @@ extends WikiPageExtractor | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| private def replacePatterns(abst: String): String= { | ||||||||||||||||||||||||
| var ret = abst | ||||||||||||||||||||||||
| for ((regex, replacement) <- AbstractExtractor.patternsToRemove) { | ||||||||||||||||||||||||
| for ((regex, replacement) <- PlainAbstractExtractor.patternsToRemove) { | ||||||||||||||||||||||||
| val matches = regex.pattern.matcher(ret) | ||||||||||||||||||||||||
| if (matches.find()) { | ||||||||||||||||||||||||
| ret = matches.replaceAll(replacement) | ||||||||||||||||||||||||
|
|
@@ -205,15 +212,15 @@ extends WikiPageExtractor | |||||||||||||||||||||||
| .filter(renderNode) | ||||||||||||||||||||||||
| .map(_.toWikiText) | ||||||||||||||||||||||||
| .mkString("").trim | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // decode HTML entities - the result is plain text | ||||||||||||||||||||||||
| decodeHtml(text) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| object AbstractExtractor { | ||||||||||||||||||||||||
| object PlainAbstractExtractor { | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| //TODO check if this function is still relevant | ||||||||||||||||||||||||
| def postProcessExtractedHtml(pageTitle: WikiTitle, text: String): String = | ||||||||||||||||||||||||
|
|
@@ -243,6 +250,7 @@ object AbstractExtractor { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| val patternsToRemove = List( | ||||||||||||||||||||||||
| """<div style=[^/]*/>""".r -> " ", | ||||||||||||||||||||||||
| """</div>""".r -> " " | ||||||||||||||||||||||||
| """</div>""".r -> " ", | ||||||||||||||||||||||||
| """<normalized>.*<\/normalized>""".r -> "" | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
Comment on lines
251
to
255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make
🔧 Proposed fix (non-greedy DOTALL) val patternsToRemove = List(
"""<div style=[^/]*/>""".r -> " ",
"""</div>""".r -> " ",
- """<normalized>.*<\/normalized>""".r -> ""
+ """(?s)<normalized>.*?</normalized>""".r -> ""
)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Comment on lines
251
to
255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use non-greedy matching for The regex 🐛 Proposed fix val patternsToRemove = List(
"""<div style=[^/]*/>""".r -> " ",
"""</div>""".r -> " ",
- """<normalized>.*<\/normalized>""".r -> ""
+ """<normalized>.*?<\/normalized>""".r -> ""
)🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve markdownlint issues: bare URLs + missing code‑fence languages.
Line 11 and Line 19 include bare URLs, and the fenced blocks at Lines 27/31/35 are missing language identifiers. There’s also a blank line inside a blockquote (Line 25). These are easy markdownlint failures to fix.
✅ Suggested cleanup
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
11-11: Bare URL used
(MD034, no-bare-urls)
11-11: Bare URL used
(MD034, no-bare-urls)
11-11: Bare URL used
(MD034, no-bare-urls)
19-19: Bare URL used
(MD034, no-bare-urls)
19-19: Bare URL used
(MD034, no-bare-urls)
25-25: Blank line inside blockquote
(MD028, no-blanks-blockquote)
27-27: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
35-35: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents