File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,8 +401,11 @@ Correcting a parse
401401--------------------
402402
403403:class: `~nameparser.ParsedName ` is immutable, so a correction is a new
404- value: ``replace() `` returns a copy with the given fields changed and
405- everything else carried over.
404+ value: ``replace() `` returns a copy with the given fields changed.
405+ Untouched fields keep their tokens (and ``original `` is preserved),
406+ with one deliberate exception: an ambiguity that pointed into a
407+ replaced field is dropped — correcting the field that was flagged
408+ clears the flag, while correcting an unrelated field keeps it.
406409
407410.. doctest ::
408411
@@ -412,6 +415,11 @@ everything else carried over.
412415 'Dr. Juan de la Vega'
413416 >>> name.title
414417 ''
418+ >>> flagged = parse(" Van Buren" )
419+ >>> flagged.replace(given = " Martin" ).ambiguities
420+ ()
421+ >>> [a.kind.value for a in flagged.replace(family = " Harrison" ).ambiguities]
422+ ['particle-or-given']
415423
416424``replace() `` splits values on whitespace into plain, untagged
417425tokens — the vocabulary knowledge a parse would have about the new
You can’t perform that action at this time.
0 commit comments