Skip to content

Commit

Permalink
add hungarian names
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal committed Nov 17, 2023
1 parent ceb3771 commit 27fcc90
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ enum class Country
Norway,
Japan,
Portugal,
Hungary,
};

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::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};

inline std::string toString(Country country)
{
Expand All @@ -48,7 +49,7 @@ inline std::string toString(Country country)
{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::Portugal, "Portugal"}, {Country::Hungary, "Hungary"},
};

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 @@ -14,6 +14,7 @@
#include "data/Gender.h"
#include "data/germany/GermanPeopleNames.h"
#include "data/Hobbies.h"
#include "data/hungary/HungarianPeopleNames.h"
#include "data/india/IndianPeopleNames.h"
#include "data/italy/ItalianPeopleNames.h"
#include "data/japan/JapanesePeopleNames.h"
Expand Down Expand Up @@ -54,6 +55,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
3 changes: 3 additions & 0 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "data/Gender.h"
#include "data/germany/GermanPeopleNames.h"
#include "data/Hobbies.h"
#include "data/hungary/HungarianPeopleNames.h"
#include "data/india/IndianPeopleNames.h"
#include "data/italy/ItalianPeopleNames.h"
#include "data/japan/JapanesePeopleNames.h"
Expand Down Expand Up @@ -54,6 +55,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames},
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -68,6 +70,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Sweden, "shouldGenerateSwedishName"}, {Country::Usa, "shouldGenerateAmericanName"},
{Country::Brazil, "shouldGenerateBrazilianName"}, {Country::Norway, "shouldGenerateNorwegianName"},
{Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"},
{Country::Hungary, "shouldGenerateHungarianName"},
};
}

Expand Down
33 changes: 33 additions & 0 deletions src/modules/person/data/hungary/HungarianFirstNames.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> hungarianMalesFirstNames = {
"Bence", "Máté", "Dominik", "Levente", "Noel", "Dániel", "Zalán", "Marcell", "Olivér",
"Ádám", "Milán", "Dávid", "Botond", "Benett", "Áron", "Zsombor", "Balázs", "Márk",
"Péter", "Kristóf", "Zétény", "Nimród", "László", "Benedek", "Tamás", "Gergő", "Patrik",
"Zente", "Bálint", "András", "Zoltán", "Attila", "Barnabás", "Márton", "Hunor", "Kornél",
"Martin", "Ákos", "Gábor", "Alex", "István", "Vince", "Ábel", "Krisztián", "Zsolt",
"János", "Nolen", "Erik", "Bendegúz", "Sándor", "József", "Nándor", "Richárd", "Benjámin",
"Soma", "Ármin", "Csaba", "Kevin", "Róbert", "Ferenc", "Mátyás", "Norbert", "Roland",
"Vencel", "Viktor", "Csongor", "Szabolcs", "Mihály", "Boldizsár", "Benjamin", "Simon", "Gergely",
"Bertalan", "Tibor", "Zénó", "Adrián", "Miklós", "Nikolasz", "Vilmos", "Kende", "Imre",
"Gellért", "Krisztofer", "Donát", "Vendel", "Bende", "Brájen", "Dorián", "Denisz", "Sámuel",
"Noé", "Csanád", "Lajos", "Kolos", "Alexander", "Laurent", "Mirkó", "György", "Nátán",
"Iván"};

const std::vector<std::string> hungarianFemalesFirstNames = {
"Hanna", "Anna", "Zoé", "Léna", "Luca", "Emma", "Zsófia", "Boglárka", "Lili", "Mira",
"Lilien", "Nóra", "Laura", "Lara", "Maja", "Fanni", "Jázmin", "Izabella", "Olívia", "Sára",
"Gréta", "Alíz", "Adél", "Lilla", "Liza", "Flóra", "Dorka", "Zselyke", "Dóra", "Csenge",
"Janka", "Liliána", "Viktória", "Szofia", "Réka", "Panna", "Petra", "Dorina", "Natasa", "Blanka",
"Eszter", "Noémi", "Emília", "Bianka", "Kamilla", "Szófia", "Vivien", "Rebeka", "Elizabet", "Linett",
"Szofi", "Júlia", "Szonja", "Abigél", "Mia", "Bella", "Lia", "Natália", "Tamara", "Lotti",
"Róza", "Amira", "Eliza", "Panka", "Milla", "Zorka", "Hanga", "Nara", "Norina", "Fruzsina",
"Mirella", "Dorottya", "Boróka", "Emili", "Regina", "Johanna", "Alexandra", "Diána", "Elena", "Kinga",
"Hédi", "Borbála", "Emese", "Bíborka", "Barbara", "Letícia", "Lujza", "Zita", "Kincső", "Nina",
"Vanda", "Veronika", "Zara", "Lana", "Lora", "Kiara", "Lívia", "Rozina", "Zejnep", "Virág"};
}
19 changes: 19 additions & 0 deletions src/modules/person/data/hungary/HungarianLastNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> hungarianLastNames = {
"Nagy", "Kovács", "Tóth", "Szabó", "Horváth", "Varga", "Kiss", "Molnár", "Németh", "Farkas",
"Balogh", "Papp", "Takács", "Juhász", "Lakatos", "Mészáros", "Oláh", "Simon", "Rácz", "Fekete",
"Szilágyi", "Török", "Fehér", "Balázs", "Gál", "Kis", "Szűcs", "Kocsis", "Orsós", "Pintér",
"Fodor", "Szalai", "Sipos", "Magyar", "Lukács", "Gulyás", "Biró", "Király", "László", "Katona",
"Jakab", "Bogdán", "Balog", "Sándor", "Boros", "Fazekas", "Kelemen", "Váradi", "Antal", "Somogyi",
"Orosz", "Fülöp", "Veres", "Vincze", "Hegedűs", "Budai", "Deák", "Pap", "Bálint", "Pál",
"Illés", "Vass", "Szőke", "Vörös", "Bognár", "Fábián", "Lengyel", "Bodnár", "Szücs", "Hajdu",
"Halász", "Jónás", "Máté", "Székely", "Kozma", "Gáspár", "Pásztor", "Bakos", "Dudás", "Major",
"Orbán", "Hegedüs", "Virág", "Barna", "Novák", "Soós", "Tamás", "Nemes", "Pataki", "Balla",
"Faragó", "Kerekes", "Borbély", "Barta", "Péter", "Szekeres", "Csonka", "Mezei", "Márton", "Sárközi"};
}
17 changes: 17 additions & 0 deletions src/modules/person/data/hungary/HungarianPeopleNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "../NameFormats.h"
#include "../PeopleNames.h"
#include "HungarianFirstNames.h"
#include "HungarianLastNames.h"
#include "HungarianPrefixes.h"

namespace faker
{
const NameFormats hungarianPersonNameFormats{{{"{prefix} {firstName} {lastName}", 1}, {"{firstName} {lastName}", 9}}};

const PeopleNames hungarianPeopleNames{{hungarianMalesFirstNames, {}, hungarianLastNames, hungarianPrefixes, {}},
{hungarianFemalesFirstNames, {}, hungarianLastNames, hungarianPrefixes, {}},
hungarianPersonNameFormats};

}
9 changes: 9 additions & 0 deletions src/modules/person/data/hungary/HungarianPrefixes.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> hungarianPrefixes{"Dr.", "Prof."};
}

0 comments on commit 27fcc90

Please sign in to comment.