diff --git a/README.rst b/README.rst index 6fa1273..39e1fde 100644 --- a/README.rst +++ b/README.rst @@ -69,13 +69,13 @@ Quick Start Example >>> name = HumanName("Dr. Juan Q. Xavier de la Vega III (Doc Vega)") >>> name >>> name.last 'de la Vega' @@ -99,13 +99,13 @@ and "post-nominal" would probably be better names.) >>> name = HumanName("1 & 2, 3 4 5, Mr.") >>> name Customization diff --git a/docs/customize.rst b/docs/customize.rst index caccf65..02e4068 100644 --- a/docs/customize.rst +++ b/docs/customize.rst @@ -348,13 +348,13 @@ constant so that "Hon" can be parsed as a first name. >>> hn = HumanName("Hon Solo") >>> hn >>> from nameparser.config import CONSTANTS >>> CONSTANTS.titles.remove('hon') @@ -362,13 +362,13 @@ constant so that "Hon" can be parsed as a first name. >>> hn = HumanName("Hon Solo") >>> hn @@ -403,13 +403,13 @@ making them lower case and removing periods. >>> hn = HumanName("Assoc Dean of Chemistry Robert Johns", constants=constants) >>> hn @@ -431,13 +431,13 @@ the config on one instance could modify the behavior of another instance. >>> other_instance = HumanName("Dean Robert Johns") >>> other_instance # Dean parses as title @@ -459,13 +459,13 @@ reference to the module-level config values with the behavior described above. >>> other_instance = HumanName("Dean Robert Johns", None) # <-- pass None for per-instance config >>> other_instance >>> other_instance.has_own_config True @@ -531,13 +531,13 @@ directly to the attribute. >>> hn.suffix = "Md." >>> hn.suffix diff --git a/docs/usage.rst b/docs/usage.rst index ecf2bff..b26c44f 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -34,23 +34,23 @@ Requires Python 3.10+. >>> name.full_name = "Juan Q. Xavier Velasquez y Garcia, Jr." >>> name >>> name.middle = "Jason Alexander" >>> name.middle 'Jason Alexander' >>> name >> name = HumanName('Jonathan "John" A. Smith') >>> name Exception: content that looks like a suffix (a member of @@ -161,13 +161,13 @@ written in parenthesis. >>> name = HumanName('Andrew Perkins (MBA)') >>> name A few suffix acronyms, listed in @@ -182,13 +182,13 @@ reading in that ambiguous context: >>> name = HumanName('JEFFREY (JD) BRICKEN') >>> name Leading Period-Abbreviation Titles @@ -208,13 +208,13 @@ word appearing after the first name is left as a middle name. >>> name = HumanName("Major. Dona Smith") >>> name >>> name = HumanName("J. Smith") >>> name.first diff --git a/nameparser/parser.py b/nameparser/parser.py index b10430a..cb88a84 100644 --- a/nameparser/parser.py +++ b/nameparser/parser.py @@ -209,13 +209,13 @@ def __repr__(self) -> str: _string = f"<{self.__class__.__name__} : [ Unparsable ] >" else: attrs = ( - f"\ttitle: {self.title or ''!r} \n" - f"\tfirst: {self.first or ''!r} \n" - f"\tmiddle: {self.middle or ''!r} \n" - f"\tlast: {self.last or ''!r} \n" - f"\tsuffix: {self.suffix or ''!r}\n" - f"\tnickname: {self.nickname or ''!r}\n" - f"\tmaiden: {self.maiden or ''!r}" + f" title: {self.title or ''!r}\n" + f" first: {self.first or ''!r}\n" + f" middle: {self.middle or ''!r}\n" + f" last: {self.last or ''!r}\n" + f" suffix: {self.suffix or ''!r}\n" + f" nickname: {self.nickname or ''!r}\n" + f" maiden: {self.maiden or ''!r}" ) _string = f"<{self.__class__.__name__} : [\n{attrs}\n]>" return _string