You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every Bengali honorific is currently read as the given name, shifting the rest of the name one position right:
>>>fromnameparserimportparse>>>n=parse("ড. মুহাম্মদ ইউনূস") # Dr. Muhammad Yunus>>>n.title, n.given, n.middle, n.family
('', 'ড.', 'মুহাম্মদ', 'ইউনূস')
This is new coverage, not a regression — no Bengali support has ever been claimed. docs/locales.rst:17 lists the default vocabulary as "Latin, Cyrillic, Greek, Arabic and Hebrew, plus Devanagari titles"; Bengali appears nowhere. A repo-wide sweep finds zero codepoints in U+0980–U+09FF across nameparser/, tests/ and docs/.
Why the Latin fallbacks can't rescue it
Unknown Latin honorifics usually survive on one of two heuristics. Neither can fire for Bengali or Devanagari, and the reason is structural rather than incidental:
_PERIOD_ABBREV (nameparser/_pipeline/_assign.py:49, ^[^\W\d_]{2,}\.$) promotes a leading abbreviation to a title — this is what makes Smt. and even Xyz. parse as titles. It requires a contiguous run of 2+ letter-category codepoints. Abugidas interleave combining marks (Mn/Mc) between letters, and a mark breaks the run. প্রফেসর. has five letters and still fails, because ্ at position 2 ends the run at length 1.
period_joined_vocab (nameparser/_pipeline/_vocab.py:181) needs an interior period (Lt.Gov.). Honorifics have a trailing one.
On top of that, single-letter abbreviations are actively claimed by something else: ড. matches is_initial (^(\w\.|[A-Z])$ — \w matches Bengali), so it is read as a given-name initial. That reading is correct for real Bengali initials (র. কে. নারায়ণ parses right today) — it just wins here because no vocabulary contests it.
So vocabulary is the only available route. Devanagari is in the same position and escapes only because #269 supplied it: डॉ. fails _PERIOD_ABBREV for exactly the same reason, and is rescued purely by the 'डॉ' entry.
Proposal
Two classes, matching the existing TITLES / FIRST_NAME_TITLES split. Both mirror the #269 Devanagari block (nameparser/config/titles.py:769) and its reasoning that native-script forms are safe where Latin transliterations are not.
Civil honorifics — TITLES only. A single following name reads as a family name, the way Dr. does.
entry
gloss
ড
Dr. (abbrev; matches ড. via edge-period normalization)
ডঃ
Dr. (visarga spelling)
ডক্টর
Doctor (full)
শ্রী
Shri (Mr.)
শ্রীমতী
Shrimati (Mrs.)
জনাব
Janab (Mr.)
অধ্যাপক
Professor
প্রফেসর
Professor (borrowed)
Renunciate honorifics — TITLESandFIRST_NAME_TITLES. Renunciation abolishes the family name, so the single following name is a religious given name, not a surname. This is the Sister Mary / Pope Francis class, and family='' is the correct answer rather than a degraded one.
entry
gloss
স্বামী
Swami (Ramakrishna Order and general monastic)
শ্রীল
Srila (Gaudiya Vaishnava, e.g. শ্রীল প্রভুপাদ)
স্বামী is the notable one: Vivekananda was Bengali, so স্বামী বিবেকানন্দ is the native spelling of the case that motivates this whole distinction.
No Latin twins, for the #269 reason: shri/sri collide with real given names (Sri Mulyani), the native-script forms cannot. Latin transliterations belong in an opt-in hi/bn pack — #345.
Deliberately excluded
ঠাকুর (Thakur) — do not add. It is a genuine honorific (lord/master) and it is Tagore, one of the best-known Bengali surnames. Adding it would do to রবীন্দ্রনাথ ঠাকুর what rai does to Aishwarya Rai in Rai is parsed as a post-nominal suffix, consuming a common South Asian surname #342. Recorded here so it is not picked up later from a wordlist.
শ্রীমৎ (Srimat) — plausible but unverified frequency; wants a real check before inclusion.
Verified at 2.1.0
All cases fix, with no regression to Bengali initials or to Tagore:
input
today
with proposal
ড. মুহাম্মদ ইউনূস
given=ড. ❌
title=ড., given=মুহাম্মদ, family=ইউনূস ✅
ডঃ মুহাম্মদ ইউনূস
given=ডঃ ❌
title=ডঃ ✅
শ্রী অমর্ত্য সেন
given=শ্রী ❌
title=শ্রী, given=অমর্ত্য, family=সেন ✅
শ্রীমতী মমতা ব্যানার্জী
given=শ্রীমতী ❌
title=শ্রীমতী ✅
জনাব আবুল কালাম
given=জনাব ❌
title=জনাব ✅
অধ্যাপক আনিসুজ্জামান
given=অধ্যাপক ❌
title=অধ্যাপক, family=আনিসুজ্জামান ✅
স্বামী বিবেকানন্দ
given=স্বামী, family=বিবেকানন্দ ❌
title=স্বামী, given=বিবেকানন্দ, family='' ✅
শ্রীল প্রভুপাদ
given=শ্রীল ❌
title=শ্রীল, given=প্রভুপাদ ✅
শ্রী সেন
given=শ্রী ❌
title=শ্রী, family=সেন ✅ (civil, contrast above)
র. কে. নারায়ণ
given=র., middle=কে., family=নারায়ণ ✅
unchanged ✅
সত্যজিৎ রায়
given=সত্যজিৎ, family=রায় ✅
unchanged ✅
রবীন্দ্রনাথ ঠাকুর
given=রবীন্দ্রনাথ, family=ঠাকুর ✅
unchanged ✅
The শ্রী সেন / স্বামী বিবেকানন্দ pair is the point of the two-class split: same shape, opposite correct answers. Note the split only affects the title-plus-ONE-name case — স্বামী বিবেকানন্দ সরস্বতী is unaffected.
Open questions — decide before including
বেগম (Begum) — an honorific, but also appears as a name component in Bangladeshi usage, unlike শ্রী, which only occurs bound inside compounds (শ্রীকান্ত) and so cannot collide at token level. Same shape as the deferrals Provide constants in non-Latin scripts (Cyrillic, Greek, Arabic, Hebrew) #269 recorded for bare רב and בר.
মোঃ/মো. (Md.) — prefixes a large share of Bangladeshi male names, but reads more like a bound given-name element (Md. Abdul Karim) than a title, so BOUND_FIRST_NAMES may be the right home rather than TITLES. Worth its own analysis.
Implementation note
Three places enumerate which scripts the default vocabulary covers and will go stale otherwise:
Every Bengali honorific is currently read as the given name, shifting the rest of the name one position right:
This is new coverage, not a regression — no Bengali support has ever been claimed.
docs/locales.rst:17lists the default vocabulary as "Latin, Cyrillic, Greek, Arabic and Hebrew, plus Devanagari titles"; Bengali appears nowhere. A repo-wide sweep finds zero codepoints in U+0980–U+09FF acrossnameparser/,tests/anddocs/.Why the Latin fallbacks can't rescue it
Unknown Latin honorifics usually survive on one of two heuristics. Neither can fire for Bengali or Devanagari, and the reason is structural rather than incidental:
_PERIOD_ABBREV(nameparser/_pipeline/_assign.py:49,^[^\W\d_]{2,}\.$) promotes a leading abbreviation to a title — this is what makesSmt.and evenXyz.parse as titles. It requires a contiguous run of 2+ letter-category codepoints. Abugidas interleave combining marks (Mn/Mc) between letters, and a mark breaks the run.প্রফেসর.has five letters and still fails, because্at position 2 ends the run at length 1.period_joined_vocab(nameparser/_pipeline/_vocab.py:181) needs an interior period (Lt.Gov.). Honorifics have a trailing one.On top of that, single-letter abbreviations are actively claimed by something else:
ড.matchesis_initial(^(\w\.|[A-Z])$—\wmatches Bengali), so it is read as a given-name initial. That reading is correct for real Bengali initials (র. কে. নারায়ণparses right today) — it just wins here because no vocabulary contests it.So vocabulary is the only available route. Devanagari is in the same position and escapes only because #269 supplied it:
डॉ.fails_PERIOD_ABBREVfor exactly the same reason, and is rescued purely by the'डॉ'entry.Proposal
Two classes, matching the existing
TITLES/FIRST_NAME_TITLESsplit. Both mirror the #269 Devanagari block (nameparser/config/titles.py:769) and its reasoning that native-script forms are safe where Latin transliterations are not.Civil honorifics —
TITLESonly. A single following name reads as a family name, the wayDr.does.ডড.via edge-period normalization)ডঃডক্টরশ্রীশ্রীমতীজনাবঅধ্যাপকপ্রফেসরRenunciate honorifics —
TITLESandFIRST_NAME_TITLES. Renunciation abolishes the family name, so the single following name is a religious given name, not a surname. This is theSister Mary/Pope Francisclass, andfamily=''is the correct answer rather than a degraded one.স্বামীশ্রীলস্বামীis the notable one: Vivekananda was Bengali, soস্বামী বিবেকানন্দis the native spelling of the case that motivates this whole distinction.No Latin twins, for the #269 reason:
shri/sricollide with real given names (Sri Mulyani), the native-script forms cannot. Latin transliterations belong in an opt-inhi/bnpack — #345.Deliberately excluded
ঠাকুর(Thakur) — do not add. It is a genuine honorific (lord/master) and it is Tagore, one of the best-known Bengali surnames. Adding it would do toরবীন্দ্রনাথ ঠাকুরwhatraidoes toAishwarya RaiinRaiis parsed as a post-nominal suffix, consuming a common South Asian surname #342. Recorded here so it is not picked up later from a wordlist.গুরু,বাবা— the Bengali spellings of entries Add the remaining Devanagari honorifics and theजीsuffix #344 already proposes, whose Latin twins already ship. Decide theTITLESvsFIRST_NAME_TITLESclass once in Add the remaining Devanagari honorifics and theजीsuffix #344 and apply it to both scripts; deciding it twice invites drift.মহারাজ(Maharaj) — a trailing honorific for monastics (স্বামী X মহারাজ), so it is a suffix question parallel toजीin Add the remaining Devanagari honorifics and theजीsuffix #344, not a title question.শ্রীমৎ(Srimat) — plausible but unverified frequency; wants a real check before inclusion.Verified at 2.1.0
All cases fix, with no regression to Bengali initials or to Tagore:
ড. মুহাম্মদ ইউনূসড.❌ড., given=মুহাম্মদ, family=ইউনূস✅ডঃ মুহাম্মদ ইউনূসডঃ❌ডঃ✅শ্রী অমর্ত্য সেনশ্রী❌শ্রী, given=অমর্ত্য, family=সেন✅শ্রীমতী মমতা ব্যানার্জীশ্রীমতী❌শ্রীমতী✅জনাব আবুল কালামজনাব❌জনাব✅অধ্যাপক আনিসুজ্জামানঅধ্যাপক❌অধ্যাপক, family=আনিসুজ্জামান✅স্বামী বিবেকানন্দস্বামী, family=বিবেকানন্দ❌স্বামী, given=বিবেকানন্দ, family=''✅শ্রীল প্রভুপাদশ্রীল❌শ্রীল, given=প্রভুপাদ✅শ্রী সেনশ্রী❌শ্রী, family=সেন✅ (civil, contrast above)র. কে. নারায়ণর., middle=কে., family=নারায়ণ✅সত্যজিৎ রায়সত্যজিৎ, family=রায়✅রবীন্দ্রনাথ ঠাকুররবীন্দ্রনাথ, family=ঠাকুর✅The
শ্রী সেন/স্বামী বিবেকানন্দpair is the point of the two-class split: same shape, opposite correct answers. Note the split only affects the title-plus-ONE-name case —স্বামী বিবেকানন্দ সরস্বতীis unaffected.Open questions — decide before including
বেগম(Begum) — an honorific, but also appears as a name component in Bangladeshi usage, unlikeশ্রী, which only occurs bound inside compounds (শ্রীকান্ত) and so cannot collide at token level. Same shape as the deferrals Provide constants in non-Latin scripts (Cyrillic, Greek, Arabic, Hebrew) #269 recorded for bareרבandבר.মোঃ/মো.(Md.) — prefixes a large share of Bangladeshi male names, but reads more like a bound given-name element (Md. Abdul Karim) than a title, soBOUND_FIRST_NAMESmay be the right home rather thanTITLES. Worth its own analysis.Implementation note
Three places enumerate which scripts the default vocabulary covers and will go stale otherwise:
docs/locales.rst:17— the "five scripts" sentencetests/v2/test_locales.py:1003— the#269: non-Latin default vocabulary (Cyrillic, Greek, Arabic, Hebrew)section headernameparser/config/titles.py:769— the Devanagari block comment, whose "NO Latin twins on purpose" reasoning now covers Bengali too