From b54b6028bc1976f464163379d72e9297dc17fcb1 Mon Sep 17 00:00:00 2001 From: Maria Camila Gutierrez Date: Sat, 23 May 2020 21:53:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Chapter=202=20exercises=20+=20solut?= =?UTF-8?q?ions=20+=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exercises/es/capitals.json | 497 +++++++++++++++-------------- exercises/es/countries.json | 499 +++++++++++++++--------------- exercises/es/country_text.txt | 2 +- exercises/es/exc_02_02_01.py | 16 +- exercises/es/exc_02_02_02.py | 4 +- exercises/es/exc_02_05_01.py | 4 +- exercises/es/exc_02_05_02.py | 6 +- exercises/es/exc_02_05_03.py | 8 +- exercises/es/exc_02_06.py | 6 +- exercises/es/exc_02_07.py | 4 +- exercises/es/exc_02_09.py | 10 +- exercises/es/exc_02_10_01.py | 6 +- exercises/es/exc_02_10_02.py | 6 +- exercises/es/exc_02_10_03.py | 6 +- exercises/es/exc_02_13.py | 22 +- exercises/es/exc_02_14.py | 8 +- exercises/es/exc_02_15.py | 6 +- exercises/es/solution_02_02_01.py | 16 +- exercises/es/solution_02_02_02.py | 4 +- exercises/es/solution_02_05_01.py | 6 +- exercises/es/solution_02_05_02.py | 8 +- exercises/es/solution_02_05_03.py | 8 +- exercises/es/solution_02_06.py | 6 +- exercises/es/solution_02_07.py | 6 +- exercises/es/solution_02_09.py | 12 +- exercises/es/solution_02_10_01.py | 6 +- exercises/es/solution_02_10_02.py | 6 +- exercises/es/solution_02_10_03.py | 8 +- exercises/es/solution_02_13.py | 22 +- exercises/es/solution_02_14.py | 8 +- exercises/es/solution_02_15.py | 8 +- exercises/es/test_02_02_01.py | 8 +- exercises/es/test_02_05_01.py | 2 +- exercises/es/test_02_05_02.py | 4 +- exercises/es/test_02_05_03.py | 10 +- exercises/es/test_02_06.py | 2 +- exercises/es/test_02_09.py | 4 +- exercises/es/test_02_10_03.py | 4 +- exercises/es/test_02_13.py | 13 +- exercises/es/test_02_14.py | 2 +- exercises/es/test_02_15.py | 2 +- 41 files changed, 641 insertions(+), 644 deletions(-) diff --git a/exercises/es/capitals.json b/exercises/es/capitals.json index 08e4bbdda..4fd769254 100644 --- a/exercises/es/capitals.json +++ b/exercises/es/capitals.json @@ -1,252 +1,249 @@ { - "Afghanistan":"Kabul", - "\u00c5land Islands":"Mariehamn", - "Albania":"Tirana", - "Algeria":"Algiers", - "American Samoa":"Pago Pago", - "Andorra":"Andorra la Vella", - "Angola":"Luanda", - "Anguilla":"The Valley", - "Antarctica":"", - "Antigua and Barbuda":"Saint John's", - "Argentina":"Buenos Aires", - "Armenia":"Yerevan", - "Aruba":"Oranjestad", - "Australia":"Canberra", - "Austria":"Vienna", - "Azerbaijan":"Baku", - "Bahamas":"Nassau", - "Bahrain":"Manama", - "Bangladesh":"Dhaka", - "Barbados":"Bridgetown", - "Belarus":"Minsk", - "Belgium":"Brussels", - "Belize":"Belmopan", - "Benin":"Porto-Novo", - "Bermuda":"Hamilton", - "Bhutan":"Thimphu", - "Bolivia (Plurinational State of)":"Sucre", - "Bonaire, Sint Eustatius and Saba":"Kralendijk", - "Bosnia and Herzegovina":"Sarajevo", - "Botswana":"Gaborone", - "Bouvet Island":"", - "Brazil":"Bras\u00edlia", - "British Indian Ocean Territory":"Diego Garcia", - "United States Minor Outlying Islands":"", - "Virgin Islands (British)":"Road Town", - "Virgin Islands (U.S.)":"Charlotte Amalie", - "Brunei Darussalam":"Bandar Seri Begawan", - "Bulgaria":"Sofia", - "Burkina Faso":"Ouagadougou", - "Burundi":"Bujumbura", - "Cambodia":"Phnom Penh", - "Cameroon":"Yaound\u00e9", - "Canada":"Ottawa", - "Cabo Verde":"Praia", - "Cayman Islands":"George Town", - "Central African Republic":"Bangui", - "Chad":"N'Djamena", - "Chile":"Santiago", - "China":"Beijing", - "Christmas Island":"Flying Fish Cove", - "Cocos (Keeling) Islands":"West Island", - "Colombia":"Bogot\u00e1", - "Comoros":"Moroni", - "Congo":"Brazzaville", - "Congo (Democratic Republic of the)":"Kinshasa", - "Cook Islands":"Avarua", - "Costa Rica":"San Jos\u00e9", - "Croatia":"Zagreb", - "Cuba":"Havana", - "Cura\u00e7ao":"Willemstad", - "Cyprus":"Nicosia", - "Czech Republic":"Prague", - "Denmark":"Copenhagen", - "Djibouti":"Djibouti", - "Dominica":"Roseau", - "Dominican Republic":"Santo Domingo", - "Ecuador":"Quito", - "Egypt":"Cairo", - "El Salvador":"San Salvador", - "Equatorial Guinea":"Malabo", - "Eritrea":"Asmara", - "Estonia":"Tallinn", - "Ethiopia":"Addis Ababa", - "Falkland Islands (Malvinas)":"Stanley", - "Faroe Islands":"T\u00f3rshavn", - "Fiji":"Suva", - "Finland":"Helsinki", - "France":"Paris", - "French Guiana":"Cayenne", - "French Polynesia":"Papeet\u0113", - "French Southern Territories":"Port-aux-Fran\u00e7ais", - "Gabon":"Libreville", - "Gambia":"Banjul", - "Georgia":"Tbilisi", - "Germany":"Berlin", - "Ghana":"Accra", - "Gibraltar":"Gibraltar", - "Greece":"Athens", - "Greenland":"Nuuk", - "Grenada":"St. George's", - "Guadeloupe":"Basse-Terre", - "Guam":"Hag\u00e5t\u00f1a", - "Guatemala":"Guatemala City", - "Guernsey":"St. Peter Port", - "Guinea":"Conakry", - "Guinea-Bissau":"Bissau", - "Guyana":"Georgetown", - "Haiti":"Port-au-Prince", - "Heard Island and McDonald Islands":"", - "Holy See":"Rome", - "Honduras":"Tegucigalpa", - "Hong Kong":"City of Victoria", - "Hungary":"Budapest", - "Iceland":"Reykjav\u00edk", - "India":"New Delhi", - "Indonesia":"Jakarta", - "C\u00f4te d'Ivoire":"Yamoussoukro", - "Iran (Islamic Republic of)":"Tehran", - "Iraq":"Baghdad", - "Ireland":"Dublin", - "Isle of Man":"Douglas", - "Israel":"Jerusalem", - "Italy":"Rome", - "Jamaica":"Kingston", - "Japan":"Tokyo", - "Jersey":"Saint Helier", - "Jordan":"Amman", - "Kazakhstan":"Astana", - "Kenya":"Nairobi", - "Kiribati":"South Tarawa", - "Kuwait":"Kuwait City", - "Kyrgyzstan":"Bishkek", - "Lao People's Democratic Republic":"Vientiane", - "Latvia":"Riga", - "Lebanon":"Beirut", - "Lesotho":"Maseru", - "Liberia":"Monrovia", - "Libya":"Tripoli", - "Liechtenstein":"Vaduz", - "Lithuania":"Vilnius", - "Luxembourg":"Luxembourg", - "Macao":"", - "Macedonia (the former Yugoslav Republic of)":"Skopje", - "Madagascar":"Antananarivo", - "Malawi":"Lilongwe", - "Malaysia":"Kuala Lumpur", - "Maldives":"Mal\u00e9", - "Mali":"Bamako", - "Malta":"Valletta", - "Marshall Islands":"Majuro", - "Martinique":"Fort-de-France", - "Mauritania":"Nouakchott", - "Mauritius":"Port Louis", - "Mayotte":"Mamoudzou", - "Mexico":"Mexico City", - "Micronesia (Federated States of)":"Palikir", - "Moldova (Republic of)":"Chi\u0219in\u0103u", - "Monaco":"Monaco", - "Mongolia":"Ulan Bator", - "Montenegro":"Podgorica", - "Montserrat":"Plymouth", - "Morocco":"Rabat", - "Mozambique":"Maputo", - "Myanmar":"Naypyidaw", - "Namibia":"Windhoek", - "Nauru":"Yaren", - "Nepal":"Kathmandu", - "Netherlands":"Amsterdam", - "New Caledonia":"Noum\u00e9a", - "New Zealand":"Wellington", - "Nicaragua":"Managua", - "Niger":"Niamey", - "Nigeria":"Abuja", - "Niue":"Alofi", - "Norfolk Island":"Kingston", - "Korea (Democratic People's Republic of)":"Pyongyang", - "Northern Mariana Islands":"Saipan", - "Norway":"Oslo", - "Oman":"Muscat", - "Pakistan":"Islamabad", - "Palau":"Ngerulmud", - "Palestine, State of":"Ramallah", - "Panama":"Panama City", - "Papua New Guinea":"Port Moresby", - "Paraguay":"Asunci\u00f3n", - "Peru":"Lima", - "Philippines":"Manila", - "Pitcairn":"Adamstown", - "Poland":"Warsaw", - "Portugal":"Lisbon", - "Puerto Rico":"San Juan", - "Qatar":"Doha", - "Republic of Kosovo":"Pristina", - "R\u00e9union":"Saint-Denis", - "Romania":"Bucharest", - "Russian Federation":"Moscow", - "Rwanda":"Kigali", - "Saint Barth\u00e9lemy":"Gustavia", - "Saint Helena, Ascension and Tristan da Cunha":"Jamestown", - "Saint Kitts and Nevis":"Basseterre", - "Saint Lucia":"Castries", - "Saint Martin (French part)":"Marigot", - "Saint Pierre and Miquelon":"Saint-Pierre", - "Saint Vincent and the Grenadines":"Kingstown", - "Samoa":"Apia", - "San Marino":"City of San Marino", - "Sao Tome and Principe":"S\u00e3o Tom\u00e9", - "Saudi Arabia":"Riyadh", - "Senegal":"Dakar", - "Serbia":"Belgrade", - "Seychelles":"Victoria", - "Sierra Leone":"Freetown", - "Singapore":"Singapore", - "Sint Maarten (Dutch part)":"Philipsburg", - "Slovakia":"Bratislava", - "Slovenia":"Ljubljana", - "Solomon Islands":"Honiara", - "Somalia":"Mogadishu", - "South Africa":"Pretoria", - "South Georgia and the South Sandwich Islands":"King Edward Point", - "Korea (Republic of)":"Seoul", - "South Sudan":"Juba", - "Spain":"Madrid", - "Sri Lanka":"Colombo", - "Sudan":"Khartoum", - "Suriname":"Paramaribo", - "Svalbard and Jan Mayen":"Longyearbyen", - "Swaziland":"Lobamba", - "Sweden":"Stockholm", - "Switzerland":"Bern", - "Syrian Arab Republic":"Damascus", - "Taiwan":"Taipei", - "Tajikistan":"Dushanbe", - "Tanzania, United Republic of":"Dodoma", - "Thailand":"Bangkok", - "Timor-Leste":"Dili", - "Togo":"Lom\u00e9", - "Tokelau":"Fakaofo", - "Tonga":"Nuku'alofa", - "Trinidad and Tobago":"Port of Spain", - "Tunisia":"Tunis", - "Turkey":"Ankara", - "Turkmenistan":"Ashgabat", - "Turks and Caicos Islands":"Cockburn Town", - "Tuvalu":"Funafuti", - "Uganda":"Kampala", - "Ukraine":"Kiev", - "United Arab Emirates":"Abu Dhabi", - "United Kingdom of Great Britain and Northern Ireland":"London", - "United States of America":"Washington, D.C.", - "Uruguay":"Montevideo", - "Uzbekistan":"Tashkent", - "Vanuatu":"Port Vila", - "Venezuela (Bolivarian Republic of)":"Caracas", - "Viet Nam":"Hanoi", - "Wallis and Futuna":"Mata-Utu", - "Western Sahara":"El Aai\u00fan", - "Yemen":"Sana'a", - "Zambia":"Lusaka", - "Zimbabwe":"Harare" + "Afganistán": "Kabul", + "Alandia": "Mariehamn", + "Albania": "Tirana", + "Argelia": "Algiers", + "Samoa Americana": "Pago Pago", + "Andorra": "Andorra la Vella", + "Angola": "Luanda", + "Anguilla": "The Valley", + "Antártida": "", + "Antigua y Barbuda": "Saint John's", + "Argentina": "Buenos Aires", + "Armenia": "Yerevan", + "Aruba": "Oranjestad", + "Australia": "Canberra", + "Austria": "Vienna", + "Azerbaiyán": "Baku", + "Bahamas": "Nassau", + "Bahrein": "Manama", + "Bangladesh": "Dhaka", + "Barbados": "Bridgetown", + "Bielorrusia": "Minsk", + "Bélgica": "Brussels", + "Belice": "Belmopan", + "Benín": "Porto-Novo", + "Bermudas": "Hamilton", + "Bután": "Thimphu", + "Bolivia": "Sucre", + "Bosnia y Herzegovina": "Sarajevo", + "Botswana": "Gaborone", + "Isla Bouvet": "", + "Brasil": "Brasília", + "Territorio Británico del Océano Índico": "Diego Garcia", + "Islas Ultramarinas Menores de Estados Unidos": "", + "Islas Vírgenes del Reino Unido": "Road Town", + "Islas Vírgenes de los Estados Unidos": "Charlotte Amalie", + "Brunei": "Bandar Seri Begawan", + "Bulgaria": "Sofia", + "Burkina Faso": "Ouagadougou", + "Burundi": "Bujumbura", + "Camboya": "Phnom Penh", + "Camerún": "Yaoundé", + "Canadá": "Ottawa", + "Cabo Verde": "Praia", + "Islas Caimán": "George Town", + "República Centroafricana": "Bangui", + "Chad": "N'Djamena", + "Chile": "Santiago", + "China": "Beijing", + "Isla de Navidad": "Flying Fish Cove", + "Islas Cocos o Islas Keeling": "West Island", + "Colombia": "Bogotá", + "Comoras": "Moroni", + "Congo": "Brazzaville", + "Congo (Rep. Dem.)": "Kinshasa", + "Islas Cook": "Avarua", + "Costa Rica": "San José", + "Croacia": "Zagreb", + "Cuba": "Havana", + "Chipre": "Nicosia", + "República Checa": "Prague", + "Dinamarca": "Copenhagen", + "Yibuti": "Djibouti", + "Dominica": "Roseau", + "República Dominicana": "Santo Domingo", + "Ecuador": "Quito", + "Egipto": "Cairo", + "El Salvador": "San Salvador", + "Guinea Ecuatorial": "Malabo", + "Eritrea": "Asmara", + "Estonia": "Tallinn", + "Etiopía": "Addis Ababa", + "Islas Malvinas": "Stanley", + "Islas Faroe": "Tórshavn", + "Fiyi": "Suva", + "Finlandia": "Helsinki", + "Francia": "Paris", + "Guayana Francesa": "Cayenne", + "Polinesia Francesa": "Papeetē", + "Tierras Australes y Antárticas Francesas": "Port-aux-Français", + "Gabón": "Libreville", + "Gambia": "Banjul", + "Georgia": "Tbilisi", + "Alemania": "Berlin", + "Ghana": "Accra", + "Gibraltar": "Gibraltar", + "Grecia": "Athens", + "Groenlandia": "Nuuk", + "Grenada": "St. George's", + "Guadalupe": "Basse-Terre", + "Guam": "Hagåtña", + "Guatemala": "Guatemala City", + "Guernsey": "St. Peter Port", + "Guinea": "Conakry", + "Guinea-Bisáu": "Bissau", + "Guyana": "Georgetown", + "Haiti": "Port-au-Prince", + "Islas Heard y McDonald": "", + "Santa Sede": "Rome", + "Honduras": "Tegucigalpa", + "Hong Kong": "City of Victoria", + "Hungría": "Budapest", + "Islandia": "Reykjavík", + "India": "New Delhi", + "Indonesia": "Jakarta", + "Costa de Marfil": "Yamoussoukro", + "Iran": "Tehran", + "Irak": "Baghdad", + "Irlanda": "Dublin", + "Isla de Man": "Douglas", + "Israel": "Jerusalem", + "Italia": "Rome", + "Jamaica": "Kingston", + "Japón": "Tokyo", + "Jersey": "Saint Helier", + "Jordania": "Amman", + "Kazajistán": "Astana", + "Kenia": "Nairobi", + "Kiribati": "South Tarawa", + "Kuwait": "Kuwait City", + "Kirguizistán": "Bishkek", + "Laos": "Vientiane", + "Letonia": "Riga", + "Líbano": "Beirut", + "Lesotho": "Maseru", + "Liberia": "Monrovia", + "Libia": "Tripoli", + "Liechtenstein": "Vaduz", + "Lituania": "Vilnius", + "Luxemburgo": "Luxembourg", + "Macao": "Macao", + "Macedonia": "Skopje", + "Madagascar": "Antananarivo", + "Malawi": "Lilongwe", + "Malasia": "Kuala Lumpur", + "Maldivas": "Malé", + "Mali": "Bamako", + "Malta": "Valletta", + "Islas Marshall": "Majuro", + "Martinica": "Fort-de-France", + "Mauritania": "Nouakchott", + "Mauricio": "Port Louis", + "Mayotte": "Mamoudzou", + "México": "Mexico City", + "Micronesia": "Palikir", + "Moldavia": "Chișinău", + "Mónaco": "Monaco", + "Mongolia": "Ulan Bator", + "Montenegro": "Podgorica", + "Montserrat": "Plymouth", + "Marruecos": "Rabat", + "Mozambique": "Maputo", + "Myanmar": "Naypyidaw", + "Namibia": "Windhoek", + "Nauru": "Yaren", + "Nepal": "Kathmandu", + "Países Bajos": "Amsterdam", + "Nueva Caledonia": "Nouméa", + "Nueva Zelanda": "Wellington", + "Nicaragua": "Managua", + "Níger": "Niamey", + "Nigeria": "Abuja", + "Niue": "Alofi", + "Isla de Norfolk": "Kingston", + "Corea del Norte": "Pyongyang", + "Islas Marianas del Norte": "Saipan", + "Noruega": "Oslo", + "Omán": "Muscat", + "Pakistán": "Islamabad", + "Palau": "Ngerulmud", + "Palestina": "Ramallah", + "Panamá": "Panama City", + "Papúa Nueva Guinea": "Port Moresby", + "Paraguay": "Asunción", + "Perú": "Lima", + "Filipinas": "Manila", + "Islas Pitcairn": "Adamstown", + "Polonia": "Warsaw", + "Portugal": "Lisbon", + "Puerto Rico": "San Juan", + "Catar": "Doha", + "Kosovo": "Pristina", + "Reunión": "Saint-Denis", + "Rumania": "Bucharest", + "Rusia": "Moscow", + "Ruanda": "Kigali", + "San Bartolomé": "Gustavia", + "Santa Helena": "Jamestown", + "San Cristóbal y Nieves": "Basseterre", + "Santa Lucía": "Castries", + "Saint Martin": "Marigot", + "San Pedro y Miquelón": "Saint-Pierre", + "San Vicente y Granadinas": "Kingstown", + "Samoa": "Apia", + "San Marino": "City of San Marino", + "Santo Tomé y Príncipe": "São Tomé", + "Arabia Saudí": "Riyadh", + "Senegal": "Dakar", + "Serbia": "Belgrade", + "Seychelles": "Victoria", + "Sierra Leone": "Freetown", + "Singapur": "Singapore", + "República Eslovaca": "Bratislava", + "Eslovenia": "Ljubljana", + "Islas Salomón": "Honiara", + "Somalia": "Mogadishu", + "República de Sudáfrica": "Pretoria", + "Islas Georgias del Sur y Sandwich del Sur": "King Edward Point", + "Corea del Sur": "Seoul", + "Sudán del Sur": "Juba", + "España": "Madrid", + "Sri Lanka": "Colombo", + "Sudán": "Khartoum", + "Surinam": "Paramaribo", + "Islas Svalbard y Jan Mayen": "Longyearbyen", + "Suazilandia": "Lobamba", + "Suecia": "Stockholm", + "Suiza": "Bern", + "Siria": "Damascus", + "Taiwán": "Taipei", + "Tayikistán": "Dushanbe", + "Tanzania": "Dodoma", + "Tailandia": "Bangkok", + "Timor Oriental": "Dili", + "Togo": "Lomé", + "Islas Tokelau": "Fakaofo", + "Tonga": "Nuku'alofa", + "Trinidad y Tobago": "Port of Spain", + "Túnez": "Tunis", + "Turquía": "Ankara", + "Turkmenistán": "Ashgabat", + "Islas Turks y Caicos": "Cockburn Town", + "Tuvalu": "Funafuti", + "Uganda": "Kampala", + "Ucrania": "Kiev", + "Emiratos Árabes Unidos": "Abu Dhabi", + "Reino Unido": "London", + "Estados Unidos": "Washington, D.C.", + "Uruguay": "Montevideo", + "Uzbekistán": "Tashkent", + "Vanuatu": "Port Vila", + "Venezuela": "Caracas", + "Vietnam": "Hanoi", + "Wallis y Futuna": "Mata-Utu", + "Sahara Occidental": "El Aaiún", + "Yemen": "Sana'a", + "Zambia": "Lusaka", + "Zimbabue": "Harare" } \ No newline at end of file diff --git a/exercises/es/countries.json b/exercises/es/countries.json index ec53d04de..06a34602d 100644 --- a/exercises/es/countries.json +++ b/exercises/es/countries.json @@ -1,252 +1,249 @@ [ - "Afghanistan", - "Åland Islands", - "Albania", - "Algeria", - "American Samoa", - "Andorra", - "Angola", - "Anguilla", - "Antarctica", - "Antigua and Barbuda", - "Argentina", - "Armenia", - "Aruba", - "Australia", - "Austria", - "Azerbaijan", - "Bahamas", - "Bahrain", - "Bangladesh", - "Barbados", - "Belarus", - "Belgium", - "Belize", - "Benin", - "Bermuda", - "Bhutan", - "Bolivia (Plurinational State of)", - "Bonaire, Sint Eustatius and Saba", - "Bosnia and Herzegovina", - "Botswana", - "Bouvet Island", - "Brazil", - "British Indian Ocean Territory", - "United States Minor Outlying Islands", - "Virgin Islands (British)", - "Virgin Islands (U.S.)", - "Brunei Darussalam", - "Bulgaria", - "Burkina Faso", - "Burundi", - "Cambodia", - "Cameroon", - "Canada", - "Cabo Verde", - "Cayman Islands", - "Central African Republic", - "Chad", - "Chile", - "China", - "Christmas Island", - "Cocos (Keeling) Islands", - "Colombia", - "Comoros", - "Congo", - "Congo (Democratic Republic of the)", - "Cook Islands", - "Costa Rica", - "Croatia", - "Cuba", - "Curaçao", - "Cyprus", - "Czech Republic", - "Denmark", - "Djibouti", - "Dominica", - "Dominican Republic", - "Ecuador", - "Egypt", - "El Salvador", - "Equatorial Guinea", - "Eritrea", - "Estonia", - "Ethiopia", - "Falkland Islands (Malvinas)", - "Faroe Islands", - "Fiji", - "Finland", - "France", - "French Guiana", - "French Polynesia", - "French Southern Territories", - "Gabon", - "Gambia", - "Georgia", - "Germany", - "Ghana", - "Gibraltar", - "Greece", - "Greenland", - "Grenada", - "Guadeloupe", - "Guam", - "Guatemala", - "Guernsey", - "Guinea", - "Guinea-Bissau", - "Guyana", - "Haiti", - "Heard Island and McDonald Islands", - "Holy See", - "Honduras", - "Hong Kong", - "Hungary", - "Iceland", - "India", - "Indonesia", - "Côte d'Ivoire", - "Iran (Islamic Republic of)", - "Iraq", - "Ireland", - "Isle of Man", - "Israel", - "Italy", - "Jamaica", - "Japan", - "Jersey", - "Jordan", - "Kazakhstan", - "Kenya", - "Kiribati", - "Kuwait", - "Kyrgyzstan", - "Lao People's Democratic Republic", - "Latvia", - "Lebanon", - "Lesotho", - "Liberia", - "Libya", - "Liechtenstein", - "Lithuania", - "Luxembourg", - "Macao", - "Macedonia (the former Yugoslav Republic of)", - "Madagascar", - "Malawi", - "Malaysia", - "Maldives", - "Mali", - "Malta", - "Marshall Islands", - "Martinique", - "Mauritania", - "Mauritius", - "Mayotte", - "Mexico", - "Micronesia (Federated States of)", - "Moldova (Republic of)", - "Monaco", - "Mongolia", - "Montenegro", - "Montserrat", - "Morocco", - "Mozambique", - "Myanmar", - "Namibia", - "Nauru", - "Nepal", - "Netherlands", - "New Caledonia", - "New Zealand", - "Nicaragua", - "Niger", - "Nigeria", - "Niue", - "Norfolk Island", - "Korea (Democratic People's Republic of)", - "Northern Mariana Islands", - "Norway", - "Oman", - "Pakistan", - "Palau", - "Palestine, State of", - "Panama", - "Papua New Guinea", - "Paraguay", - "Peru", - "Philippines", - "Pitcairn", - "Poland", - "Portugal", - "Puerto Rico", - "Qatar", - "Republic of Kosovo", - "Réunion", - "Romania", - "Russian Federation", - "Rwanda", - "Saint Barthélemy", - "Saint Helena, Ascension and Tristan da Cunha", - "Saint Kitts and Nevis", - "Saint Lucia", - "Saint Martin (French part)", - "Saint Pierre and Miquelon", - "Saint Vincent and the Grenadines", - "Samoa", - "San Marino", - "Sao Tome and Principe", - "Saudi Arabia", - "Senegal", - "Serbia", - "Seychelles", - "Sierra Leone", - "Singapore", - "Sint Maarten (Dutch part)", - "Slovakia", - "Slovenia", - "Solomon Islands", - "Somalia", - "South Africa", - "South Georgia and the South Sandwich Islands", - "Korea (Republic of)", - "South Sudan", - "Spain", - "Sri Lanka", - "Sudan", - "Suriname", - "Svalbard and Jan Mayen", - "Swaziland", - "Sweden", - "Switzerland", - "Syrian Arab Republic", - "Taiwan", - "Tajikistan", - "Tanzania, United Republic of", - "Thailand", - "Timor-Leste", - "Togo", - "Tokelau", - "Tonga", - "Trinidad and Tobago", - "Tunisia", - "Turkey", - "Turkmenistan", - "Turks and Caicos Islands", - "Tuvalu", - "Uganda", - "Ukraine", - "United Arab Emirates", - "United Kingdom of Great Britain and Northern Ireland", - "United States of America", - "Uruguay", - "Uzbekistan", - "Vanuatu", - "Venezuela (Bolivarian Republic of)", - "Viet Nam", - "Wallis and Futuna", - "Western Sahara", - "Yemen", - "Zambia", - "Zimbabwe" -] + "Afganistán", + "Alandia", + "Albania", + "Argelia", + "Samoa Americana", + "Andorra", + "Angola", + "Anguilla", + "Antártida", + "Antigua y Barbuda", + "Argentina", + "Armenia", + "Aruba", + "Australia", + "Austria", + "Azerbaiyán", + "Bahamas", + "Bahrein", + "Bangladesh", + "Barbados", + "Bielorrusia", + "Bélgica", + "Belice", + "Benín", + "Bermudas", + "Bután", + "Bolivia", + "Bosnia y Herzegovina", + "Botswana", + "Isla Bouvet", + "Brasil", + "Territorio Británico del Océano Índico", + "Islas Ultramarinas Menores de Estados Unidos", + "Islas Vírgenes del Reino Unido", + "Islas Vírgenes de los Estados Unidos", + "Brunei", + "Bulgaria", + "Burkina Faso", + "Burundi", + "Camboya", + "Camerún", + "Canadá", + "Cabo Verde", + "Islas Caimán", + "República Centroafricana", + "Chad", + "Chile", + "China", + "Isla de Navidad", + "Islas Cocos o Islas Keeling", + "Colombia", + "Comoras", + "Congo", + "Congo (Rep. Dem.)", + "Islas Cook", + "Costa Rica", + "Croacia", + "Cuba", + "Chipre", + "República Checa", + "Dinamarca", + "Yibuti", + "Dominica", + "República Dominicana", + "Ecuador", + "Egipto", + "El Salvador", + "Guinea Ecuatorial", + "Eritrea", + "Estonia", + "Etiopía", + "Islas Malvinas", + "Islas Faroe", + "Fiyi", + "Finlandia", + "Francia", + "Guayana Francesa", + "Polinesia Francesa", + "Tierras Australes y Antárticas Francesas", + "Gabón", + "Gambia", + "Georgia", + "Alemania", + "Ghana", + "Gibraltar", + "Grecia", + "Groenlandia", + "Grenada", + "Guadalupe", + "Guam", + "Guatemala", + "Guernsey", + "Guinea", + "Guinea-Bisáu", + "Guyana", + "Haiti", + "Islas Heard y McDonald", + "Santa Sede", + "Honduras", + "Hong Kong", + "Hungría", + "Islandia", + "India", + "Indonesia", + "Costa de Marfil", + "Iran", + "Irak", + "Irlanda", + "Isla de Man", + "Israel", + "Italia", + "Jamaica", + "Japón", + "Jersey", + "Jordania", + "Kazajistán", + "Kenia", + "Kiribati", + "Kuwait", + "Kirguizistán", + "Laos", + "Letonia", + "Líbano", + "Lesotho", + "Liberia", + "Libia", + "Liechtenstein", + "Lituania", + "Luxemburgo", + "Macao", + "Macedonia", + "Madagascar", + "Malawi", + "Malasia", + "Maldivas", + "Mali", + "Malta", + "Islas Marshall", + "Martinica", + "Mauritania", + "Mauricio", + "Mayotte", + "México", + "Micronesia", + "Moldavia", + "Mónaco", + "Mongolia", + "Montenegro", + "Montserrat", + "Marruecos", + "Mozambique", + "Myanmar", + "Namibia", + "Nauru", + "Nepal", + "Países Bajos", + "Nueva Caledonia", + "Nueva Zelanda", + "Nicaragua", + "Níger", + "Nigeria", + "Niue", + "Isla de Norfolk", + "Corea del Norte", + "Islas Marianas del Norte", + "Noruega", + "Omán", + "Pakistán", + "Palau", + "Palestina", + "Panamá", + "Papúa Nueva Guinea", + "Paraguay", + "Perú", + "Filipinas", + "Islas Pitcairn", + "Polonia", + "Portugal", + "Puerto Rico", + "Catar", + "Kosovo", + "Reunión", + "Rumania", + "Rusia", + "Ruanda", + "San Bartolomé", + "Santa Helena", + "San Cristóbal y Nieves", + "Santa Lucía", + "Saint Martin", + "San Pedro y Miquelón", + "San Vicente y Granadinas", + "Samoa", + "San Marino", + "Santo Tomé y Príncipe", + "Arabia Saudí", + "Senegal", + "Serbia", + "Seychelles", + "Sierra Leone", + "Singapur", + "República Eslovaca", + "Eslovenia", + "Islas Salomón", + "Somalia", + "República de Sudáfrica", + "Islas Georgias del Sur y Sandwich del Sur", + "Corea del Sur", + "Sudán del Sur", + "España", + "Sri Lanka", + "Sudán", + "Surinam", + "Islas Svalbard y Jan Mayen", + "Suazilandia", + "Suecia", + "Suiza", + "Siria", + "Taiwán", + "Tayikistán", + "Tanzania", + "Tailandia", + "Timor Oriental", + "Togo", + "Islas Tokelau", + "Tonga", + "Trinidad y Tobago", + "Túnez", + "Turquía", + "Turkmenistán", + "Islas Turks y Caicos", + "Tuvalu", + "Uganda", + "Ucrania", + "Emiratos Árabes Unidos", + "Reino Unido", + "Estados Unidos", + "Uruguay", + "Uzbekistán", + "Vanuatu", + "Venezuela", + "Vietnam", + "Wallis y Futuna", + "Sahara Occidental", + "Yemen", + "Zambia", + "Zimbabue" +] \ No newline at end of file diff --git a/exercises/es/country_text.txt b/exercises/es/country_text.txt index 885765ce0..e6550f506 100644 --- a/exercises/es/country_text.txt +++ b/exercises/es/country_text.txt @@ -1 +1 @@ -After the Cold War, the UN saw a radical expansion in its peacekeeping duties, taking on more missions in ten years than it had in the previous four decades.Between 1988 and 2000, the number of adopted Security Council resolutions more than doubled, and the peacekeeping budget increased more than tenfold. The UN negotiated an end to the Salvadoran Civil War, launched a successful peacekeeping mission in Namibia, and oversaw democratic elections in post-apartheid South Africa and post-Khmer Rouge Cambodia. In 1991, the UN authorized a US-led coalition that repulsed the Iraqi invasion of Kuwait. Brian Urquhart, Under-Secretary-General from 1971 to 1985, later described the hopes raised by these successes as a "false renaissance" for the organization, given the more troubled missions that followed. Though the UN Charter had been written primarily to prevent aggression by one nation against another, in the early 1990s the UN faced a number of simultaneous, serious crises within nations such as Somalia, Haiti, Mozambique, and the former Yugoslavia. The UN mission in Somalia was widely viewed as a failure after the US withdrawal following casualties in the Battle of Mogadishu, and the UN mission to Bosnia faced "worldwide ridicule" for its indecisive and confused mission in the face of ethnic cleansing. In 1994, the UN Assistance Mission for Rwanda failed to intervene in the Rwandan genocide amid indecision in the Security Council. Beginning in the last decades of the Cold War, American and European critics of the UN condemned the organization for perceived mismanagement and corruption. In 1984, the US President, Ronald Reagan, withdrew his nation's funding from UNESCO (the United Nations Educational, Scientific and Cultural Organization, founded 1946) over allegations of mismanagement, followed by Britain and Singapore. Boutros Boutros-Ghali, Secretary-General from 1992 to 1996, initiated a reform of the Secretariat, reducing the size of the organization somewhat. His successor, Kofi Annan (1997–2006), initiated further management reforms in the face of threats from the United States to withhold its UN dues. In the late 1990s and 2000s, international interventions authorized by the UN took a wider variety of forms. The UN mission in the Sierra Leone Civil War of 1991–2002 was supplemented by British Royal Marines, and the invasion of Afghanistan in 2001 was overseen by NATO. In 2003, the United States invaded Iraq despite failing to pass a UN Security Council resolution for authorization, prompting a new round of questioning of the organization's effectiveness. Under the eighth Secretary-General, Ban Ki-moon, the UN has intervened with peacekeepers in crises including the War in Darfur in Sudan and the Kivu conflict in the Democratic Republic of Congo and sent observers and chemical weapons inspectors to the Syrian Civil War. In 2013, an internal review of UN actions in the final battles of the Sri Lankan Civil War in 2009 concluded that the organization had suffered "systemic failure". One hundred and one UN personnel died in the 2010 Haiti earthquake, the worst loss of life in the organization's history. The Millennium Summit was held in 2000 to discuss the UN's role in the 21st century. The three day meeting was the largest gathering of world leaders in history, and culminated in the adoption by all member states of the Millennium Development Goals (MDGs), a commitment to achieve international development in areas such as poverty reduction, gender equality, and public health. Progress towards these goals, which were to be met by 2015, was ultimately uneven. The 2005 World Summit reaffirmed the UN's focus on promoting development, peacekeeping, human rights, and global security. The Sustainable Development Goals were launched in 2015 to succeed the Millennium Development Goals. In addition to addressing global challenges, the UN has sought to improve its accountability and democratic legitimacy by engaging more with civil society and fostering a global constituency. In an effort to enhance transparency, in 2016 the organization held its first public debate between candidates for Secretary-General. On 1 January 2017, Portuguese diplomat António Guterres, who previously served as UN High Commissioner for Refugees, became the ninth Secretary-General. Guterres has highlighted several key goals for his administration, including an emphasis on diplomacy for preventing conflicts, more effective peacekeeping efforts, and streamlining the organization to be more responsive and versatile to global needs. +Las propuestas de reforma del Consejo empezaron con la conferencia que escribió la Carta de la ONU y han continuado hasta el presente. Como el historiador británico Paul Kennedy escribió "todo el mundo acepta que la presente estructura es defectuosa. Pero el consenso de cómo arreglarla permanece fuera de alcance". Ha habido conversaciones para incrementar el número permanente de miembros. Los países que han hecho demandas más fuertes para los asientos permanentes son Brasil, Alemania, India y Japón. Japón y Alemania, los principales poderes derrotados en la II Guerra Mundial, son ahora los segundos y terceros mayores financiadores de la ONU respectivamente, mientras que Brasil e India son dos de los mayores contribuidores de tropas para las misiones de la paz de la ONU. Esta propuesta ha encontrado oposición en un grupo de países llamado Unidos por Consenso. El anterior secretario de la ONU, Kofi Annan, pidió a un equipo de asesores que realizaran recomendaciones para reformar la ONU para el año 2004. Una medida propuesta es incrementar el número permanente de miembros de cinco, que, en muchas propuestas, podría incluir Brasil, Alemania, India y Japón (conocidas como las naciones del G4), un asiento para África (más habitualmente entre Egipto, Nigeria o Sudáfrica) y/o un asiento de la Liga Árabe. El 21 de septiembre de 2004 las naciones del G4 publicaron una declaración conjunta para respaldar mutuamente el sí a la condición de permanente, junto con dos países africanos. La propuesta tendría que ser aceptada por dos tercios de la Asamblea General (128 votos). Los miembros permanentes, cada uno sosteniendo el derecho de veto, anunciaron sus posiciones sobre la reforma del Consejo de Seguridad de forma reacia. Los Estados Unidos han apoyado inequívocamente la membresía de Japón y han prestado su apoyo a India y a un pequeño número de miembros no permanentes. El Reino Unido y Francia esencialmente apoyan la posición del G4, con la expansión del número de miembros permanente y no permanente y el acceso de Alemania, Brasil, India y Japón al estatus de miembro permanente, así como un incremento en la presencia de países africanos en el Consejo. China ha apoyado el fortalecimiento de la representación de los países en desarrollo y se ha opuesto firmemente a la membresía de Japón. A la puja de India por ser miembro permanente del Consejo de Seguridad han mostrado su apoyo Francia, Rusia, Reino Unido, y Estados Unidos aunque los Estados unidos inicialmente se opusieron a la candidatura india en materia de proliferación nuclear, al haber adquirido India armas nucleares y no haber firmado el Tratado de No Proliferación. El 15 de abril de 2011, China oficialmente expresó su apoyo para un incremento del rol indio en las Naciones unidas, sin especificar ambiciones de endorsar el Consejo de Seguridad. En cualquier caso, recientemente China ha expresado su apoyo para la candidatura de India como un miembro permanente si India revoca su apoyo a la candidatura japonesa. \ No newline at end of file diff --git a/exercises/es/exc_02_02_01.py b/exercises/es/exc_02_02_01.py index 6f46f3446..eee617899 100644 --- a/exercises/es/exc_02_02_01.py +++ b/exercises/es/exc_02_02_01.py @@ -1,12 +1,12 @@ import spacy -nlp = spacy.load("en_core_web_sm") -doc = nlp("I have a cat") +nlp = spacy.load("es_core_news_sm") +doc = nlp("Yo tengo un gato") -# Busca el hash para la palabra "cat" -cat_hash = ____.____.____[____] -print(cat_hash) +# Busca el hash para la palabra "gato" +gato_hash = ____.____.____[____] +print(gato_hash) -# Busca el cat_hash para obtener el string -cat_string = ____.____.____[____] -print(cat_string) +# Busca el gato_hash para obtener el string +gato_string = ____.____.____[____] +print(gato_string) diff --git a/exercises/es/exc_02_02_02.py b/exercises/es/exc_02_02_02.py index c9cc0ff69..eca872f26 100644 --- a/exercises/es/exc_02_02_02.py +++ b/exercises/es/exc_02_02_02.py @@ -1,7 +1,7 @@ import spacy -nlp = spacy.load("en_core_web_sm") -doc = nlp("David Bowie is a PERSON") +nlp = spacy.load("es_core_news_sm") +doc = nlp("David Bowie tiene el label PERSON") # Busca el hash para el label del string "PERSON" person_hash = ____.____.____[____] diff --git a/exercises/es/exc_02_05_01.py b/exercises/es/exc_02_05_01.py index 2f7eee9f7..2d3d43317 100644 --- a/exercises/es/exc_02_05_01.py +++ b/exercises/es/exc_02_05_01.py @@ -5,8 +5,8 @@ # Importa la clase Doc from ____ import ____ -# El texto deseado: "spaCy is cool!" -words = ["spaCy", "is", "cool", "!"] +# El texto deseado: "spaCy es divertido!" +words = ["spaCy", "es", "divertido", "!"] spaces = [True, True, False, False] # Crea un Doc a partir de las palabras y los espacios diff --git a/exercises/es/exc_02_05_02.py b/exercises/es/exc_02_05_02.py index 1a5314b60..35f9130c5 100644 --- a/exercises/es/exc_02_05_02.py +++ b/exercises/es/exc_02_05_02.py @@ -1,12 +1,12 @@ import spacy -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") # Importa la clase Doc from ____ import ____ -# El texto deseado: "Go, get started!" -words = ["Go", ",", "get", "started", "!"] +# El texto deseado: "¡Vamos, empieza!" +words = ["¡", "Vamos", ",", "empieza", "!"] spaces = [____, ____, ____, ____, ____] # Crea un Doc a partir de las palabras y los espacios diff --git a/exercises/es/exc_02_05_03.py b/exercises/es/exc_02_05_03.py index 79a20de05..739000468 100644 --- a/exercises/es/exc_02_05_03.py +++ b/exercises/es/exc_02_05_03.py @@ -1,13 +1,13 @@ import spacy -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") # Importa la clase Doc from ____ import ____ -# El texto deseado: "Oh, really?!" -words = [____, ____, ____, ____, ____] -spaces = [____, ____, ____, ____, ____] +# El texto deseado: "¡¿En serio?!" +words = [____, ____, ____, ____, ____, ____] +spaces = [____, ____, ____, ____, ____, ____] # Crea un Doc a partir de las palabras y los espacios doc = ____(____, ____=____, ____=____) diff --git a/exercises/es/exc_02_06.py b/exercises/es/exc_02_06.py index 06debe60c..1aa08d15c 100644 --- a/exercises/es/exc_02_06.py +++ b/exercises/es/exc_02_06.py @@ -1,11 +1,11 @@ -from spacy.lang.en import English +from spacy.lang.es import Spanish -nlp = English() +nlp = Spanish() # Importa las clases Doc y Span from spacy.____ import ____, ____ -words = ["I", "like", "David", "Bowie"] +words = ["Me", "gusta", "David", "Bowie"] spaces = [True, True, True, False] # Crea un doc a partir de las palabras y los espacios diff --git a/exercises/es/exc_02_07.py b/exercises/es/exc_02_07.py index f9d8e9507..8dfe037c9 100644 --- a/exercises/es/exc_02_07.py +++ b/exercises/es/exc_02_07.py @@ -1,7 +1,7 @@ import spacy nlp = spacy.load("en_core_web_sm") -doc = nlp("Berlin is a nice city") +doc = nlp("Por Berlín fluye el río Esprea.") # Obtén todos los tokens y los part-of-speech tags token_texts = [token.text for token in doc] @@ -13,4 +13,4 @@ # Revisa si el siguiente token es un verbo if pos_tags[index + 1] == "VERB": result = token_texts[index] - print("Found proper noun before a verb:", result) + print("Encontré un nombre propio antes de un verbo:", result) diff --git a/exercises/es/exc_02_09.py b/exercises/es/exc_02_09.py index 9052da526..9b18ed853 100644 --- a/exercises/es/exc_02_09.py +++ b/exercises/es/exc_02_09.py @@ -1,11 +1,11 @@ import spacy -# Carga el modelo en_core_web_md +# Carga el modelo es_core_news_md nlp = ____ # Procesa un texto -doc = nlp("Two bananas in pyjamas") +doc = nlp("Hoy hice pan de banano") -# Obtén el vector para el token "bananas" -bananas_vector = ____.____ -print(bananas_vector) +# Obtén el vector para el token "banano" +banano_vector = ____.____ +print(banano_vector) diff --git a/exercises/es/exc_02_10_01.py b/exercises/es/exc_02_10_01.py index b775ef369..3724c917c 100644 --- a/exercises/es/exc_02_10_01.py +++ b/exercises/es/exc_02_10_01.py @@ -1,9 +1,9 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc1 = nlp("It's a warm summer day") -doc2 = nlp("It's sunny outside") +doc1 = nlp("Es un cálido día de verano") +doc2 = nlp("Hace sol afuera") # Obtén la similitud entre el doc1 y el doc2 similarity = ____.____(____) diff --git a/exercises/es/exc_02_10_02.py b/exercises/es/exc_02_10_02.py index 961b150e4..ba785c86b 100644 --- a/exercises/es/exc_02_10_02.py +++ b/exercises/es/exc_02_10_02.py @@ -1,10 +1,10 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc = nlp("TV and books") +doc = nlp("TV y libros") token1, token2 = doc[0], doc[2] -# Obtén la similitud entre los tokens "TV" y "books" +# Obtén la similitud entre los tokens "TV" y "libros" similarity = ____.____(____) print(similarity) diff --git a/exercises/es/exc_02_10_03.py b/exercises/es/exc_02_10_03.py index ce64c6f3d..56c948d4e 100644 --- a/exercises/es/exc_02_10_03.py +++ b/exercises/es/exc_02_10_03.py @@ -1,10 +1,10 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc = nlp("This was a great restaurant. Afterwards, we went to a really nice bar.") +doc = nlp("Estuvimos en un restaurante genial. Luego, fuimos a un bar muy divertido.") -# Crea los spans para "great restaurant" y "really nice bar" +# Crea los spans para "restaurante genial" y "bar muy divertido" span1 = ____ span2 = ____ diff --git a/exercises/es/exc_02_13.py b/exercises/es/exc_02_13.py index 65978f3d1..3fb62f4db 100644 --- a/exercises/es/exc_02_13.py +++ b/exercises/es/exc_02_13.py @@ -1,21 +1,21 @@ import spacy from spacy.matcher import Matcher -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") doc = nlp( - "Twitch Prime, the perks program for Amazon Prime members offering free " - "loot, games and other benefits, is ditching one of its best features: " - "ad-free viewing. According to an email sent out to Amazon Prime members " - "today, ad-free viewing will no longer be included as a part of Twitch " - "Prime for new members, beginning on September 14. However, members with " - "existing annual subscriptions will be able to continue to enjoy ad-free " - "viewing until their subscription comes up for renewal. Those with " - "monthly subscriptions will have access to ad-free viewing until October 15." + "Cuando Pac-Man debutó en Tokio, en 1980, nadie podría haber predicho " + "que se convertiría en el videojuego más exitoso de todos los tiempos. Hoy, " + "40 años después, aun sigue sorprendiendo. Su desarrolladora, Bandai Namco, " + "ha anunciado novedades en el marco del aniversario del juego. La celebración " + "del 40 aniversario de Pac-man en 2020 incluirá el début de una nueva canción " + "temática, compuesta por el famoso artista japonés de Techno Ken Ishii. " + "Además de estas novedades, Bandai Namco publicará nuevas versiones del videojuego." + "La primera será Pac-Man Live Studio, en Twitch, en colaboración con Amazon Games." ) # Crea los patrones -pattern1 = [{"LOWER": "Amazon"}, {"IS_TITLE": True, "POS": "PROPN"}] -pattern2 = [{"LOWER": "ad-free"}, {"POS": "NOUN"}] +pattern1 = [{"LOWER": "Bandai"}, {"IS_TITLE": True, "POS": "PROPN"}] +pattern2 = [{"LOWER": "Pac-Man"}, {"POS": "NOUN"}] # Inicializa el Matcher y añade los patrones matcher = Matcher(nlp.vocab) diff --git a/exercises/es/exc_02_14.py b/exercises/es/exc_02_14.py index f4c05bb6b..ad1c89fa8 100644 --- a/exercises/es/exc_02_14.py +++ b/exercises/es/exc_02_14.py @@ -1,11 +1,11 @@ import json -from spacy.lang.en import English +from spacy.lang.es import Spanish -with open("exercises/en/countries.json") as f: +with open("exercises/es/countries.json", encoding="utf8") as f: COUNTRIES = json.loads(f.read()) -nlp = English() -doc = nlp("Czech Republic may help Slovakia protect its airspace") +nlp = Spanish() +doc = nlp("La Unión Europea fue fundada por seis países de Europa occidental (Francia, Alemania, Italia, Bélgica, Países Bajos, y Luxemburgo) y se amplió en seis ocasiones.") # Importa el PhraseMatcher e inicialízalo from spacy.____ import ____ diff --git a/exercises/es/exc_02_15.py b/exercises/es/exc_02_15.py index 863b85580..4dedc7a6f 100644 --- a/exercises/es/exc_02_15.py +++ b/exercises/es/exc_02_15.py @@ -3,12 +3,12 @@ from spacy.tokens import Span import json -with open("exercises/en/countries.json") as f: +with open("exercises/es/countries.json", encoding="utf8") as f: COUNTRIES = json.loads(f.read()) -with open("exercises/en/country_text.txt") as f: +with open("exercises/es/country_text.txt", encoding="utf8") as f: TEXT = f.read() -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") matcher = PhraseMatcher(nlp.vocab) patterns = list(nlp.pipe(COUNTRIES)) matcher.add("COUNTRY", None, *patterns) diff --git a/exercises/es/solution_02_02_01.py b/exercises/es/solution_02_02_01.py index 7c4d876e0..7212fc920 100644 --- a/exercises/es/solution_02_02_01.py +++ b/exercises/es/solution_02_02_01.py @@ -1,12 +1,12 @@ import spacy -nlp = spacy.load("en_core_web_sm") -doc = nlp("I have a cat") +nlp = spacy.load("es_core_news_sm") +doc = nlp("Yo tengo un gato") -# Busca el hash para la palabra "cat" -cat_hash = nlp.vocab.strings["cat"] -print(cat_hash) +# Busca el hash para la palabra "gato" +gato_hash = nlp.vocab.strings["gato"] +print(gato_hash) -# Busca el cat_hash para obtener el string -cat_string = nlp.vocab.strings[cat_hash] -print(cat_string) +# Busca el gato_hash para obtener el string +gato_string = nlp.vocab.strings[gato_hash] +print(gato_string) diff --git a/exercises/es/solution_02_02_02.py b/exercises/es/solution_02_02_02.py index 9f3de37dd..1a9e0fcb5 100644 --- a/exercises/es/solution_02_02_02.py +++ b/exercises/es/solution_02_02_02.py @@ -1,7 +1,7 @@ import spacy -nlp = spacy.load("en_core_web_sm") -doc = nlp("David Bowie is a PERSON") +nlp = spacy.load("es_core_news_sm") +doc = nlp("David Bowie tiene el label PERSON") # Busca el hash para el label del string "PERSON" person_hash = nlp.vocab.strings["PERSON"] diff --git a/exercises/es/solution_02_05_01.py b/exercises/es/solution_02_05_01.py index 8cbeef100..6518a9ab3 100644 --- a/exercises/es/solution_02_05_01.py +++ b/exercises/es/solution_02_05_01.py @@ -1,12 +1,12 @@ import spacy -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") # Importa la clase Doc from spacy.tokens import Doc -# El texto deseado: "spaCy is cool!" -words = ["spaCy", "is", "cool", "!"] +# El texto deseado: "spaCy es divertido!" +words = ["spaCy", "es", "divertido", "!"] spaces = [True, True, False, False] # Crea un Doc a partir de las palabras y los espacios diff --git a/exercises/es/solution_02_05_02.py b/exercises/es/solution_02_05_02.py index d3e9517e9..3ac3c53fa 100644 --- a/exercises/es/solution_02_05_02.py +++ b/exercises/es/solution_02_05_02.py @@ -1,13 +1,13 @@ import spacy -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") # Importa la clase Doc from spacy.tokens import Doc -# El texto deseado: "Go, get started!" -words = ["Go", ",", "get", "started", "!"] -spaces = [False, True, True, False, False] +# El texto deseado: "¡Vamos, empieza!" +words = ["¡", "Vamos", ",", "empieza", "!"] +spaces = [False, False, True, False, False] # Crea un Doc a partir de las palabras y los espacios doc = Doc(nlp.vocab, words=words, spaces=spaces) diff --git a/exercises/es/solution_02_05_03.py b/exercises/es/solution_02_05_03.py index 92bfdcb58..6c040b938 100644 --- a/exercises/es/solution_02_05_03.py +++ b/exercises/es/solution_02_05_03.py @@ -1,13 +1,13 @@ import spacy -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") # Importa la clase Doc from spacy.tokens import Doc -# El texto deseado: "Oh, really?!" -words = ["Oh", ",", "really", "?", "!"] -spaces = [False, True, False, False, False] +# El texto deseado: "¡¿En serio?!" +words = ["¡", "¿", "En", "serio", "?", "!"] +spaces = [False, False, True, False, False, False] # Crea un Doc a partir de las palabras y los espacios doc = Doc(nlp.vocab, words=words, spaces=spaces) diff --git a/exercises/es/solution_02_06.py b/exercises/es/solution_02_06.py index e7911500a..73659d9a3 100644 --- a/exercises/es/solution_02_06.py +++ b/exercises/es/solution_02_06.py @@ -1,11 +1,11 @@ -from spacy.lang.en import English +from spacy.lang.es import Spanish -nlp = English() +nlp = Spanish() # Importa las clases Doc y Span from spacy.tokens import Doc, Span -words = ["I", "like", "David", "Bowie"] +words = ["Me", "gusta", "David", "Bowie"] spaces = [True, True, True, False] # Crea un Doc a partir de las palabras y los espacios diff --git a/exercises/es/solution_02_07.py b/exercises/es/solution_02_07.py index 58c313995..6acc46710 100644 --- a/exercises/es/solution_02_07.py +++ b/exercises/es/solution_02_07.py @@ -1,7 +1,7 @@ import spacy -nlp = spacy.load("en_core_web_sm") -doc = nlp("Berlin is a nice city") +nlp = spacy.load("es_core_news_sm") +doc = nlp("Por Berlín fluye el río Esprea.") # Itera sobre los tokens for token in doc: @@ -9,4 +9,4 @@ if token.pos_ == "PROPN": # Revisa si el siguiente token es un verbo if doc[token.i + 1].pos_ == "VERB": - print("Found proper noun before a verb:", token.text) + print("Encontré un nombre propio antes de un verbo:", token.text) diff --git a/exercises/es/solution_02_09.py b/exercises/es/solution_02_09.py index cf05961c4..557e2af30 100644 --- a/exercises/es/solution_02_09.py +++ b/exercises/es/solution_02_09.py @@ -1,11 +1,11 @@ import spacy -# Carga el modelo en_core_web_md -nlp = spacy.load("en_core_web_md") +# Carga el modelo es_core_news_md +nlp = spacy.load("es_core_news_md") # Procesa un texto -doc = nlp("Two bananas in pyjamas") +doc = nlp("Hoy hice pan de banano") -# Obtén el vector para el token "bananas" -bananas_vector = doc[1].vector -print(bananas_vector) +# Obtén el vector para el token "banano" +banano_vector = doc[4].vector +print(banano_vector) diff --git a/exercises/es/solution_02_10_01.py b/exercises/es/solution_02_10_01.py index d80a85a43..9d31c12c5 100644 --- a/exercises/es/solution_02_10_01.py +++ b/exercises/es/solution_02_10_01.py @@ -1,9 +1,9 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc1 = nlp("It's a warm summer day") -doc2 = nlp("It's sunny outside") +doc1 = nlp("Es un cálido día de verano") +doc2 = nlp("Hace sol afuera") # Obtén la similitud entre el doc1 y el doc2 similarity = doc1.similarity(doc2) diff --git a/exercises/es/solution_02_10_02.py b/exercises/es/solution_02_10_02.py index de7dc446c..1d275e143 100644 --- a/exercises/es/solution_02_10_02.py +++ b/exercises/es/solution_02_10_02.py @@ -1,10 +1,10 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc = nlp("TV and books") +doc = nlp("TV y libros") token1, token2 = doc[0], doc[2] -# Obtén la similitud entre los tokens "TV" y "books" +# Obtén la similitud entre los tokens "TV" y "libros" similarity = token1.similarity(token2) print(similarity) diff --git a/exercises/es/solution_02_10_03.py b/exercises/es/solution_02_10_03.py index 0a904ec53..245b0edf3 100644 --- a/exercises/es/solution_02_10_03.py +++ b/exercises/es/solution_02_10_03.py @@ -1,12 +1,12 @@ import spacy -nlp = spacy.load("en_core_web_md") +nlp = spacy.load("es_core_news_md") -doc = nlp("This was a great restaurant. Afterwards, we went to a really nice bar.") +doc = nlp("Estuvimos en un restaurante genial. Luego, fuimos a un bar muy divertido.") -# Crea los spans para "great restaurant" y "really nice bar" +# Crea los spans para "restaurante genial" y "bar muy divertido" span1 = doc[3:5] -span2 = doc[12:15] +span2 = doc[11:14] # Obtén la similitud entre los dos spans similarity = span1.similarity(span2) diff --git a/exercises/es/solution_02_13.py b/exercises/es/solution_02_13.py index 5c8a73b2e..1efdb5d42 100644 --- a/exercises/es/solution_02_13.py +++ b/exercises/es/solution_02_13.py @@ -1,21 +1,21 @@ import spacy from spacy.matcher import Matcher -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") doc = nlp( - "Twitch Prime, the perks program for Amazon Prime members offering free " - "loot, games and other benefits, is ditching one of its best features: " - "ad-free viewing. According to an email sent out to Amazon Prime members " - "today, ad-free viewing will no longer be included as a part of Twitch " - "Prime for new members, beginning on September 14. However, members with " - "existing annual subscriptions will be able to continue to enjoy ad-free " - "viewing until their subscription comes up for renewal. Those with " - "monthly subscriptions will have access to ad-free viewing until October 15." + "Cuando Pac-Man debutó en Tokio, en 1980, nadie podría haber predicho " + "que se convertiría en el videojuego más exitoso de todos los tiempos. Hoy, " + "40 años después, aun sigue sorprendiendo. Su desarrolladora, Bandai Namco, " + "ha anunciado novedades en el marco del aniversario del juego. La celebración " + "del 40 aniversario de Pac-man en 2020 incluirá el début de una nueva canción " + "temática, compuesta por el famoso artista japonés de Techno Ken Ishii. " + "Además de estas novedades, Bandai Namco publicará nuevas versiones del videojuego." + "La primera será Pac-Man Live Studio, en Twitch, en colaboración con Amazon Games." ) # Crea los patrones -pattern1 = [{"LOWER": "amazon"}, {"IS_TITLE": True, "POS": "PROPN"}] -pattern2 = [{"LOWER": "ad"}, {"TEXT": "-"}, {"LOWER": "free"}, {"POS": "NOUN"}] +pattern1 = [{"LOWER": "bandai"}, {"IS_TITLE": True, "POS": "PROPN"}] +pattern2 = [{"LOWER": "pac"}, {"TEXT": "-"}, {"LOWER": "man"}, {"POS": "PROPN", "OP": "*"}] # Inicializa el Matcher y añade los patrones matcher = Matcher(nlp.vocab) diff --git a/exercises/es/solution_02_14.py b/exercises/es/solution_02_14.py index 00f8b6aa6..ee9e2ef78 100644 --- a/exercises/es/solution_02_14.py +++ b/exercises/es/solution_02_14.py @@ -1,11 +1,11 @@ import json -from spacy.lang.en import English +from spacy.lang.es import Spanish -with open("exercises/en/countries.json") as f: +with open("exercises/es/countries.json", encoding="utf8") as f: COUNTRIES = json.loads(f.read()) -nlp = English() -doc = nlp("Czech Republic may help Slovakia protect its airspace") +nlp = Spanish() +doc = nlp("La Unión Europea fue fundada por seis países de Europa occidental (Francia, Alemania, Italia, Bélgica, Países Bajos, y Luxemburgo) y se amplió en seis ocasiones.") # Importa el PhraseMatcher e inicialízalo from spacy.matcher import PhraseMatcher diff --git a/exercises/es/solution_02_15.py b/exercises/es/solution_02_15.py index a999fb688..701650b06 100644 --- a/exercises/es/solution_02_15.py +++ b/exercises/es/solution_02_15.py @@ -3,12 +3,12 @@ from spacy.tokens import Span import json -with open("exercises/en/countries.json") as f: +with open("exercises/es/countries.json", encoding="utf8") as f: COUNTRIES = json.loads(f.read()) -with open("exercises/en/country_text.txt") as f: +with open("exercises/es/country_text.txt", encoding="utf8") as f: TEXT = f.read() -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("es_core_news_sm") matcher = PhraseMatcher(nlp.vocab) patterns = list(nlp.pipe(COUNTRIES)) matcher.add("COUNTRY", None, *patterns) @@ -31,4 +31,4 @@ print(span_root_head.text, "-->", span.text) # Imprime en pantalla las entidades del documento -print([(ent.text, ent.label_) for ent in doc.ents if ent.label_ == "GPE"]) +print([(ent.text, ent.label_) for ent in doc.ents if ent.label_ == "GPE"]) \ No newline at end of file diff --git a/exercises/es/test_02_02_01.py b/exercises/es/test_02_02_01.py index f7b585458..7afd6e357 100644 --- a/exercises/es/test_02_02_01.py +++ b/exercises/es/test_02_02_01.py @@ -1,9 +1,9 @@ def test(): - assert cat_hash == nlp.vocab.strings["cat"], "¿Asignaste el hash correcto?" - assert 'nlp.vocab.strings["cat"]' in __solution__ - assert cat_string == "cat", "¿Obtuviste el string correcto?" + assert gato_hash == nlp.vocab.strings["gato"], "¿Asignaste el hash correcto?" + assert 'nlp.vocab.strings["gato"]' in __solution__ + assert gato_string == "gato", "¿Obtuviste el string correcto?" assert ( - "nlp.vocab.strings[cat_hash]" in __solution__ + "nlp.vocab.strings[gato_hash]" in __solution__ ), "¿Obtuviste el string usando el hash?" __msg__.good("¡Muy buen trabajo!") diff --git a/exercises/es/test_02_05_01.py b/exercises/es/test_02_05_01.py index 415bf7338..e93d50bb4 100644 --- a/exercises/es/test_02_05_01.py +++ b/exercises/es/test_02_05_01.py @@ -2,6 +2,6 @@ def test(): assert ( "from spacy.tokens import Doc" in __solution__ ), "¿Estás importando la clase Doc correctamente?" - assert doc.text == "spaCy is cool!", "¿Creaste el Doc correctamente?" + assert doc.text == "spaCy es divertido!", "¿Creaste el Doc correctamente?" assert "print(doc.text)" in __solution__, "¿Estás imprimiendo en pantalla el texto del Doc?" __msg__.good("¡Bien hecho!") diff --git a/exercises/es/test_02_05_02.py b/exercises/es/test_02_05_02.py index f6d4607b6..87721dc83 100644 --- a/exercises/es/test_02_05_02.py +++ b/exercises/es/test_02_05_02.py @@ -6,6 +6,6 @@ def test(): len(spaces) == 5 ), "Parece que el número de espacios no concuerda con el número de palabras." assert all(isinstance(s, bool) for s in spaces), "Los espacios tienen que ser booleanos." - assert [int(s) for s in spaces] == [0, 1, 1, 0, 0], "¿Están correctos los espacios?" - assert doc.text == "Go, get started!", "¿Creaste el Doc correctamente?" + assert [int(s) for s in spaces] == [0, 0, 1, 0, 0], "¿Están correctos los espacios?" + assert doc.text == "¡Vamos, empieza!", "¿Creaste el Doc correctamente?" __msg__.good("¡Bien!") diff --git a/exercises/es/test_02_05_03.py b/exercises/es/test_02_05_03.py index 394eec672..bc9645f4f 100644 --- a/exercises/es/test_02_05_03.py +++ b/exercises/es/test_02_05_03.py @@ -2,10 +2,10 @@ def test(): assert ( "from spacy.tokens import Doc" in __solution__ ), "¿Estás importando la clase Doc correctamente?" - assert len(words) == 5, "Parece que tienes el número incorrecto de palabras." - assert len(spaces) == 5, "Parece que tienes el número incorrecto de espacios." - assert words == ["Oh", ",", "really", "?", "!"], "¡Chequea otra vez las palabras!" + assert len(words) == 6, "Parece que tienes el número incorrecto de palabras." + assert len(spaces) == 6, "Parece que tienes el número incorrecto de espacios." + assert words == ["¡", "¿", "En","serio", "?", "!"], "¡Chequea otra vez las palabras!" assert all(isinstance(s, bool) for s in spaces), "Los espacios tienen que ser booleanos." - assert [int(s) for s in spaces] == [0, 1, 0, 0, 0], "¿Están los espacios correctos?" - assert doc.text == "Oh, really?!", "¿Creaste el Doc correctamente?" + assert [int(s) for s in spaces] == [0, 0, 1, 0, 0, 0], "¿Están los espacios correctos?" + assert doc.text == "¡¿En serio?!", "¿Creaste el Doc correctamente?" __msg__.good("¡Buen trabajo! A continuación, creemos algunas entidades.") diff --git a/exercises/es/test_02_06.py b/exercises/es/test_02_06.py index d6b17abfa..a0c210671 100644 --- a/exercises/es/test_02_06.py +++ b/exercises/es/test_02_06.py @@ -2,7 +2,7 @@ def test(): assert ( "import Doc, Span" or "import Span, Doc" in __solution__ ), "¿Importaste el Doc y el Span correctamente?" - assert doc.text == "I like David Bowie", "¿Creaste el Doc correctamente?" + assert doc.text == "Me gusta David Bowie", "¿Creaste el Doc correctamente?" assert span.text == "David Bowie", "¿Creaste el Span correctamente?" assert span.label_ == "PERSON", "¿Añadiste el label PERSON al span?" assert "doc.ents =" in __solution__, "¿Sobrescribiste las doc.ents?" diff --git a/exercises/es/test_02_09.py b/exercises/es/test_02_09.py index 9fd86d3f8..1e85884e1 100644 --- a/exercises/es/test_02_09.py +++ b/exercises/es/test_02_09.py @@ -1,8 +1,8 @@ def test(): assert ( - 'spacy.load("en_core_web_md")' in __solution__ + 'spacy.load("es_core_news_md")' in __solution__ ), "¿Estás cargando el modelo mediano correctamente?" - assert "doc[1].vector" in __solution__, "¿Estás obteniendo el vector correcto?" + assert "doc[4].vector" in __solution__, "¿Estás obteniendo el vector correcto?" __msg__.good( "¡Bien hecho! En el próximo ejercicio usarás a spaCy para predecir " "similitudes entre documentos, spans y tokens a través de los word vectors " diff --git a/exercises/es/test_02_10_03.py b/exercises/es/test_02_10_03.py index 480668e4d..9c8de0783 100644 --- a/exercises/es/test_02_10_03.py +++ b/exercises/es/test_02_10_03.py @@ -2,8 +2,8 @@ def test(): assert ( "span1.similarity(span2)" or "span1.similarity(span2)" in __solution__ ), "¿Estás comparando la similitud entre los dos spans?" - assert span1.text == "great restaurant", "¿Generaste correctamente el span1?" - assert span2.text == "really nice bar", "¿Generaste correctamente el span2?" + assert span1.text == "restaurante genial", "¿Generaste correctamente el span1?" + assert span2.text == "bar muy divertido", "¿Generaste correctamente el span2?" assert ( 0 <= float(similarity) <= 1 ), "El valor de la similitud debe ser de punto flotante. ¿Lo calculaste correctamente?" diff --git a/exercises/es/test_02_13.py b/exercises/es/test_02_13.py index 43ef29c8e..fa9e83cd4 100644 --- a/exercises/es/test_02_13.py +++ b/exercises/es/test_02_13.py @@ -10,7 +10,7 @@ def test(): len(pattern1[0]) == 1 ), "El primer token de pattern1 debería incluir un atributo." assert any( - pattern1[0].get(attr) == "amazon" for attr in ("lower", "LOWER") + pattern1[0].get(attr) == "bandai" for attr in ("lower", "LOWER") ), "Revisa el atributo y el valor del primer token en pattern1." assert ( len(pattern1[1]) == 2 @@ -24,15 +24,18 @@ def test(): # Pattern 2 validation assert any( - pattern2[0].get(attr) == "ad" for attr in ("lower", "LOWER") + pattern2[0].get(attr) == "pac" for attr in ("lower", "LOWER") ), "Revisa el atributo y el valor del primer token en pattern2." assert any( - pattern2[2].get(attr) == "free" for attr in ("lower", "LOWER") + pattern2[2].get(attr) == "man" for attr in ("lower", "LOWER") ), "Revisa el atributo y el valor del tercer token en pattern2." assert any( - pattern2[3].get(attr) == "NOUN" for attr in ("pos", "POS") + pattern2[3].get(attr) == "PROPN" for attr in ("pos", "POS") ), "Revisa el atributo y el valor del cuarto token en pattern2." - assert len(matcher(doc)) == 6, "Número incorrecto de resultados – esperaba 6." + assert any( + pattern2[3].get(attr) == "*" for attr in ("op", "OP") + ), "Revisa el atributo y el valor del cuarto token en pattern2." + assert len(matcher(doc)) == 7, "Número incorrecto de resultados – esperaba 7." __msg__.good( "¡Bien hecho! Para el token '-', puedes encontrarlo con los atributos " diff --git a/exercises/es/test_02_14.py b/exercises/es/test_02_14.py index fb2a1fa58..8727b5516 100644 --- a/exercises/es/test_02_14.py +++ b/exercises/es/test_02_14.py @@ -6,5 +6,5 @@ def test(): "PhraseMatcher(nlp.vocab)" in __solution__ ), "¿Inicializaste correctamente el PhraseMatcher?" assert "matcher(doc)" in __solution__, "¿Llamaste el matcher sobre el doc?" - assert len(matches) == 2, "Número incorrecto de resultados – esperaba 2." + assert len(matches) == 6, "Número incorrecto de resultados – esperaba 6." __msg__.good("¡Bien hecho! Usemos este matcher para añadir unas entidades personalizadas.") diff --git a/exercises/es/test_02_15.py b/exercises/es/test_02_15.py index 20ee4cf73..dd88d24de 100644 --- a/exercises/es/test_02_15.py +++ b/exercises/es/test_02_15.py @@ -9,7 +9,7 @@ def test(): "print(span_root_head.text" in __solution__ ), "¿Estás imprimiendo en pantalla el texto del head del token raíz del span?" ents = [ent for ent in doc.ents if ent.label_ == "GPE"] - assert len(ents) == 16, "Número incorrecto de resultados – esperaba 16." + assert len(ents) == 35, "Número incorrecto de resultados – esperaba 35." __msg__.good( "¡Bien hecho! Ahora que has practicado combinar predicciones con " "extracción de información basada en reglas, podemos continuar al capítulo 3, "