Skip to content

Commit 223fc6c

Browse files
committed
Fix textExternalLink(s) typo
Resolves #26 Change-Id: Ieb95039dce7154b80e082978aecc7be589de2b95
1 parent 45347db commit 223fc6c

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixed
66

77
- Fixed `-L` (log directory) option being ignored when using internal taggers (`-T opennlp`, `-T marmot`, etc.)
8+
- Renamed `textExternalLinks` metadata field to `textExternalLink` (singular) (https://github.com/KorAP/korapxmltool/issues/26)
89

910
## [v3.1.2] - 2025-12-18
1011

app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4922,12 +4922,12 @@ class KorapXmlTool : Callable<Int> {
49224922
headerRoot.firstElement("ref") { it.getAttribute("type") == "page_url" }
49234923
?.getAttribute("target")?.takeIf { it.isNotBlank() }?.let { metadata["externalLink"] = it }
49244924

4925-
// Extract textExternalLinks from biblNote[@n='url']
4925+
// Extract textExternalLink from biblNote[@n='url']
49264926
val biblNoteUrl = analytic.firstElement("biblNote") { it.getAttribute("n") == "url" }
49274927
?.textContent?.trim()?.takeIf { it.isNotEmpty() }
49284928
?: monogr.firstElement("biblNote") { it.getAttribute("n") == "url" }
49294929
?.textContent?.trim()?.takeIf { it.isNotEmpty() }
4930-
metadata.putIfNotBlank("textExternalLinks", biblNoteUrl)
4930+
metadata.putIfNotBlank("textExternalLink", biblNoteUrl)
49314931

49324932
if (!metadata.containsKey("language")) {
49334933
metadata["language"] = "de"

app/src/main/kotlin/de/ids_mannheim/korapxmltools/formatters/KrillJsonGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ object KrillJsonGenerator {
145145
"ISBN", "URN", "pubPlace", "pubPlaceKey",
146146
"textType", "textTypeArt", "textTypeRef", "textDomain", "textColumn",
147147
"author", "title", "subTitle", "corpusTitle", "corpusSubTitle", "docTitle", "docAuthor",
148-
"textExternalLinks", "tokenSource"
148+
"textExternalLink", "tokenSource"
149149
)
150150

151151
fieldOrder.forEach { key ->
@@ -212,7 +212,7 @@ object KrillJsonGenerator {
212212
val encodedUrl = url.replace(":", "%3A").replace("/", "%2F")
213213
"type:attachement" to jsonString("data:application/x.korap-link;title=$title,$encodedUrl")
214214
}
215-
"textExternalLinks" -> {
215+
"textExternalLink" -> {
216216
val url = value.toString()
217217
val title = textData.headerMetadata["publisher"]?.toString() ?: "Link"
218218
val encodedUrl = url.replace(":", "%3A").replace("/", "%2F")

app/src/test/kotlin/de/ids_mannheim/korapxmltools/KrillJsonGeneratorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ class KrillJsonGeneratorTest {
724724
"docAuthor" to "User_A", // Anonymized
725725
"distributor" to "Institut für Deutsche Sprache",
726726
"pubPlace" to "San Bruno, California",
727-
"textExternalLinks" to "youtube.googleapis.com", // Partial match for URL
727+
"textExternalLink" to "youtube.googleapis.com", // Partial match for URL
728728
"tokenSource" to "base#tokens"
729729
)
730730

0 commit comments

Comments
 (0)