From 4f12979316fc7f1f4505eea5e6193f899a4cbfc0 Mon Sep 17 00:00:00 2001 From: Arandi Lopez Date: Tue, 20 Jun 2017 10:45:51 -0500 Subject: [PATCH] =?UTF-8?q?In=20spanish=20we=20still=20need=20to=20validat?= =?UTF-8?q?e=20=C3=B1=20char?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Str.php | 4 +++- src/dict/es.php | 11 ----------- tests/ProfaneValidatorTest.php | 12 ++++++++++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Str.php b/src/Str.php index fdf3e65..2838e4b 100644 --- a/src/Str.php +++ b/src/Str.php @@ -54,7 +54,9 @@ class Str 'ĸ'=>'k', 'כ'=>'k', 'Ķ'=>'k', 'К'=>'k', 'к'=>'k', 'ķ'=>'k', 'ך'=>'k', 'Ŀ'=>'l', 'ŀ'=>'l', 'Л'=>'l', 'ł'=>'l', 'ļ'=>'l', 'ĺ'=>'l', 'Ĺ'=>'l', 'Ļ'=>'l', 'л'=>'l', 'Ľ'=>'l', 'ľ'=>'l', 'ל'=>'l', 'מ'=>'m', 'М'=>'m', 'ם'=>'m', 'м'=>'m', - 'ñ'=>'n', 'н'=>'n', 'Ņ'=>'n', 'ן'=>'n', 'ŋ'=>'n', 'נ'=>'n', 'Н'=>'n', 'ń'=>'n', 'Ŋ'=>'n', 'ņ'=>'n', 'ʼn'=>'n', 'Ň'=>'n', 'ň'=>'n', + // 'ñ'=>'n', // for spanish cono != coño + 'н'=>'n', 'Ņ'=>'n', 'ן'=>'n', 'ŋ'=>'n', 'נ'=>'n', 'Н'=>'n', 'ń'=>'n', + 'Ŋ'=>'n', 'ņ'=>'n', 'ʼn'=>'n', 'Ň'=>'n', 'ň'=>'n', 'о'=>'o', 'О'=>'o', 'ő'=>'o', 'õ'=>'o', 'ô'=>'o', 'Ő'=>'o', 'ŏ'=>'o', 'Ŏ'=>'o', 'Ō'=>'o', 'ō'=>'o', 'ø'=>'o', 'ǿ'=>'o', 'ǒ'=>'o', 'ò'=>'o', 'Ǿ'=>'o', 'Ǒ'=>'o', 'ơ'=>'o', 'ó'=>'o', 'Ơ'=>'o', 'œ'=>'oe', 'Œ'=>'oe', 'ö'=>'oe', 'פ'=>'p', 'ף'=>'p', 'п'=>'p', 'П'=>'p', 'ק'=>'q', diff --git a/src/dict/es.php b/src/dict/es.php index 9711fb9..a7f75a5 100644 --- a/src/dict/es.php +++ b/src/dict/es.php @@ -3,7 +3,6 @@ return [ 'bollera', 'cabron', - 'cabrón', 'cabrona', 'cabronazo', 'capulla', @@ -19,10 +18,8 @@ return [ 'chingado', 'chocho', 'cojon', - 'cojón', 'cojones', 'comepollas', - // 'cono', 'coño', 'culero', 'culera', @@ -39,15 +36,12 @@ return [ 'hostia', 'joder', 'jodete', - 'jódete', 'joputa', 'mamada', 'mamon', - 'mamón', 'mamona', 'marica', 'maricon', - 'maricón', 'maricona', 'mariconazo', 'nazi', @@ -55,7 +49,6 @@ return [ 'ostia', 'pajillero', 'pendon', - 'pendón', 'pendejo', 'pendejos', 'pendeja', @@ -66,22 +59,18 @@ return [ 'pedorra', 'pedorro', 'pedorron', - 'pedorrón', 'picha', 'pito', 'pelana', 'polla', 'pollon', - 'pollón', 'polvo', 'potorro', 'puta', 'puto', 'putona', 'puton', - 'putón', 'tortillera', 'weputa', 'zorron', - 'zorrón' ]; diff --git a/tests/ProfaneValidatorTest.php b/tests/ProfaneValidatorTest.php index 43477a2..63ce3d1 100644 --- a/tests/ProfaneValidatorTest.php +++ b/tests/ProfaneValidatorTest.php @@ -136,6 +136,18 @@ class ProfaneValidatorTest extends PHPUnit_Framework_TestCase $this->assertTrue( $profane->isProfane($word) ); } + public function test_enie_in_spanish_is_evaluated() + { + $this->mockConfigs(); + + $profane = new ProfaneValidator(); + $profane->setDictionary('es'); + + $word = "coño"; + + $this->assertTrue( $profane->isProfane($word) ); + } + private function mockConfigs() { Config::shouldReceive('get')