Ask HN: How to do this? Substituting a general word with a random particular?
For a pet project I need general words substituted with a random particular.
Example, if I write [country] [color], it could give out: Argentina Green or India Blue. Or anything random from the set of all terms having a country name followed by a color name.
I have looked into wikidata, but results haven't been satisfactory.
2 comments
[ 3.3 ms ] story [ 15.2 ms ] threadThe example is not clear enough. Can you give one example as
Input: xxx
Output: yyy
[I'm not sure if this is the best kind of submission for HN. We will probably not give a complete solution, but at least someone may point to the correct function in the docs of your language.]
So to repeat - don't use this code, but by all means, let us know the ways in which it fails to meet your requirement.