diff --git a/src/modules/location.cpp b/src/modules/location.cpp index f6ee5789..8b535b88 100644 --- a/src/modules/location.cpp +++ b/src/modules/location.cpp @@ -78,6 +78,8 @@ CountryAddressesInfo getAddresses(const Locale& locale) return portugalAddresses; case Locale::he_IL: return israelAddresses; + case Locale::ar_PS: + return palestineAddresses; case Locale::es_MX: return mexicoAddresses; default: diff --git a/src/modules/location_data.h b/src/modules/location_data.h index 02052602..a01403f1 100644 --- a/src/modules/location_data.h +++ b/src/modules/location_data.h @@ -8234,6 +8234,185 @@ const CountryAddressesInfo mexicoAddresses{ {}, (mexicoStates), }; +// palestine +const auto palestineCities = std::to_array( + +{ + "Gaza City", + "Hebron", + "Nablus", + "Jenin", + "Ramallah", + "Bethlehem", + "Jericho", + "Tulkarm", + "Qalqilya", + "Rafah", + "Khan Yunis", + "Beit Jala", + "Beit Sahour", + "Al-Bireh", + "Salfit", + "Tubas", + "Dura", + "Yatta", + "Halhul", + "Beitunia", + "Qabatiya", + "Anabta", + "Bani Na'im", + "Bani Suheila", + "Beit Hanoun", + "Beit Lahia", + "Deir al-Balah", + "Abasan al-Kabira", + "Abu Dis", + "Ad-Dhahiriya", + "Arraba", + "As-Samu", + "Azzun", + "Bala", + "Bani Zeid", + "Bidya", + "Birzeit", + "Bruqin", + "Deir Istiya", + "Hajja", + "Hizma", + "Idhna", + "Jaba", + "Jifna", + "Kafr Aqab", + "Kafr ad-Dik", + "Kafr al-Labad", + "Kafr Qaddum", + "Kharas", + "Qatanna" +}); +const auto palestineStates = std::to_array({ + "Hebron", + "Bethlehem", + "Jerusalem", + "Ramallah and Al-Bireh", + "Salfit", + "Nablus", + "Qalqilya", + "Tulkarm", + "Jenin", + "Tubas", + "Jericho and the Jordan Valley", + "North Gaza", + "Gaza", + "Deir al-Balah", + "Khan Yunis", + "Rafah" +} +); +const auto palestineStreetNames = std::to_array({ + "Omar Mukhtar", + "Al-Shuhada", + "Star", + "Jamal Abdel Nasser", + "Al-Wehda", + "Al-Nuzha", + "Al-Irsal", + "Al-Manara", + "Al-Ma'arif", + "Al-Madares", + "Al-Quds", + "Al-Muntazah", + "Al-Ma'arad", + "Al-Baladiya", + "Al-Sa'a", + "Al-Masjid", + "Al-Mahkamah", + "Al-Maktaba", + "Al-Mahatta", + "Al-Masri", + "Al-Mujamma'", + "Al-Muhafaza", + "Al-Mu'assasa", + "Al-Mu'allimin", + "Al-Mu'askar", + "Al-Mu'awiya", + "Al-Mu'athafin", + "Al-Mu'askar Al-Jadid", + "Al-Mu'askar Al-Qadim", + "Al-Mu'askar Al-Shamali", + "Al-Mu'askar Al-Janubi", + "Al-Mu'askar Al-Gharbi", + "Al-Mu'askar Al-Sharqi", + "Al-Mu'askar Al-Awsat", + "Al-Mu'askar Al-Kabir", + "Al-Mu'askar Al-Saghir", + "Al-Mu'askar Al-Madina", + "Al-Mu'askar Al-Bahr", + "Al-Mu'askar Al-Jabal", + "Al-Mu'askar Al-Wadi", + "Al-Mu'askar Al-Sahil", + "Al-Mu'askar Al-Turab", + "Al-Mu'askar Al-Hajar", + "Al-Mu'askar Al-Nahr", + "Al-Mu'askar Al-Suq", + "Al-Mu'askar Al-Masna'", + "Al-Mu'askar Al-Madina Al-Qadima", + "Al-Mu'askar Al-Madina Al-Jadida", + "Al-Mu'askar Al-Madina Al-Munawara", + "Al-Mu'askar Al-Madina Al-Muqaddasa" +} +); + +const auto palestineStreetSuffixes = std::to_array({ + "Shari' or Shari'a", + "Tariq", + "Jada", + "Midan", + "Zuqaq", + "Hara", + "Darb", + "Saha", + "Jisr" +} +); + +const std::string_view palestineZipCodeFormat{"#######"}; +const auto palestineAddressFormats = + std::to_array({ + "{street} {buildingNumber} {secondaryAddress}", + "{street} {buildingNumber}", + }); +const auto palestineSecondaryAddressFormats = std::to_array({ + "Floor #", + "Apt. #", +}); +const auto palestineBuildingNumberFormats = std::to_array({ + "#", + "##", + "###", +}); +const auto palestineStreetFormats = + std::to_array({ + "{streetSuffix} {streetName}", + }); +const auto palestineCityFormats = std::to_array({ + "{cityName}", +}); + +const CountryAddressesInfo palestineAddresses{ + palestineZipCodeFormat, + palestineAddressFormats, + palestineSecondaryAddressFormats, + palestineStreetFormats, + {}, + {palestineStreetNames}, + palestineStreetSuffixes, + palestineBuildingNumberFormats, + palestineCityFormats, + {}, + palestineCities, + {}, + palestineStates, +}; // Poland diff --git a/tests/modules/location_test.cpp b/tests/modules/location_test.cpp index 04fe3982..96e32b3c 100644 --- a/tests/modules/location_test.cpp +++ b/tests/modules/location_test.cpp @@ -82,6 +82,8 @@ CountryAddressesInfo getAddresses(const Locale& locale) return israelAddresses; case Locale::es_MX: return mexicoAddresses; + case Locale::ar_PS: + return palestineAddresses; default: return usaAddresses; } @@ -1121,3 +1123,20 @@ TEST_F(LocationTest, shouldGenerateMexicoStreetAddress) ASSERT_TRUE(std::ranges::any_of(mexicoStreetNames, [&generatedStreetAddress](const std::string_view& streetName) { return generatedStreetAddress.find(streetName) != std::string::npos; })); } + +TEST_F(LocationTest, shouldGeneratepalestineStreet) +{ + const auto generatedStreet = street(Locale::ar_PS); + ASSERT_TRUE(std::ranges::any_of(palestineStreetNames, [&generatedStreet](const std::string_view& street) + { return generatedStreet.find(street) != std::string::npos; })); +} + +TEST_F(LocationTest, shouldGeneratepalestineStreetAddress) +{ + const auto generatedStreetAddress = streetAddress(Locale::ar_PS); + ASSERT_TRUE(std::ranges::any_of(palestineStreetNames, [&generatedStreetAddress](const std::string_view& streetName) + { return generatedStreetAddress.find(streetName) != std::string::npos; })); +} + + +