["key","the value of this tag will initialize search (default: name)"],
[
"options",
newCombine([
"A JSON-object of type `{ removePrefixes: string[], removePostfixes: string[] }`.",
newTable(
["subarg","doc"],
[
[
"removePrefixes",
"remove these snippets of text from the start of the passed string to search. This is either a list OR a hash of languages to a list. The individual strings are interpreted as case ignoring regexes",
],
[
"removePostfixes",
"remove these snippets of text from the end of the passed string to search. This is either a list OR a hash of languages to a list. The individual strings are interpreted as case ignoring regexes.",
],
[
"instanceOf",
"A list of Q-identifier which indicates that the search results _must_ be an entity of this type, e.g. [`Q5`](https://www.wikidata.org/wiki/Q5) for humans",
],
[
"notInstanceof",
"A list of Q-identifiers which indicates that the search results _must not_ be an entity of this type, e.g. [`Q79007`](https://www.wikidata.org/wiki/Q79007) to filter away all streets from the search results",
],
]
),
]),
],
]
),
newTitle("Example usage"),
`The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name
\`\`\`json
"freeform":{
"key":"name:etymology:wikidata",
"type":"wikidata",
"helperArgs":[
"name",
{
"removePostfixes":{"en":[
"street",
"boulevard",
"path",
"square",
"plaza",
],
"nl":["straat","plein","pad","weg",laan"],
"fr":["route (de|de la|de l'| de le)"]
},
"#":"Remove streets and parks from the search results:"