mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 17:28:43 +00:00
384 lines
10 KiB
C#
384 lines
10 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace PodNoms.Api.Utils {
|
|
|
|
public static class Randomisers {
|
|
static Random _randomiser = new Random();
|
|
public static string RandomName() {
|
|
var myTI = new System.Globalization.CultureInfo("en-IE").TextInfo;
|
|
|
|
string[] maleNames = new string[100] {
|
|
"Columbus",
|
|
"Chi",
|
|
"Vito",
|
|
"Nigel",
|
|
"Brant",
|
|
"Gaston",
|
|
"Orville",
|
|
"Tanner",
|
|
"Fabian",
|
|
"Elliott",
|
|
"Emmett",
|
|
"Aubrey",
|
|
"Francesco",
|
|
"Reyes",
|
|
"Wyatt",
|
|
"Brad",
|
|
"Kent",
|
|
"Jimmy",
|
|
"Dewayne",
|
|
"Greg",
|
|
"Octavio",
|
|
"Odell",
|
|
"Otis",
|
|
"Adolfo",
|
|
"Ariel",
|
|
"Dana",
|
|
"Scott",
|
|
"Jewell",
|
|
"Tod",
|
|
"Ahmad",
|
|
"Christian",
|
|
"Mitchel",
|
|
"Humberto",
|
|
"Fausto",
|
|
"Quinn",
|
|
"Walter",
|
|
"Bret",
|
|
"Bradly",
|
|
"Teodoro",
|
|
"Stephen",
|
|
"Hipolito",
|
|
"Myron",
|
|
"Frances",
|
|
"Stevie",
|
|
"Bo",
|
|
"Donn",
|
|
"Hank",
|
|
"Dwight",
|
|
"Burt",
|
|
"Wade",
|
|
"Lesley",
|
|
"Andrew",
|
|
"Mack",
|
|
"Rickey",
|
|
"Elmo",
|
|
"Bret",
|
|
"Hilton",
|
|
"Casey",
|
|
"Derick",
|
|
"Jamie",
|
|
"Pablo",
|
|
"Barry",
|
|
"Hollis",
|
|
"Manual",
|
|
"Hiram",
|
|
"Nicky",
|
|
"Darrel",
|
|
"Edwardo",
|
|
"Lon",
|
|
"Gonzalo",
|
|
"Elliot",
|
|
"Les",
|
|
"Jaime",
|
|
"Raul",
|
|
"Cesar",
|
|
"Winford",
|
|
"Robt",
|
|
"Arnulfo",
|
|
"Francisco",
|
|
"Jerrold",
|
|
"Leland",
|
|
"Hosea",
|
|
"Zachery",
|
|
"Dewayne",
|
|
"Roscoe",
|
|
"Mike",
|
|
"Rolf",
|
|
"Eliseo",
|
|
"Ramiro",
|
|
"Lowell",
|
|
"Bryan",
|
|
"Vaughn",
|
|
"Dylan",
|
|
"Moises",
|
|
"Michale",
|
|
"Andy",
|
|
"Stanley",
|
|
"Amos",
|
|
"Odis",
|
|
"Antwan",
|
|
};
|
|
string[] femaleNames = new string[100] {
|
|
"Juliane",
|
|
"Dreama",
|
|
"Teisha",
|
|
"Esmeralda",
|
|
"Takako",
|
|
"Jeraldine",
|
|
"Holly",
|
|
"Aurea",
|
|
"Nikole",
|
|
"Giuseppina",
|
|
"Samantha",
|
|
"Fe",
|
|
"Kit",
|
|
"Zella",
|
|
"Madaline",
|
|
"Nedra",
|
|
"Tamica",
|
|
"Shantell",
|
|
"Xenia",
|
|
"Alisha",
|
|
"Mathilda",
|
|
"Yuriko",
|
|
"Rosy",
|
|
"Christin",
|
|
"Lashawna",
|
|
"Wen",
|
|
"Temeka",
|
|
"Brynn",
|
|
"Vertie",
|
|
"Sharron",
|
|
"Jamila",
|
|
"Tatiana",
|
|
"Elenore",
|
|
"Augusta",
|
|
"Maira",
|
|
"Tijuana",
|
|
"Maragret",
|
|
"Alessandra",
|
|
"Eveline",
|
|
"Jama",
|
|
"Mellisa",
|
|
"Liberty",
|
|
"Cornelia",
|
|
"Ruth",
|
|
"Natalia",
|
|
"Selina",
|
|
"Tamiko",
|
|
"Eugena",
|
|
"Gaynelle",
|
|
"Renay",
|
|
"Ernestine",
|
|
"Devora",
|
|
"Flo",
|
|
"Jeana",
|
|
"Willena",
|
|
"Minda",
|
|
"Rochel",
|
|
"Candance",
|
|
"Reiko",
|
|
"Necole",
|
|
"Beatris",
|
|
"Marcia",
|
|
"Oralee",
|
|
"Nita",
|
|
"Kasie",
|
|
"Juliette",
|
|
"Alice",
|
|
"Shavon",
|
|
"Megan",
|
|
"Dodie",
|
|
"Cristina",
|
|
"Natasha",
|
|
"Ingrid",
|
|
"Christa",
|
|
"Kenisha",
|
|
"Aliza",
|
|
"Theodora",
|
|
"Sophie",
|
|
"Akilah",
|
|
"Gricelda",
|
|
"Marlena",
|
|
"Audrey",
|
|
"Mariko",
|
|
"Criselda",
|
|
"Mahalia",
|
|
"Ingeborg",
|
|
"Erna",
|
|
"Jerica",
|
|
"Sherly",
|
|
"Lisabeth",
|
|
"Liane",
|
|
"Daphine",
|
|
"Leticia",
|
|
"Ima",
|
|
"Ruthie",
|
|
"Shiela",
|
|
"Lizzie",
|
|
"Kari",
|
|
"Candra",
|
|
"Emogene"
|
|
};
|
|
string[] lastNames = new string[100] {
|
|
"Fernandez",
|
|
"Wilson",
|
|
"Calderon",
|
|
"Estes",
|
|
"Hunter",
|
|
"Burton",
|
|
"Singleton",
|
|
"Morales",
|
|
"Hunt",
|
|
"Byrd",
|
|
"Gates",
|
|
"Rowland",
|
|
"Davenport",
|
|
"Hayden",
|
|
"Mcclure",
|
|
"Kane",
|
|
"Cortez",
|
|
"Shannon",
|
|
"Leonard",
|
|
"Oneill",
|
|
"Lowery",
|
|
"Owen",
|
|
"Craig",
|
|
"Bentley",
|
|
"Braun",
|
|
"Pennington",
|
|
"Winters",
|
|
"Stanton",
|
|
"Strickland",
|
|
"Hurst",
|
|
"Solomon",
|
|
"Benton",
|
|
"Conner",
|
|
"Beasley",
|
|
"Foley",
|
|
"Robertson",
|
|
"Moss",
|
|
"Cooke",
|
|
"Buck",
|
|
"Barry",
|
|
"Mckenzie",
|
|
"Ibarra",
|
|
"Lozano",
|
|
"Goodman",
|
|
"Chandler",
|
|
"Castro",
|
|
"Hatfield",
|
|
"Shaw",
|
|
"Little",
|
|
"Riddle",
|
|
"Preston",
|
|
"Randolph",
|
|
"Ball",
|
|
"Maldonado",
|
|
"Shea",
|
|
"Salinas",
|
|
"Collins",
|
|
"Maxwell",
|
|
"Parker",
|
|
"Archer",
|
|
"Benitez",
|
|
"Orozco",
|
|
"Gordon",
|
|
"Swanson",
|
|
"Wood",
|
|
"Greer",
|
|
"Rocha",
|
|
"Ballard",
|
|
"Love",
|
|
"Mcbride",
|
|
"Dickson",
|
|
"Glass",
|
|
"Bonilla",
|
|
"Sharp",
|
|
"Vasquez",
|
|
"Calhoun",
|
|
"Fletcher",
|
|
"Mcknight",
|
|
"Kaiser",
|
|
"Daniels",
|
|
"Mccoy",
|
|
"Joseph",
|
|
"Mcgee",
|
|
"Torres",
|
|
"Haley",
|
|
"Marquez",
|
|
"Carrillo",
|
|
"Alvarado",
|
|
"Meyer",
|
|
"Nichols",
|
|
"Huffman",
|
|
"Mckee",
|
|
"Costa",
|
|
"Collier",
|
|
"Avila",
|
|
"Edwards",
|
|
"Vaughan",
|
|
"Best",
|
|
"Simon",
|
|
"Massey"
|
|
};
|
|
|
|
bool male = _randomiser.Next(2) < 2;
|
|
var firstName = male ? maleNames[_randomiser.Next(0, maleNames.Length - 1)] : femaleNames[_randomiser.Next(0, femaleNames.Length - 1)];
|
|
var secondName = lastNames[_randomiser.Next(0, lastNames.Length - 1)];
|
|
return $"{firstName} {secondName}";
|
|
}
|
|
|
|
internal static int RandomInteger(int lower = 1, int upper = 100) {
|
|
return _randomiser.Next(lower, upper);
|
|
}
|
|
|
|
internal static string RandomString(int length) {
|
|
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
return new string(Enumerable.Repeat(chars, length)
|
|
.Select(s => s[_randomiser.Next(s.Length)]).ToArray());
|
|
}
|
|
|
|
public static string LoremIpsum(int minWords, int maxWords,
|
|
int minSentences = 1, int maxSentences = 1,
|
|
int numParagraphs = 1) {
|
|
|
|
var words = new [] {
|
|
"lorem",
|
|
"ipsum",
|
|
"dolor",
|
|
"sit",
|
|
"amet",
|
|
"consectetuer",
|
|
"adipiscing",
|
|
"elit",
|
|
"sed",
|
|
"diam",
|
|
"nonummy",
|
|
"nibh",
|
|
"euismod",
|
|
"tincidunt",
|
|
"ut",
|
|
"laoreet",
|
|
"dolore",
|
|
"magna",
|
|
"aliquam",
|
|
"erat"
|
|
};
|
|
|
|
int numSentences = _randomiser.Next(maxSentences - minSentences) +
|
|
minSentences + 1;
|
|
int numWords = _randomiser.Next(maxWords - minWords) + minWords + 1;
|
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
|
for (int p = 0; p < numParagraphs; p++) {
|
|
result.Append("<p>");
|
|
for (int s = 0; s < numSentences; s++) {
|
|
for (int w = 0; w < numWords; w++) {
|
|
if (w > 0) { result.Append(" "); }
|
|
result.Append(words[_randomiser.Next(words.Length)]);
|
|
}
|
|
result.Append(". ");
|
|
}
|
|
result.Append("</p>");
|
|
}
|
|
|
|
return result.ToString();
|
|
}
|
|
}
|
|
|
|
} |