Fix link to lexemes, fix #507

This commit is contained in:
Pieter Vander Vennet 2021-10-10 23:50:50 +02:00
parent ed161afc7e
commit 5f5079ddfe
2 changed files with 10 additions and 1 deletions

View file

@ -273,6 +273,15 @@ export default class Wikidata {
return undefined;
}
public static IdToArticle(id: string){
if(id.startsWith("Q")){
return "https://wikidata.org/wiki/"+id
}
if(id.startsWith("L")){
return "https://wikidata.org/wiki/Lexeme:"+id
}
throw "Unknown id type: "+id
}
/**
* Loads a wikidata page