leon icon indicating copy to clipboard operation
leon copied to clipboard

What is the capital city gives wrong answer (should be not understood)

Open dkatz23238 opened this issue 5 years ago • 7 comments

Specs

  • Leon version: 1.0.0-beta.2
  • OS (or browser) version: Ubuntu 18.0
  • Node.js version: 12.5.0

Expected Behavior

Ideally there should be a capital city module :) I would be glad to work on this.

Actual Behavior

I belive the meaning of life module is being triggered.

The response from leon is: 1 0 1 0 1 0.

How Do We Reproduce?

Run a fresh Leon instance and ask "what is the capital of Nigeria?"

dkatz23238 avatar Jul 03 '19 01:07 dkatz23238

Please let me know if I should suggest a "capital city" module separately.

dkatz23238 avatar Jul 03 '19 01:07 dkatz23238

Hello @dkatz23238,

Thanks for reporting. Yes I'm aware of that, this is not really a bug but an improvement we could provide.

In the meantime, let's keep this issue opened and see how we can solve it in the future :smiley:

Edit: and yes feel free to create a module about capital cities.

louistiti avatar Jul 03 '19 05:07 louistiti

Great. How do you think this one should be done? I was thinking of just hardcoding a large dictionary with key values pairs for countries, however this can become difficult to add new features. I can also look into using an API such as the world bank or even wikipedia. What would you suggest?

dkatz23238 avatar Jul 04 '19 21:07 dkatz23238

My preference would be to go with a hardcoded large dictionary to make it work offline and with low-latency behavior. In most of the cases it is better using a remote server to request an API or whatever, but here the capital cities don't change that often I suppose? Maybe there is a bit of researches to cover to ensure about the general update frequency of capital cities in the world.

What do you think?

louistiti avatar Jul 05 '19 04:07 louistiti

Agreed, I will look into this frequency and I do agree with the offline option. It would be nice in a future to have leon be able answer a whole host of demographics, geographic, social, and cultural aspects about all countries around the world (Population size, favorite food, ect). Many of these indicators are usually in a similar format in Wikipedia and for these high level metrics I do not think Wikipedia is a bad source. In a future maybe we can create custom parses for Wikipedia to gain these high level metrics, another option is to do world bank or IMF data. These are definitely things I would like to investigate but for now I'll stick to capital cities and probably going to go with the hard coded dictionary. Leaving this long comment as for future reference.

Ill mock up an initial idea for an online mode where the capital city (and potentially other data) can be parsed from Wikipeida as well as the hard coded version for you/community to later decide. There is the official ISO 3166-1 page that we could use as well.

From some initial research it seem only 11 countries have changed their capital cities officially (funny enough including Nigeria).

dkatz23238 avatar Jul 05 '19 14:07 dkatz23238

@dkatz23238 are you working on this? if you are busy, I may give it a try

GaboFDC avatar Oct 03 '19 22:10 GaboFDC

@GaboFDC Please do! I have not been able to advance on this project. Thanks!

dkatz23238 avatar Oct 03 '19 22:10 dkatz23238