Skip to content

Commit

Permalink
doc: misc refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Aug 7, 2024
1 parent dc5345c commit 4675049
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
19 changes: 2 additions & 17 deletions doc/techniques.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,8 @@ As shown below, this code outputs the data twice, the first time with the
de-duplicated keys and the second time using the original keys. Notice that the
first contains the duplication markers whereas the second does not.

.. code-block:: nestedtext
With de-duplicated keys:
Michael Jordan:
occupation: basketball player
Michael Jordan#2:
occupation: actor
Michael Jordan#3:
occupation: football player
With original keys:
Michael Jordan:
occupation: basketball player
Michael Jordan:
occupation: actor
Michael Jordan:
occupation: football player
.. literalinclude:: ../examples/deduplication/michael_jordan.out
:language: nestedtext


.. _sorting keys:
Expand Down
2 changes: 1 addition & 1 deletion examples/deduplication/michael_jordan
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def de_dup(key, state):
if key not in state:
state[key] = 1
state[key] += 1
return f"{key}#{state[key]}"
return f"{key} #{state[key]}"

try:
# read contacts database
Expand Down
4 changes: 2 additions & 2 deletions examples/deduplication/michael_jordan.out
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DE-DUPLICATED KEYS:
Michael Jordan:
occupation: basketball player
Michael Jordan#2:
Michael Jordan #2:
occupation: actor
Michael Jordan#3:
Michael Jordan #3:
occupation: football player

ORIGINAL KEYS:
Expand Down

0 comments on commit 4675049

Please sign in to comment.