Closed ANF-Studios closed 4 years ago
I'm gonna guess this will get shot down as a feature for bogus, but if you can find a source online for the questions/topics, you could write your own using bogus.
Bogus.Net relies on datasets that generally come from faker.js.
Edit: Possible dataset https://ai.google.com/research/NaturalQuestions
Hi @ANF-Studios,
Thank you for your feature request. Currently, I don't have any plans to support questions and answers in the main Bogus.dll
. Primarily, because, as @digitalcoyote, mentioned,
Bogus.dll
is usually reserved for faker.js data (with some exceptions) andBogus.dll
library is 2MB which is already large.If this were to get implemented with official support, this type of question/answer data would be included in Bogus.Text
as a premium feature. https://github.com/bchavez/Bogus/#bogus-premium-extensions
Alternatively, also as Curtis mentioned, you could extend Bogus with some C# extension methods that generate Q and A with your own data. Below is some sample code that shows how:
void Main()
{
var f = new Faker();
var q = f.Random.Question();
q.Dump();
}
public static class ExtensionsForRandomizer
{
public static string[] Questions = new string[]{
"how cold is it today?",
"are we alone?",
"what is the meaning of life?"
};
public static string Question(this Randomizer r)
{
return r.ArrayElement(Questions);
}
}
what is the meaning of life?
Please describe why you are requesting a feature
Bogus has some really cool stuff especially with random, so it'd be cool to have a random topic/question.
Please provide a code example of what you are trying to achieve
var Faker = new Faker(); Console.WriteLine(faker.Random.Question)
Or something like that.Please answer any or all of the questions below
Is the feature something that currently cannot be done? No, it can be done.
What alternatives have you considered? None yet, haven't found any
Is this feature request any issues or current problems? Nope
Has the feature been requested in the past? Probably not
If the feature request is approved, would you be willing to submit a PR?
No