Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add australian people names #293

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 44 additions & 23 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,59 @@ enum class Country
Canada,
Mexico,
Argentina,
Australia,
};

const std::vector<Country> countries{
Country::Usa, Country::England, Country::Poland, Country::Italy, Country::France, Country::Germany,
Country::Russia, Country::Romania, Country::India, Country::Finland, Country::Nepal, Country::Spain,
Country::Turkey, Country::Czech, Country::Slovakia, Country::Ukraine, Country::Denmark, Country::Sweden,
Country::Brazil, Country::Norway, Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia,
Country::Greece, Country::Slovenia, Country::Austria, Country::Switzerland, Country::Belgium, Country::Nederlands,
Country::China, Country::Korea, Country::Canada, Country::Mexico, Country::Argentina,
Country::Usa, Country::England, Country::Poland, Country::Italy, Country::France,
Country::Germany, Country::Russia, Country::Romania, Country::India, Country::Finland,
Country::Nepal, Country::Spain, Country::Turkey, Country::Czech, Country::Slovakia,
Country::Ukraine, Country::Denmark, Country::Sweden, Country::Brazil, Country::Norway,
Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia, Country::Greece,
Country::Slovenia, Country::Austria, Country::Switzerland, Country::Belgium, Country::Nederlands,
Country::China, Country::Korea, Country::Canada, Country::Mexico, Country::Argentina,
Country::Australia,
};

inline std::string toString(Country country)
{
std::map<Country, std::string> countryToStringMapping{
{Country::Usa, "Usa"}, {Country::England, "England"},
{Country::Poland, "Poland"}, {Country::Italy, "Italy"},
{Country::France, "France"}, {Country::Germany, "Germany"},
{Country::Russia, "Russia"}, {Country::Romania, "Romania"},
{Country::India, "India"}, {Country::Finland, "Finland"},
{Country::Nepal, "Nepal"}, {Country::Spain, "Spain"},
{Country::Turkey, "Turkey"}, {Country::Czech, "Czech"},
{Country::Slovakia, "Slovakia"}, {Country::Ukraine, "Ukraine"},
{Country::Denmark, "Denmark"}, {Country::Sweden, "Sweden"},
{Country::Brazil, "Brazil"}, {Country::Norway, "Norway"},
{Country::Japan, "Japan"}, {Country::Portugal, "Portugal"},
{Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"},
{Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"},
{Country::Austria, "Austria"}, {Country::Switzerland, "Switzerland"},
{Country::Belgium, "Belgium"}, {Country::Nederlands, "Nederlands"},
{Country::China, "China"}, {Country::Korea, "Korea"},
{Country::Canada, "Canada"}, {Country::Mexico, "Mexico"},
{Country::Usa, "Usa"},
{Country::England, "England"},
{Country::Poland, "Poland"},
{Country::Italy, "Italy"},
{Country::France, "France"},
{Country::Germany, "Germany"},
{Country::Russia, "Russia"},
{Country::Romania, "Romania"},
{Country::India, "India"},
{Country::Finland, "Finland"},
{Country::Nepal, "Nepal"},
{Country::Spain, "Spain"},
{Country::Turkey, "Turkey"},
{Country::Czech, "Czech"},
{Country::Slovakia, "Slovakia"},
{Country::Ukraine, "Ukraine"},
{Country::Denmark, "Denmark"},
{Country::Sweden, "Sweden"},
{Country::Brazil, "Brazil"},
{Country::Norway, "Norway"},
{Country::Japan, "Japan"},
{Country::Portugal, "Portugal"},
{Country::Hungary, "Hungary"},
{Country::Croatia, "Croatia"},
{Country::Greece, "Greece"},
{Country::Slovenia, "Slovenia"},
{Country::Austria, "Austria"},
{Country::Switzerland, "Switzerland"},
{Country::Belgium, "Belgium"},
{Country::Nederlands, "Nederlands"},
{Country::China, "China"},
{Country::Korea, "Korea"},
{Country::Canada, "Canada"},
{Country::Mexico, "Mexico"},
{Country::Argentina, "Argentina"},
{Country::Australia, "Australia"},
};

return countryToStringMapping.at(country);
Expand Down
37 changes: 19 additions & 18 deletions src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "../../common/FormatHelper.h"
#include "data/argentina/ArgentinianPeopleNames.h"
#include "data/australia/AustralianPeopleNames.h"
#include "data/austria/AustrianPeopleNames.h"
#include "data/belgium/BelgianPeopleNames.h"
#include "data/brazil/BrazilianPeopleNames.h"
Expand Down Expand Up @@ -56,24 +57,24 @@ namespace
const std::vector<std::string> sexes{"Male", "Female"};

const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::England, englishPeopleNames}, {Country::France, frenchPeopleNames},
{Country::Germany, germanPeopleNames}, {Country::Italy, italianPeopleNames},
{Country::Poland, polishPeopleNames}, {Country::Russia, russianPeopleNames},
{Country::Romania, romanianPeopleNames}, {Country::India, indianPeopleNames},
{Country::Finland, finnishPeopleNames}, {Country::Nepal, nepalesePeopleNames},
{Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames},
{Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames},
{Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames},
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
{Country::Canada, canadianPeopleNames}, {Country::Mexico, mexicanPeopleNames},
{Country::Argentina, argentinianPeopleNames},
{Country::England, englishPeopleNames}, {Country::France, frenchPeopleNames},
{Country::Germany, germanPeopleNames}, {Country::Italy, italianPeopleNames},
{Country::Poland, polishPeopleNames}, {Country::Russia, russianPeopleNames},
{Country::Romania, romanianPeopleNames}, {Country::India, indianPeopleNames},
{Country::Finland, finnishPeopleNames}, {Country::Nepal, nepalesePeopleNames},
{Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames},
{Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames},
{Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames},
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
{Country::Canada, canadianPeopleNames}, {Country::Mexico, mexicanPeopleNames},
{Country::Argentina, argentinianPeopleNames}, {Country::Australia, australianPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
73 changes: 37 additions & 36 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "../../common/StringHelper.h"
#include "data/argentina/ArgentinianPeopleNames.h"
#include "data/australia/AustralianPeopleNames.h"
#include "data/austria/AustrianPeopleNames.h"
#include "data/belgium/BelgianPeopleNames.h"
#include "data/canada/CanadianPeopleNames.h"
Expand Down Expand Up @@ -56,45 +57,45 @@ namespace
const std::vector<std::string> sexes{"Male", "Female"};

const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::England, englishPeopleNames}, {Country::France, frenchPeopleNames},
{Country::Germany, germanPeopleNames}, {Country::Italy, italianPeopleNames},
{Country::Poland, polishPeopleNames}, {Country::Russia, russianPeopleNames},
{Country::Romania, romanianPeopleNames}, {Country::India, indianPeopleNames},
{Country::Finland, finnishPeopleNames}, {Country::Nepal, nepalesePeopleNames},
{Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames},
{Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames},
{Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames},
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
{Country::Canada, canadianPeopleNames}, {Country::Mexico, mexicanPeopleNames},
{Country::Argentina, argentinianPeopleNames},
{Country::England, englishPeopleNames}, {Country::France, frenchPeopleNames},
{Country::Germany, germanPeopleNames}, {Country::Italy, italianPeopleNames},
{Country::Poland, polishPeopleNames}, {Country::Russia, russianPeopleNames},
{Country::Romania, romanianPeopleNames}, {Country::India, indianPeopleNames},
{Country::Finland, finnishPeopleNames}, {Country::Nepal, nepalesePeopleNames},
{Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames},
{Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames},
{Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames},
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
{Country::Canada, canadianPeopleNames}, {Country::Mexico, mexicanPeopleNames},
{Country::Argentina, argentinianPeopleNames}, {Country::Australia, australianPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
{Country::England, "shouldGenerateEnglishName"}, {Country::France, "shouldGenerateFrenchName"},
{Country::Germany, "shouldGenerateGermanName"}, {Country::Italy, "shouldGenerateItalianName"},
{Country::Poland, "shouldGeneratePolishName"}, {Country::Russia, "shouldGenerateRussianName"},
{Country::Romania, "shouldGenerateRomanianName"}, {Country::India, "shouldGenerateIndianName"},
{Country::Finland, "shouldGenerateFinnishName"}, {Country::Nepal, "shouldGenerateNepaleseName"},
{Country::Spain, "shouldGenerateSpanishName"}, {Country::Turkey, "shouldGenerateTurkishName"},
{Country::Czech, "shouldGenerateCzechName"}, {Country::Slovakia, "shouldGenerateSlovakName"},
{Country::Ukraine, "shouldGenerateUkrainianName"}, {Country::Denmark, "shouldGenerateDanishName"},
{Country::Sweden, "shouldGenerateSwedishName"}, {Country::Usa, "shouldGenerateAmericanName"},
{Country::Brazil, "shouldGenerateBrazilianName"}, {Country::Norway, "shouldGenerateNorwegianName"},
{Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"},
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
{Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"},
{Country::Austria, "shouldGenerateAustrianName"}, {Country::Switzerland, "shouldGenerateSwissName"},
{Country::Belgium, "shouldGenerateBelgianName"}, {Country::Nederlands, "shouldGenerateDutchName"},
{Country::China, "shouldGenerateChineseName"}, {Country::Korea, "shouldGenerateKoreanName"},
{Country::Canada, "shouldGenerateCanadianName"}, {Country::Mexico, "shouldGenerateMexicanName"},
{Country::Argentina, "shouldGenerateArgentinianName"},
{Country::England, "shouldGenerateEnglishName"}, {Country::France, "shouldGenerateFrenchName"},
{Country::Germany, "shouldGenerateGermanName"}, {Country::Italy, "shouldGenerateItalianName"},
{Country::Poland, "shouldGeneratePolishName"}, {Country::Russia, "shouldGenerateRussianName"},
{Country::Romania, "shouldGenerateRomanianName"}, {Country::India, "shouldGenerateIndianName"},
{Country::Finland, "shouldGenerateFinnishName"}, {Country::Nepal, "shouldGenerateNepaleseName"},
{Country::Spain, "shouldGenerateSpanishName"}, {Country::Turkey, "shouldGenerateTurkishName"},
{Country::Czech, "shouldGenerateCzechName"}, {Country::Slovakia, "shouldGenerateSlovakName"},
{Country::Ukraine, "shouldGenerateUkrainianName"}, {Country::Denmark, "shouldGenerateDanishName"},
{Country::Sweden, "shouldGenerateSwedishName"}, {Country::Usa, "shouldGenerateAmericanName"},
{Country::Brazil, "shouldGenerateBrazilianName"}, {Country::Norway, "shouldGenerateNorwegianName"},
{Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"},
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
{Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"},
{Country::Austria, "shouldGenerateAustrianName"}, {Country::Switzerland, "shouldGenerateSwissName"},
{Country::Belgium, "shouldGenerateBelgianName"}, {Country::Nederlands, "shouldGenerateDutchName"},
{Country::China, "shouldGenerateChineseName"}, {Country::Korea, "shouldGenerateKoreanName"},
{Country::Canada, "shouldGenerateCanadianName"}, {Country::Mexico, "shouldGenerateMexicanName"},
{Country::Argentina, "shouldGenerateArgentinianName"}, {Country::Australia, "shouldGenerateAustralianName"},
};
}

Expand Down
37 changes: 37 additions & 0 deletions src/modules/person/data/australia/AustralianFirstNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> australianMalesFirstNames = {
"William", "Jack", "Oliver", "Joshua", "Thomas", "Lachlan", "Cooper", "Noah", "Ethan",
"Lucas", "James", "Samuel", "Jacob", "Liam", "Alexander", "Benjamin", "Max", "Isaac",
"Daniel", "Riley", "Ryan", "Charlie", "Tyler", "Jake", "Matthew", "Xavier", "Harry",
"Jayden", "Nicholas", "Harrison", "Levi", "Luke", "Adam", "Henry", "Aiden", "Dylan",
"Oscar", "Michael", "Jackson", "Logan", "Joseph", "Blake", "Nathan", "Connor", "Elijah",
"Nate", "Archie", "Bailey", "Marcus", "Cameron", "Jordan", "Zachary", "Caleb", "Hunter",
"Ashton", "Toby", "Aidan", "Hayden", "Mason", "Hamish", "Edward", "Angus", "Eli",
"Sebastian", "Christian", "Patrick", "Andrew", "Anthony", "Luca", "Kai", "Beau", "Alex",
"George", "Callum", "Finn", "Zac", "Mitchell", "Jett", "Jesse", "Gabriel", "Leo",
"Declan", "Charles", "Jasper", "Jonathan", "Aaron", "Hugo", "David", "Christopher", "Chase",
"Owen", "Justin", "Ali", "Darcy", "Lincoln", "Cody", "Phoenix", "Sam", "John",
"Joel",
};

const std::vector<std::string> australianFemalesFirstNames = {
"Isabella", "Ruby", "Chloe", "Olivia", "Charlotte", "Mia", "Lily", "Emily", "Ella",
"Sienna", "Sophie", "Amelia", "Grace", "Ava", "Zoe", "Emma", "Sophia", "Matilda",
"Hannah", "Jessica", "Lucy", "Georgia", "Sarah", "Abigail", "Zara", "Eva", "Scarlett",
"Jasmine", "Chelsea", "Lilly", "Ivy", "Isla", "Evie", "Isabelle", "Maddison", "Layla",
"Summer", "Annabelle", "Alexis", "Elizabeth", "Bella", "Holly", "Lara", "Madison", "Alyssa",
"Maya", "Tahlia", "Claire", "Hayley", "Imogen", "Jade", "Ellie", "Sofia", "Addison",
"Molly", "Phoebe", "Alice", "Savannah", "Gabriella", "Kayla", "Mikayla", "Abbey", "Eliza",
"Willow", "Alexandra", "Poppy", "Samantha", "Stella", "Amy", "Amelie", "Anna", "Piper",
"Gemma", "Isabel", "Victoria", "Stephanie", "Caitlin", "Heidi", "Paige", "Rose", "Amber",
"Audrey", "Claudia", "Taylor", "Madeline", "Angelina", "Natalie", "Charli", "Lauren", "Ashley",
"Violet", "Mackenzie", "Abby", "Skye", "Lillian", "Alana", "Lola", "Leah", "Eve",
"Kiara",
};
}
Loading