Skip to content

Commit

Permalink
add belgian names (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Nov 19, 2023
1 parent a5d2012 commit c9f1cba
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ enum class Country
Slovenia,
Austria,
Switzerland,
Belgium,
};

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::Greece, Country::Slovenia, Country::Austria, Country::Switzerland, Country::Belgium,
};

inline std::string toString(Country country)
Expand All @@ -63,6 +64,7 @@ inline std::string toString(Country country)
{Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"},
{Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"},
{Country::Austria, "Austria"}, {Country::Switzerland, "Switzerland"},
{Country::Belgium, "Belgium"},
};

return countryToStringMapping.at(country);
Expand Down
2 changes: 2 additions & 0 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/austria/AustrianPeopleNames.h"
#include "data/belgium/BelgianPeopleNames.h"
#include "data/brazil/BrazilianPeopleNames.h"
#include "data/croatia/CroatianPeopleNames.h"
#include "data/czech/CzechPeopleNames.h"
Expand Down Expand Up @@ -63,6 +64,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
4 changes: 4 additions & 0 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/austria/AustrianPeopleNames.h"
#include "data/belgium/BelgianPeopleNames.h"
#include "data/croatia/CroatianPeopleNames.h"
#include "data/czech/CzechPeopleNames.h"
#include "data/denmark/DanishPeopleNames.h"
Expand Down Expand Up @@ -63,6 +64,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -80,6 +82,8 @@ const std::map<Country, std::string> generatedTestName{
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
{Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"},
{Country::Austria, "shouldGenerateAustrianName"}, {Country::Switzerland, "shouldGenerateSwissName"},
{Country::Belgium, "shouldGenerateBelgianName"},

};
}

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

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> belgianMalesFirstNames = {
"Lucas", "Liam", "Louis", "Noah", "Lars", "Arthur", "Mathis", "Kobe", "Wout", "Milan",
"Alexander", "Daan", "Adam", "Vince", "Jules", "Victor", "Finn", "Stan", "Leon", "Seppe",
"Senne", "Thomas", "Mats", "Robbe", "Matteo", "Ferre", "Nathan", "Warre", "Jasper", "Vic",
"Elias", "Tuur", "Lowie", "Mauro", "Maxim", "Ruben", "Rune", "Mohamed", "Simon", "Rayan",
"Lukas", "Lander", "Xander", "Emiel", "Siebe", "Jonas", "Sam", "Luca", "Arne", "Cas",
"Felix", "Jack", "Mathias", "Jayden", "Quinten", "Tibo", "Lewis", "Sem", "Maxime", "Viktor",
"Emile", "Sander", "Aaron", "Oscar", "Bas", "Niels", "Jef", "Nand", "Lou", "Tristan",
"Gust", "David", "Brent", "Jelle", "Lenn", "Miel", "Wannes", "Gilles", "Jarne", "Alex",
"Imran", "Lennert", "Milo", "Jens", "Matthias", "Dries", "Axel", "Juul", "Hamza", "Ilias",
"Thibo", "Nicolas", "Bent", "Jesse", "Bram", "Maurice", "Ilyas", "Gabriel", "Robin", "Kasper",
};

const std::vector<std::string> belgianFemalesFirstNames = {
"Emma", "Louise", "Marie", "Elise", "Noor", "Ella", "Julie", "Lotte", "Lore", "Fien",
"Lena", "Mila", "Olivia", "Amber", "Anna", "Elena", "Hanne", "Laura", "Charlotte", "Lina",
"Nina", "Fleur", "Lisa", "Nora", "Juliette", "Luna", "Amelie", "Kato", "Sara", "Febe",
"Axelle", "Janne", "Eline", "Helena", "Noa", "Camille", "Roos", "Lily", "Jade", "Nore",
"Jana", "Manon", "Sarah", "Liv", "Amélie", "Lara", "Mona", "Alice", "Tess", "Kaat",
"Femke", "Aya", "Eva", "Lien", "Bo", "Zoe", "Oona", "Sofia", "Leonie", "Linde",
"Jolien", "Fran", "Pauline", "Laure", "Merel", "Marthe", "Yana", "Renée", "Paulien", "Margot",
"Yasmine", "Ines", "Elisa", "Emily", "Maya", "Floor", "Amy", "Lize", "Amina", "Lucie",
"Julia", "Lise", "Hailey", "Hannah", "Alicia", "Norah", "Margaux", "Lieze", "Sien", "Zoë",
"Inaya", "Aline", "Amira", "Victoria", "Flore", "Lana", "Sterre", "Maud", "Chloe",
};
}
14 changes: 14 additions & 0 deletions src/modules/person/data/belgium/BelgianLastNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> belgianLastNames = {
"Claes", "Claeys", "Declerck", "Declercq", "Decock", "Decoster", "Desmet", "Devos",
"Dewilde", "Gielen", "Goossens", "Hermans", "Jacobs", "Janssen", "Janssens", "Lemmens",
"Maes", "Martens", "Mertens", "Michiels", "Peeters", "Smet", "Smets", "Thijs",
"Vandamme", "Vandenberghe", "Vandenbroeck", "Vandevelde", "Verhaeghe", "Verstraete", "Willems", "Wouters",
};
}
21 changes: 21 additions & 0 deletions src/modules/person/data/belgium/BelgianPeopleNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include "../NameFormats.h"
#include "../PeopleNames.h"
#include "BelgianFirstNames.h"
#include "BelgianLastNames.h"
#include "BelgianPrefixes.h"
#include "BelgianSuffixes.h"

namespace faker
{
const NameFormats belgianPersonNameFormats{{
{"{firstName} {lastName}", 8},
{"{prefix} {firstName} {lastName}", 1},
{"{firstName} {lastName} {suffix}", 1},
}};

const PeopleNames belgianPeopleNames{{belgianMalesFirstNames, {}, belgianLastNames, belgianPrefixes, belgianSuffixes},
{belgianFemalesFirstNames, {}, belgianLastNames, belgianPrefixes, belgianSuffixes},
belgianPersonNameFormats};
}
9 changes: 9 additions & 0 deletions src/modules/person/data/belgium/BelgianPrefixes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> belgianPrefixes{"Dr.", "Ir.", "Ing.", "Prof."};
}
9 changes: 9 additions & 0 deletions src/modules/person/data/belgium/BelgianSuffixes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> belgianSuffixes{"MBA", "Phd."};
}

0 comments on commit c9f1cba

Please sign in to comment.