Skip to content

Commit 0ef36ad

Browse files
committed
retain a copy of the original string
1 parent 00f3d35 commit 0ef36ad

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

nameparser/parser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,20 @@ class HumanName(object):
4848
"""
4949

5050
has_own_config = False
51-
"""True if this instance is not using the shared module-level configuration."""
51+
"""True if this instance is not using the shared module-level configuration. Read only."""
5252

5353
C = CONSTANTS
5454
"""
5555
A reference to the configuration for this instance, which may or may not be a
56-
reference to the module-wide instance at :py:mod:`~nameparser.config.CONSTANTS`.
56+
reference to the shared, module-wide instance at :py:mod:`~nameparser.config.CONSTANTS`.
5757
See `Customizing the Parser <customize.html>`_.
5858
"""
5959

60+
original = ''
61+
"""
62+
The original string, untouched by the parser.
63+
"""
64+
6065
count = 0
6166
_members = ['title','first','middle','last','suffix','nickname']
6267
unparsable = True
@@ -73,6 +78,7 @@ def __init__(self, full_name="", constants=CONSTANTS, encoding=ENCODING,
7378

7479
self.ENCODING = encoding
7580
self.string_format = string_format
81+
self.original = full_name
7682
self.full_name = full_name
7783

7884
def __iter__(self):

0 commit comments

Comments
 (0)