diff --git a/core/src/main/resources/templatetransform.json b/core/src/main/resources/templatetransform.json index fce2421f03..2d075c2515 100644 --- a/core/src/main/resources/templatetransform.json +++ b/core/src/main/resources/templatetransform.json @@ -30,7 +30,19 @@ }, "Lang":{ "transformer":"textNode", - "replace": "
$(3||)
" + "replace": "$(2||)" + }, + "Native name|native_name":{ + "transformer":"textNode", + "replace": "$(2||)" + }, + "Nihongo2":{ + "transformer":"textNode", + "replace": "$(1||)" + }, + "Nihongo":{ + "transformer":"textNode", + "replace": "$(2||)" }, "Marriage":{ "transformer":"extractChildren", diff --git a/core/src/test/scala/org/dbpedia/extraction/wikiparser/TemplateTransformParserTest.scala b/core/src/test/scala/org/dbpedia/extraction/wikiparser/TemplateTransformParserTest.scala index af95a30f41..dcb923d34d 100644 --- a/core/src/test/scala/org/dbpedia/extraction/wikiparser/TemplateTransformParserTest.scala +++ b/core/src/test/scala/org/dbpedia/extraction/wikiparser/TemplateTransformParserTest.scala @@ -53,6 +53,26 @@ class TemplateTransformParserTest extends FlatSpec with Matchers parse("en", "{{url|https://www.dji.com DJI.com}}") should be (Some("[https://www.dji.com]")) } + it should "extract text from {{lang|nap|Abbrùzzu}}" in + { + parse("en", "{{lang|nap|Abbrùzzu}}") should be (Some("Abbrùzzu")) + } + + it should "extract text from {{native name|nap|Abbrùzze}}" in + { + parse("en", "{{native name|nap|Abbrùzze}}") should be (Some("Abbrùzze")) + } + + it should "extract text from {{Nihongo2|東京都}}" in + { + parse("en", "{{Nihongo2|東京都}}") should be (Some("東京都")) + } + + it should "extract text from {{Nihongo|Tokyo|東京|Tōkyō}}" in + { + parse("en", "{{Nihongo|Tokyo|東京|Tōkyō}}") should be (Some("東京")) + } + private val wikiParser = WikiParser.getInstance()