Skip to content

Arabic comma (U+060C) is not recognized as a comma #265

Description

@derek73

The parser splits name formats on the ASCII comma only (parser.py, self._full_name.split(",")), so the "Lastname, Firstname" format is never detected when the input uses the Arabic comma ، (U+060C) — the standard comma in Arabic, Persian, and Urdu text. The character survives into the parsed output glued to a name piece.

>>> from nameparser import HumanName
>>> HumanName("سلمان، محمد")   # Arabic comma: expect first='محمد' last='سلمان'
<HumanName : [
    title: ''
    first: 'سلمان،'
    middle: ''
    last: 'محمد'
    ...
]>
>>> HumanName("سلمان, محمد")   # same input with ASCII comma parses correctly
<HumanName : [
    title: ''
    first: 'محمد'
    middle: ''
    last: 'سلمان'
    ...
]>

Two effects: the lastname-comma format detection fails (first/last are swapped), and the comma character pollutes the output value.

Possible approach: normalize comma variants to , during pre-processing, or split on a small set of comma characters. If treated as a set, it could live in config alongside the other constants; the fullwidth comma (U+FF0C, used in CJK text) would be a natural sibling to include.

Observed on v1.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions