Closed ErdemYabaci closed 4 months ago
The error seems to be caused by one of the entites chosen for the distractors, which apparently lacks a Spanish text. I'll have to check them manually to see which one it is and replace it by another.
Ok so as it turns out is way more complex than I thought. The entity that gives up the problem is Q17 (Japan), but not because Tokyo does not have a value in Spanish, but because is not selecting Tokyo as the capital. Is selecting Shigaraki Palace (Q262438), which technically speaking it seems to have been correct (around the year 744). This is because is picking up the first result in the capital, which is not necesarily the correct one.
Now I'll try to came up with an algorithm to ensure it picks the correct capital.
So the idea is the following: When looking for the capital, instead of picking just the first one, it'll take all of them, and it'll process all of them (by making a request to Wikidata) until it finds the one without the End Time property (P582), since only the current capital does not have that property.
As you've probably realizaed, this is highly inneficient, since now to generate the question of a capital of a place, it'll have to make at least eight request to wikidata (one per each place plus another one for the capital), and that's only if said places have only one capital entity in their property capital or if they have the current one first, in any other case, it'll be bigger. So now the complexity of generating this question is O(n) instead of O(1).
Is finally solved and in the Question_Generation_General branch
I was sometimes getting this error while the languageCode was "es". It might be a fluke but issue solved itself when I removed the lines where languageCode = "es" was used.
Error: