Skip to content

Commit

Permalink
add greek names (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Nov 18, 2023
1 parent 699eb15 commit cd5d203
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/faker-cxx/Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class Helper

const auto sumOfWeights =
std::accumulate(data.begin(), data.end(), 0u,
[](size_t sum, const WeightedElement<T>& element) { return sum + element.weight; });
[](unsigned sum, const WeightedElement<T>& element) { return sum + element.weight; });

if (sumOfWeights == 0)
if (sumOfWeights == 0u)
{
throw std::invalid_argument{"Sum of weights is zero."};
}
Expand Down
12 changes: 8 additions & 4 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ enum class Country
Portugal,
Hungary,
Croatia,
Greece,
};

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

inline std::string toString(Country country)
{
Expand All @@ -51,6 +54,7 @@ inline std::string toString(Country country)
{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"},
};

return countryToStringMapping.at(country);
Expand Down
1 change: 0 additions & 1 deletion src/modules/date/DateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ TEST_F(DateTest, shouldGeneratePastDate)

const auto pastDateISO = Date::pastDate();

std::cout << pastDateISO;
const auto pastDate = parseISOFormattedStringToTimePoint(pastDateISO);

EXPECT_TRUE(std::chrono::duration_cast<std::chrono::seconds>(currentDate - pastDate).count() < secondsInYear);
Expand Down
2 changes: 0 additions & 2 deletions src/modules/git/GitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ TEST_F(GitTest, shouldGenerateBranch)
{
const auto branch = Git::branch();
unsigned long branchSplit = faker::StringHelper::split(branch, "-").size();
std::cout << branch << " | " << branchSplit << std::endl;

ASSERT_TRUE(2 <= branchSplit && branchSplit <= 7);
}
Expand Down Expand Up @@ -86,7 +85,6 @@ TEST_F(GitTest, shouldGenerateCommitMessage)
{
const std::regex messageRegex("^" + GitTest::MESSAGE_REGEX + "$");
std::string temp = Git::commitMessage();
std::cout << temp << std::endl;
ASSERT_TRUE(std::regex_match(temp, messageRegex));
}

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/france/FrenchPeopleNames.h"
#include "data/Gender.h"
#include "data/germany/GermanPeopleNames.h"
#include "data/greece/GreekPeopleNames.h"
#include "data/Hobbies.h"
#include "data/hungary/HungarianPeopleNames.h"
#include "data/india/IndianPeopleNames.h"
Expand Down Expand Up @@ -57,6 +58,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames},
};

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/france/FrenchPeopleNames.h"
#include "data/Gender.h"
#include "data/germany/GermanPeopleNames.h"
#include "data/greece/GreekPeopleNames.h"
#include "data/Hobbies.h"
#include "data/hungary/HungarianPeopleNames.h"
#include "data/india/IndianPeopleNames.h"
Expand Down Expand Up @@ -57,6 +58,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -72,6 +74,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Brazil, "shouldGenerateBrazilianName"}, {Country::Norway, "shouldGenerateNorwegianName"},
{Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"},
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
{Country::Greece, "shouldGenerateGreekName"},
};
}

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

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> greekMalesFirstNames = {
"Georgios", "Dimitrios", "Ioannis", "Nikolaos", "Konstantin", "Christos", "Panagiotis", "Vasileios",
"Konstantinos", "Athanasios", "Michail", "Evangelos", "Antonios", "Emmanouil", "Theodoros", "Spyridon",
"Anastasios", "Ilias", "Charalampos", "Alexandros", "Stavros", "Apostolos", "Petros", "Stylianos",
"Sotirios", "Georg", "Thomas", "Ioan", "Eleftherios", "George", "Dimitris", "Nikos",
"Kostas", "Alex", "Markos", "Anton", "John", "Artemis", "Vasilis", "Iosif",
"Michael", "Ali", "Nick", "Chris", "Leon", "Yannis", "Adam", "David",
"Ilir", "Ivan", "Peter", "Alexander", "Vasil", "Luan", "Elias", "Viktor",
"Arben", "Theodore", "Nikolas", "Mohamed", "Dion", "Filip", "Anatoli", "Robert",
"Vladimir", "Napoleon", "Isaak", "Niko", "Nestor", "Georgi", "William", "Albert",
"Anastasio", "Constantin", "Paul", "Muhammad", "Nicholas", "Stefan", "Dritan", "Artur",
"Moustafa", "Haris", "Alexandro", "Ahmed", "Daniel", "Eduart", "Daniil", "Alfred",
"Gregory", "Myron", "Ion", "Edmond", "Kosta", "Aleksander", "Emmanuel", "Arjan",
"Martin", "Leonard", "Christof", "Dimitar", "Ismail", "Harry", "Andrew", "Nicolas",
"Dimitri", "Elton", "Adrian", "Angel", "Vasile", "Nikolay", "Roland", "Mohammad",
"Victor", "James", "Valentin", "Mario", "Florin", "Mark", "Petro", "Jim",
"Simon", "Andon", "Anthony", "Steven", "Sami", "Gheorghe", "Yordan", "Theo",
"Hristo", "Aleks", "Ervin", "Antonio", "Philip", "Emil", "Todor", "Gabriel",
"Asen", "Singh", "Aleksandar", "Marius", "Ibrahim", "Osman", "Igor", "Hans",
"Ionut", "Roman", "Alban", "Hasan", "Antony", "Petar", "Christian", "Mustafa",
"Angelo", "Richard", "Christopher", "Hussain", "Tom", "Jan", "Marin", "Florian",
"Stoyan", "Ahmad", "Aurel", "Sergey", "Atanas", "Andrei", "Maksim", "Joseph",
"Frank", "Renato", "Abdul", "Eduard", "Irfan", "Mihail", "Ismet", "Catalin",
"Jason", "Julian", "Giorgio", "Pavel", "Dumitru", "Ramadan", "Krasimir", "Iqbal",
"Tony", "Boris", "Naim", "Alexandru", "Arsen", "Teo", "Marko", "Stephen",
"Christophe", "Kevin", "Romeo", "Nicolae", "Miroslav", "Armand", "Mihai", "Georges",
"Cristian", "Oleg", "Patrick", "Michel", "Arif", "Mitko", "Amarildo", "Andrey",
"Armando", "Ananias", "Plamen", "Socrates", "Marco", "Filimon", "Adonis", "Enver",
"Edison", "Andi", "Imran", "Ian", "Fran", "Gianni", "Rumen", "Alan",
"Mikel", "Giorgi", "Anastas", "Armen", "Karl", "Stanislav", "Elvis", "Mahmoud",
"Roberto", "Theodor", "Solomon", "Mohammed", "Hassan", "Veselin", "Iliya", "Emin",
"Viorel", "Ilie", "Amir", "Simeon", "Greg", "Ionel", "Philippe", "Pal",
"Samir", "Bilal", "Zoran", "Irakli", "Klaus", "Isaia", "Zamir", "Ivaylo",
"Aleksandr", "Dragan", "Charles", "Louis", "Brian", "Sorin", "Apostol", "Kiril",
"Sam", "Eric", "Aleko", "Costel", "Bruno", "Valter", "Werner", "Tim",
"Basil", "Andre", "Tahir", "Vilson", "Adnan", "Fredi", "Ferdinand", "Vlad",
"Petru", "Paolo", "Marsel", "Giuseppe", "Ram", "Oleksandr", "Asif", "Artour",
"Abbas", "Raymond", "Nasir", "Bogdan", "Trifon", "Alberto", "Vasili", "Matthew",
"Edward", "Milan", "Sasa", "Iulian", "Goran", "Jimmy", "Roger", "Mohamad",
"Erik", "Volodymyr", "Alessandro", "Khalid", "Mehmet", "Michal", "Sinan", "Alin",
"Lucian", "Spiridon", "Sadik", "Francesco", "Stefano", "Dionis", "Omer", "Marc",
"Jonathan", "Omar", "Borislav", "Sasho", "Johannes", "Bernard", "Shaban", "Viktoras",
"Shahid", "Marcel", "Walter", "Felix", "Giovanni", "Paulin", "Kumar", "Pierre",
"Tariq", "Ramazan", "Ashraf", "Alain", "Nicky", "Mikhail", "Sampson", "Luigi",
"Lucas", "Frederik", "Petko", "Adel", "Alexey", "Faik",
};

const std::vector<std::string> greekFemalesFirstNames = {
"Maria", "Eleni", "Aikaterini", "Vasiliki", "Sofia", "Anastasia", "Georgia", "Evangelia",
"Anna", "Dimitra", "Ioanna", "Christina", "Andreas", "Alexandra", "Theodora", "Athina",
"Olga", "Evgenia", "Zoi", "Konstantina", "Marina", "Antonia", "Nikol", "Margarita",
"Varvara", "Leonidas", "Fani", "Amalia", "Nikoletta", "Katerina", "Stella", "Martha",
"Marianna", "Elena", "Olympia", "Ioulia", "Nikoleta", "Viktoria", "Aglaia", "Andriana",
"Pelagia", "Natalia", "Flora", "Virginia", "Marika", "Alexia", "Katina", "Stefania",
"Tatiana", "Valentina", "Violeta", "Andrea", "Iliana", "Mariana", "Angela", "Dorothea",
"Nina", "Violetta", "Vera", "Eleonora", "Lydia", "Mary", "Marilena", "Pavlina",
"Svetlana", "Louiza", "Aris", "Sali", "Marietta", "Irina", "Ilia", "Irene",
"Paris", "Daniela", "Kristina", "Melina", "Vicky", "Roza", "Mirela", "Sonia",
"Mariya", "Alexis", "Despina", "Helen", "Diana", "Sophia", "Ivanka", "Dora",
"Elina", "Christiana", "Elvira", "Eva", "Alma", "Mihaela", "Angelina", "Irena",
"Lina", "Elsa", "Lena", "Lida", "Michaela", "Mina", "Monika", "Lia",
"Rena", "Liana", "Barbara", "Isidora", "Marie", "Tamara", "Natasa", "Rita",
"Larisa", "Tina", "Joanna", "Sylvia", "Marian", "Christine", "Alina", "Rania",
"Xenia", "Natasha", "Miranda", "Cristina", "Fatme", "Liliana", "Galina", "Victoria",
"Olena", "Nikolina", "Adelina", "Elizabeth", "Nataliya", "Emine", "Silvana", "Magda",
"Gianna", "Jean", "Milena", "Irma", "Nana", "Tania", "Iryna", "Marinela",
"Eleana", "Tereza", "Sara", "Tanya", "Rozalia", "Eugenia", "Kali", "Kelly",
"Catherine", "Zoe", "Adriana", "Maia", "Polina", "Brunilda", "Svitlana", "Aneta",
"Eliza", "Yordanka", "Albana", "Laura", "Iordana", "Karolina", "Lou", "Gabriela",
"Tetyana", "Merita", "Katia", "Veronika", "Anne", "Esmeralda", "Iris", "Anita",
"Suzana", "Stanka", "Nadia", "Nikola", "Oksana", "Jenny", "Leonora", "Marieta",
"Julia", "Susan", "Pandora", "Ekaterina", "Karen", "Liza", "Alla", "Aleksandra",
"Sandra", "Petra", "Rafaela", "Penka", "Dorina", "Nancy", "Rositsa", "Lela",
"Nelli", "Silvia", "Vasilka", "Elisabeth", "Mariyana", "Hristina", "Donka", "Malvina",
"Radka", "Stela", "Mari", "Kassandra", "Patricia", "Mariam", "Dina", "Gina",
"Denis", "Linda", "Manana", "Magdalena", "Inna", "Emilia", "Renata", "Oxana",
"Tonia", "Leila", "Claudia", "Aida", "Mara", "Nicole", "Stefka", "Luiza",
"Thalia", "Yuliya", "Nino", "Neli", "Simona", "Matilda", "Antoneta", "Vanessa",
"Julie", "Marine", "Valia", "Sarah", "Lila", "Arian", "Minka", "Zamira",
"Gergana", "Penelope", "Nicoleta", "Dennis", "Vivian", "Nora", "Lali", "Evelina",
"Sophie", "Lili", "Katya", "Sarra", "Ioana", "Rumyana", "Silviya", "Isa",
"Martina", "Desislava", "Carol", "Ileana", "Zlatka", "Galya", "Athena", "Ina",
"Paola", "Teodora", "Nadezhda", "Zina", "Jane", "Florina", "Ilona", "Ionela",
"Lilia", "Karin", "Elisabeta", "Ann", "Iva", "Margaret", "Tamar", "Mzia",
"Pamela", "Liudmila", "Aurora", "Lidia", "Anka", "Emiliya", "Helena", "Klara",
"Angelika", "Khatuna", "Viorica", "Todorka", "Rodica", "Ivana", "Dimitrinka", "Albena",
"Maya", "Veneta", "Krasimira", "Mariyka", "Monica", "Jennifer", "Tatyana", "Daphne",
"Emma", "Melania", "Aneliya", "Katherine", "Carmen", "Anisa", "Constantina", "Asteria",
"Stoyanka", "Antoaneta", "Valeria", "Diamantina", "Karine", "Andreea", "Manuela", "Atanaska",
"Annie", "Ani", "Petrina", "Viktoriya", "Lilian", "Ornela", "Svetla", "Peggy",
"Flori", "Fay", "Erika", "Tatjana", "Kate", "Inga", "Karina", "Marta",
"Raisa", "Natalya", "Ramona", "Milka", "Larysa", "Rina",
};
}
Loading

0 comments on commit cd5d203

Please sign in to comment.