Skip to content

Commit

Permalink
add ukrainian people names (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Nov 14, 2023
1 parent ae0b935 commit 31c9686
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 24 deletions.
5 changes: 3 additions & 2 deletions include/faker-cxx/types/Language.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ enum class Language
Turkish,
Czech,
Slovak,
Ukrainian,
};

const std::vector<Language> languages{Language::English, Language::Polish, Language::Italian, Language::French,
Language::German, Language::Russian, Language::Romanian, Language::Hindi,
Language::Finnish, Language::Nepali, Language::Spanish, Language::Turkish,
Language::Czech, Language::Slovak};
Language::Czech, Language::Slovak, Language::Ukrainian};

inline std::string toString(Language language)
{
Expand All @@ -35,7 +36,7 @@ inline std::string toString(Language language)
{Language::French, "French"}, {Language::German, "German"}, {Language::Russian, "Russian"},
{Language::Romanian, "Romanian"}, {Language::Hindi, "Hindi"}, {Language::Finnish, "Finnish"},
{Language::Nepali, "Nepali"}, {Language::Spanish, "Spanish"}, {Language::Turkish, "Turkish"},
{Language::Czech, "Czech"}, {Language::Slovak, "Slovak"}};
{Language::Czech, "Czech"}, {Language::Slovak, "Slovak"}, {Language::Ukrainian, "Ukrainian"}};

return languageToStringMapping.at(language);
}
Expand Down
16 changes: 9 additions & 7 deletions src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "data/slovak/SlovakPeopleNames.h"
#include "data/spanish/SpanishPeopleNames.h"
#include "data/turkish/TurkishPeopleNames.h"
#include "data/ukrainian/UkrainianPeopleNames.h"
#include "data/ZodiacSigns.h"
#include "faker-cxx/Helper.h"
#include "fmt/format.h"
Expand All @@ -33,13 +34,14 @@ namespace
const std::vector<std::string> sexes{"Male", "Female"};

const std::map<Language, PeopleNames> languageToPeopleNamesMapping{
{Language::English, englishPeopleNames}, {Language::French, frenchPeopleNames},
{Language::German, germanPeopleNames}, {Language::Italian, italianPeopleNames},
{Language::Polish, polishPeopleNames}, {Language::Russian, russianPeopleNames},
{Language::Romanian, romanianPeopleNames}, {Language::Hindi, indianPeopleNames},
{Language::Finnish, finnishPeopleNames}, {Language::Nepali, nepalesePeopleNames},
{Language::Spanish, spanishPeopleNames}, {Language::Turkish, turkishPeopleNames},
{Language::Czech, czechPeopleNames}, {Language::Slovak, slovakPeopleNames}};
{Language::English, englishPeopleNames}, {Language::French, frenchPeopleNames},
{Language::German, germanPeopleNames}, {Language::Italian, italianPeopleNames},
{Language::Polish, polishPeopleNames}, {Language::Russian, russianPeopleNames},
{Language::Romanian, romanianPeopleNames}, {Language::Hindi, indianPeopleNames},
{Language::Finnish, finnishPeopleNames}, {Language::Nepali, nepalesePeopleNames},
{Language::Spanish, spanishPeopleNames}, {Language::Turkish, turkishPeopleNames},
{Language::Czech, czechPeopleNames}, {Language::Slovak, slovakPeopleNames},
{Language::Ukrainian, ukrainianPeopleNames}};

std::string middleNameForLanguage(Language language, std::optional<Sex> sex);
std::string prefixForLanguage(Language language, std::optional<Sex> sex);
Expand Down
32 changes: 17 additions & 15 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "data/slovak/SlovakPeopleNames.h"
#include "data/spanish/SpanishPeopleNames.h"
#include "data/turkish/TurkishPeopleNames.h"
#include "data/ukrainian/UkrainianPeopleNames.h"
#include "data/ZodiacSigns.h"
#include "src/modules/person/data/PeopleNames.h"

Expand All @@ -34,23 +35,24 @@ namespace
const std::vector<std::string> sexes{"Male", "Female"};

const std::map<Language, PeopleNames> languageToPeopleNamesMapping{
{Language::English, englishPeopleNames}, {Language::French, frenchPeopleNames},
{Language::German, germanPeopleNames}, {Language::Italian, italianPeopleNames},
{Language::Polish, polishPeopleNames}, {Language::Russian, russianPeopleNames},
{Language::Romanian, romanianPeopleNames}, {Language::Hindi, indianPeopleNames},
{Language::Finnish, finnishPeopleNames}, {Language::Nepali, nepalesePeopleNames},
{Language::Spanish, spanishPeopleNames}, {Language::Turkish, turkishPeopleNames},
{Language::Czech, czechPeopleNames}, {Language::Slovak, slovakPeopleNames}};
{Language::English, englishPeopleNames}, {Language::French, frenchPeopleNames},
{Language::German, germanPeopleNames}, {Language::Italian, italianPeopleNames},
{Language::Polish, polishPeopleNames}, {Language::Russian, russianPeopleNames},
{Language::Romanian, romanianPeopleNames}, {Language::Hindi, indianPeopleNames},
{Language::Finnish, finnishPeopleNames}, {Language::Nepali, nepalesePeopleNames},
{Language::Spanish, spanishPeopleNames}, {Language::Turkish, turkishPeopleNames},
{Language::Czech, czechPeopleNames}, {Language::Slovak, slovakPeopleNames},
{Language::Ukrainian, ukrainianPeopleNames}};

const std::map<Language, std::string> generatedTestName{
{Language::English, "shouldGenerateEnglishName"}, {Language::French, "shouldGenerateFrenchName"},
{Language::German, "shouldGenerateGermanName"}, {Language::Italian, "shouldGenerateItalianName"},
{Language::Polish, "shouldGeneratePolishName"}, {Language::Russian, "shouldGenerateRussianName"},
{Language::Romanian, "shouldGenerateRomanianName"}, {Language::Hindi, "shouldGenerateIndianName"},
{Language::Finnish, "shouldGenerateFinnishName"}, {Language::Nepali, "shouldGenerateNepaleseName"},
{Language::Spanish, "shouldGenerateSpanishName"}, {Language::Turkish, "shouldGenerateTurkishName"},
{Language::Czech, "shouldGenerateCzechName"}, {Language::Slovak, "shouldGenerateSlovakName"},
};
{Language::English, "shouldGenerateEnglishName"}, {Language::French, "shouldGenerateFrenchName"},
{Language::German, "shouldGenerateGermanName"}, {Language::Italian, "shouldGenerateItalianName"},
{Language::Polish, "shouldGeneratePolishName"}, {Language::Russian, "shouldGenerateRussianName"},
{Language::Romanian, "shouldGenerateRomanianName"}, {Language::Hindi, "shouldGenerateIndianName"},
{Language::Finnish, "shouldGenerateFinnishName"}, {Language::Nepali, "shouldGenerateNepaleseName"},
{Language::Spanish, "shouldGenerateSpanishName"}, {Language::Turkish, "shouldGenerateTurkishName"},
{Language::Czech, "shouldGenerateCzechName"}, {Language::Slovak, "shouldGenerateSlovakName"},
{Language::Ukrainian, "shouldGenerateUkrainianName"}};
}

class PersonTest : public TestWithParam<Language>
Expand Down
60 changes: 60 additions & 0 deletions src/modules/person/data/ukrainian/UkrainianFirstNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> ukrainianMalesFirstNames = {
"Августин", "Аврелій", "Адам", "Адріян", "Азарій", "Алевтин", "Альберт", "Анастас",
"Анастасій", "Анатолій", "Андрій", "Антін", "Антон", "Антоній", "Аркадій", "Арсен",
"Арсеній", "Артем", "Архип", "Аскольд", "Афанасій", "Біломир", "Білослав", "Богдан",
"Божемир", "Божен", "Болеслав", "Боримир", "Боримисл", "Борис", "Борислав", "Братимир",
"Братислав", "Братомил", "Братослав", "Брячислав", "Будимир", "Буйтур", "Буревіст", "В’ячеслав",
"Вадим", "Валентин", "Валерій", "Василь", "Велемир", "Віктор", "Віталій", "Влад",
"Владислав", "Володимир", "Володислав", "Всевлад", "Всеволод", "Всеслав", "Гаврило", "Гарнослав",
"Геннадій", "Георгій", "Герасим", "Гліб", "Гнат", "Гордій", "Горимир", "Горислав",
"Градимир", "Григорій", "Далемир", "Данило", "Дарій", "Даромир", "Денис", "Дмитро",
"Добромир", "Добромисл", "Доброслав", "Євген", "Єремій", "Захар", "Захарій", "Зборислав",
"Звенигор", "Звенимир", "Звенислав", "Земислав", "Зеновій", "Зиновій", "Злат", "Златомир",
"Зоремир", "Зореслав", "Зорян", "Іван", "Ігор", "Ізяслав", "Ілля", "Кий",
"Корнелій", "Корнилій", "Корнило", "Корній", "Костянтин", "Кузьма", "Лаврентій", "Лаврін",
"Лад", "Ладислав", "Ладо", "Ладомир", "Левко", "Листвич", "Лук’ян", "Любодар",
"Любозар", "Любомир", "Макар", "Максим", "Мар’ян", "Маркіян", "Марко", "Матвій",
"Мечислав", "Микита", "Микола", "Мирон", "Мирослав", "Михайло", "Мстислав", "Мусій",
"Назар", "Назарій", "Натан", "Немир", "Нестор", "Олег", "Олександр", "Олексій",
"Олелько", "Олесь", "Омелян", "Орест", "Орхип", "Остап", "Охрім", "Павло",
"Панас", "Пантелеймон", "Петро", "Пилип", "Подолян", "Потап", "Радим", "Радимир",
"Ратибор", "Ратимир", "Родіон", "Родослав", "Роксолан", "Роман", "Ростислав", "Руслан",
"Святополк", "Святослав", "Семибор", "Сергій", "Синьоок", "Славолюб", "Славомир", "Славута",
"Сніжан", "Сологуб", "Станіслав", "Степан", "Стефаній", "Стожар", "Тарас", "Тиміш",
"Тимофій", "Тихон", "Тур", "Устим", "Хвалимир", "Хорив", "Чорнота", "Щастислав",
"Щек", "Юліан", "Юрій", "Юхим", "Ян", "Ярема", "Яровид", "Яромил",
"Яромир", "Ярополк", "Ярослав"};

const std::vector<std::string> ukrainianFemalesFirstNames = {
"Аврелія", "Аврора", "Агапія", "Агата", "Агафія", "Агнеса", "Агнія", "Агрипина",
"Ада", "Аделаїда", "Аделіна", "Адріана", "Азалія", "Алевтина", "Аліна", "Алла",
"Альбіна", "Альвіна", "Анастасія", "Анатолія", "Ангеліна", "Анжела", "Анна", "Антонида",
"Антоніна", "Антонія", "Анфіса", "Аполлінарія", "Аполлонія", "Аркадія", "Артемія", "Афанасія",
"Білослава", "Біляна", "Благовіста", "Богдана", "Богуслава", "Божена", "Болеслава", "Борислава",
"Броніслава", "В’ячеслава", "Валентина", "Валерія", "Варвара", "Василина", "Вікторія", "Вілена",
"Віленіна", "Віліна", "Віола", "Віолетта", "Віра", "Віргінія", "Віта", "Віталіна",
"Влада", "Владислава", "Власта", "Всеслава", "Галина", "Ганна", "Гелена", "Далеслава",
"Дана", "Дарина", "Дарислава", "Діана", "Діяна", "Добринка", "Добромила", "Добромира",
"Добромисла", "Доброслава", "Долеслава", "Доляна", "Жанна", "Жозефіна", "Забава", "Звенислава",
"Зінаїда", "Злата", "Зореслава", "Зорина", "Зоряна", "Зоя", "Іванна", "Ілона",
"Інна", "Іннеса", "Ірина", "Ірма", "Калина", "Каріна", "Катерина", "Квітка",
"Квітослава", "Клавдія", "Крентта", "Ксенія", "Купава", "Лада", "Лариса", "Леся",
"Ликера", "Лідія", "Лілія", "Любава", "Любислава", "Любов", "Любомила", "Любомира",
"Люборада", "Любослава", "Людмила", "Людомила", "Майя", "Мальва", "Мар’яна", "Марина",
"Марічка", "Марія", "Марта", "Меланія", "Мечислава", "Милодара", "Милослава", "Мирослава",
"Мілана", "Мокрина", "Мотря", "Мстислава", "Надія", "Наталія", "Неля", "Немира",
"Ніна", "Огняна", "Оксана", "Олександра", "Олена", "Олеся", "Ольга", "Ореста",
"Орина", "Орислава", "Орися", "Оріяна", "Павліна", "Палажка", "Пелагея", "Пелагія",
"Поліна", "Поляна", "Потішана", "Радміла", "Радослава", "Раїна", "Раїса", "Роксолана",
"Ромена", "Ростислава", "Руслана", "Світлана", "Святослава", "Слава", "Сміяна", "Сніжана",
"Соломія", "Соня", "Софія", "Станислава", "Сюзана", "Таїсія", "Тамара", "Тетяна",
"Устина", "Фаїна", "Февронія", "Федора", "Феодосія", "Харитина", "Христина", "Христя",
"Юліанна", "Юлія", "Юстина", "Юхима", "Юхимія", "Яна", "Ярина", "Ярослава"};
}
Loading

0 comments on commit 31c9686

Please sign in to comment.