Skip to content

Commit

Permalink
add korean people names (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Nov 20, 2023
1 parent dca806d commit a2a23fc
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 5 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 @@ -39,6 +39,7 @@ enum class Country
Belgium,
Nederlands,
China,
Korea,
};

const std::vector<Country> countries{
Expand All @@ -47,7 +48,7 @@ const std::vector<Country> countries{
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::Belgium, Country::Nederlands,
Country::China,
Country::China, Country::Korea,
};

inline std::string toString(Country country)
Expand All @@ -68,7 +69,7 @@ inline std::string toString(Country country)
{Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"},
{Country::Austria, "Austria"}, {Country::Switzerland, "Switzerland"},
{Country::Belgium, "Belgium"}, {Country::Nederlands, "Nederlands"},
{Country::China, "China"},
{Country::China, "China"}, {Country::Korea, "Korea"},
};

return countryToStringMapping.at(country);
Expand Down
3 changes: 2 additions & 1 deletion src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "data/italy/ItalianPeopleNames.h"
#include "data/japan/JapanesePeopleNames.h"
#include "data/JobTitles.h"
#include "data/korea/KoreanPeopleNames.h"
#include "data/Languages.h"
#include "data/Nationalities.h"
#include "data/nederlands/DutchPeopleNames.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
5 changes: 3 additions & 2 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "data/italy/ItalianPeopleNames.h"
#include "data/japan/JapanesePeopleNames.h"
#include "data/JobTitles.h"
#include "data/korea/KoreanPeopleNames.h"
#include "data/Languages.h"
#include "data/Nationalities.h"
#include "data/nederlands/DutchPeopleNames.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
{Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames},
{Country::Belgium, belgianPeopleNames}, {Country::Nederlands, dutchPeopleNames},
{Country::China, chinesePeopleNames},
{Country::China, chinesePeopleNames}, {Country::Korea, koreanPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -86,7 +87,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"},
{Country::Austria, "shouldGenerateAustrianName"}, {Country::Switzerland, "shouldGenerateSwissName"},
{Country::Belgium, "shouldGenerateBelgianName"}, {Country::Nederlands, "shouldGenerateDutchName"},
{Country::China, "shouldGenerateChineseName"},
{Country::China, "shouldGenerateChineseName"}, {Country::Korea, "shouldGenerateKoreanName"},
};
}

Expand Down
Loading

0 comments on commit a2a23fc

Please sign in to comment.