Skip to content

Commit 811ed9d

Browse files
committed
handle parsing some Portuguese prefixes (#72 & 71)
1 parent d329f38 commit 811ed9d

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

nameparser/config/prefixes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
'dello',
2020
'der',
2121
'di',
22-
'du',
2322
'dí',
23+
'do',
24+
'dos',
25+
'du',
2426
'ibn',
2527
'la',
2628
'le',

tests.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,19 @@ def test_name_is_conjunctions(self):
12481248
hn = HumanName("e and e")
12491249
self.m(hn.first, "e and e", hn)
12501250

1251+
def test_portuguese_dos(self):
1252+
hn = HumanName("Rafael Sousa dos Anjos")
1253+
self.m(hn.first, "Rafael", hn)
1254+
self.m(hn.middle, "Sousa", hn)
1255+
self.m(hn.last, "dos Anjos", hn)
1256+
1257+
def test_portuguese_prefixes(self):
1258+
hn = HumanName("Joao da Silva do Amaral de Souza")
1259+
self.m(hn.first, "Joao", hn)
1260+
self.m(hn.middle, "da Silva do Amaral de", hn)
1261+
self.m(hn.last, "Souza", hn)
1262+
1263+
12511264

12521265
class ConstantsCustomization(HumanNameTestBase):
12531266

0 commit comments

Comments
 (0)