Skip to content

Commit

Permalink
Add croatian people names (#272)
Browse files Browse the repository at this point in the history
* add hungarian names

* add croatian names
  • Loading branch information
cieslarmichal authored Nov 17, 2023
1 parent ee5b6bf commit bdfe0c1
Show file tree
Hide file tree
Showing 8 changed files with 11,740 additions and 15 deletions.
5 changes: 3 additions & 2 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ enum class Country
Japan,
Portugal,
Hungary,
Croatia,
};

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::Brazil, Country::Norway, Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia};

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

return countryToStringMapping.at(country);
Expand Down
23 changes: 12 additions & 11 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/brazil/BrazilianPeopleNames.h"
#include "data/croatia/CroatianPeopleNames.h"
#include "data/czech/CzechPeopleNames.h"
#include "data/denmark/DanishPeopleNames.h"
#include "data/england/EnglishPeopleNames.h"
Expand Down Expand Up @@ -55,7 +56,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},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down Expand Up @@ -303,6 +304,16 @@ std::string Person::nationality()
return Helper::arrayElement<std::string>(nationalities);
}

std::string Person::westernZodiac()
{
return Helper::arrayElement<std::string>(westernZodiacs);
}

std::string Person::chineseZodiac()
{
return Helper::arrayElement<std::string>(chineseZodiacs);
}

namespace
{
std::string middleNameForCountry(Country country, std::optional<Sex> sex)
Expand Down Expand Up @@ -395,14 +406,4 @@ std::string suffixForCountry(Country country, std::optional<Sex> sex)
return Helper::arrayElement<std::string>(suffixes);
}
}

std::string Person::westernZodiac()
{
return Helper::arrayElement<std::string>(westernZodiacs);
}

std::string Person::chineseZodiac()
{
return Helper::arrayElement<std::string>(chineseZodiacs);
}
}
5 changes: 3 additions & 2 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "data/croatia/CroatianPeopleNames.h"
#include "data/czech/CzechPeopleNames.h"
#include "data/denmark/DanishPeopleNames.h"
#include "data/england/EnglishPeopleNames.h"
Expand Down Expand Up @@ -55,7 +56,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},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -70,7 +71,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"},
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
};
}

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

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> croatianMalesFirstNames = {
"Adi", "Ado", "Andel", "Andelin", "Andelko", "Andelo", "Andi", "Andras", "Andrej",
"Andrija", "Andro", "Anko", "Ante", "Antek", "Antonin", "Antonio", "Antun", "Bela",
"Belimir", "Berti", "Boris", "Borko", "Borna", "Božidar", "Branimir", "Bruno", "Časlav",
"Dado", "Damil", "Damir", "Danijel", "Dario", "Darko", "David", "Davor", "Davorin",
"Domagoj", "Donat", "Dražen", "Držimir", "Držislav", "Dubravko", "Duje", "Dujo", "Emil",
"Emilijan", "Erik", "Fabijan", "Filip", "Franjo", "Gaj", "Gašpar", "Goran", "Gordan",
"Gradimir", "Grga", "Grgo", "Grgur", "Gvozden", "Hrvoj", "Hrvoje", "Ico", "Igor",
"Ilija", "Ilko", "Ino", "Ivan", "Ive", "Ivek", "Ivica", "Ivo", "Jadran",
"Jadranko", "Jadro", "Jakov", "Jan", "Janko", "Jasen", "Jasenko", "Josip", "Joško",
"Joso", "Joža", "Jože", "Krešimir", "Kristijan", "Kruno", "Krunoslav", "Ladislav", "Ljudevit",
"Lucijan", "Luka", "Marin", "Marko", "Martin", "Matan", "Mate", "Matej", "Matija",
"Matko", "Mato", "Mihael", "Milan", "Mile", "Milivoj", "Miljenko", "Mimo", "Miran",
"Mirko", "Miro", "Mislav", "Mladen", "Nedjeljko", "Neven", "Nikola", "Nino", "Ozren",
"Pavel", "Pepo", "Pero", "Petar", "Pravdan", "Rino", "Robert", "Roberto", "Robi",
"Roko", "Sanjin", "Saša", "Slavek", "Slaven", "Slavko", "Srećko", "Stanko", "Štef",
"Stipan", "Stipe", "Stjepan", "Stribor", "Svebor", "Tihomir", "Toma", "Tome", "Tomislav",
"Tomo", "Tonči", "Tone", "Toni", "Tonko", "Trpimir", "Trpko", "Tvrtko", "Valentin",
"Vanja", "Vatroslav", "Vedran", "Velimir", "Vijeko", "Vjekoslav", "Vjenceslav", "Vladek", "Vladislav",
"Vlado", "Vlatko", "Zdenko", "Zdravko", "Željko", "Zoltan", "Zrinislav", "Zrinko", "Zvonimir"};

const std::vector<std::string> croatianFemalesFirstNames = {
"Ada", "Adina", "Adriana", "Adrijana", "Agata", "Alemka", "Alenka", "Alisa", "Alka",
"Alma", "Amalija", "Ana", "Ančica", "Anamarija", "Anastazija", "Anci", "Anči", "Ancica",
"Anda", "Anđela", "Anđelika", "Anđelina", "Andi", "Andrea", "Andreja", "Andrina", "Anesa",
"Aneta", "Ani", "Anica", "Anja", "Anka", "Antea", "Antonija", "Asija", "Asja",
"Bara", "Barbara", "Barica", "Beata", "Bela", "Biserka", "Borka", "Borna", "Božena",
"Božica", "Branimira", "Branka", "Brankica", "Brigita", "Dada", "Dagmar", "Dalibora", "Daliborka",
"Danica", "Danijela", "Danka", "Dara", "Darinka", "Dea", "Đina", "Dona", "Donka",
"Dora", "Dorana", "Dorica", "Draga", "Ela", "Eli", "Elka", "Evelin", "Ina",
"Inga", "Inge", "Inja", "Inka", "Ita", "Iva", "Ivančica", "Ivanka", "Ivica",
"Ivna", "Jagica", "Jana", "Janica", "Janka", "Jasna", "Jela", "Jelica", "Ješa",
"Kata", "Kate", "Katica", "Katija", "Katina", "Kika", "Lara", "Laura", "Lea",
"Lela", "Lena", "Leona", "Lola", "Maca", "Magda", "Maja", "Majda", "Manda",
"Mara", "Mare", "Marena", "Marica", "Marta", "Maša", "Mica", "Mika", "Mila",
"Milica", "Milka", "Mima", "Mina", "Mira", "Mirka", "Naja", "Nana", "Natalija",
"Nataša", "Natka", "Neda", "Nela", "Neli", "Nena", "Nera", "Nesa", "Neva",
"Nevenka", "Nina", "Nuša", "Paulina", "Pava", "Pave", "Pavica", "Rajna", "Rija",
"Rina", "Ružica", "Staša", "Tasa", "Teja", "Tija", "Tijana", "Tina", "Tončica",
"Tonija", "Tonka", "Vala", "Valera", "Vali", "Vela", "Velana", "Velina", "Vera",
"Verica", "Vinka", "Zlatica", "Zlatka", "Darija", "Darina", "Divna", "Donata", "Doroteja",
"Dragica", "Dubravka", "Dunja", "Đurda", "Edita", "Elena", "Ema", "Eva", "Gabrijela",
"Goranka", "Gordana", "Grozdana", "Helena", "Hrvojka", "Ira", "Irena", "Irma", "Ivana",
"Jadranka", "Jaga", "Jasmina", "Josipa", "Karmela", "Katarina", "Kristina", "Leda", "Leonida",
"Lidija", "Ljiljana", "Ljubica", "Lovorka", "Lucija", "Magdalena", "Marija", "Marijana", "Marina",
"Martina", "Miranda", "Mirna", "Monika", "Nada", "Nadalina", "Nedjeljka", "Nevena", "Nora",
"Paula", "Petra", "Renata", "Romana", "Rosana", "Ruža", "Sanja", "Silvija", "Slavica",
"Snježana", "Tereza", "Tomislava", "Valentina", "Valerija", "Vedrana", "Velimira", "Veronika", "Vesna",
"Vladimira", "Zdenka", "Zdeslava", "Zlata"};
}
Loading

0 comments on commit bdfe0c1

Please sign in to comment.