From 69369765f8650bf2364d7a6d2e35fb97145bb34b Mon Sep 17 00:00:00 2001 From: Jorge Espinoza Date: Tue, 14 Apr 2020 17:33:12 -0400 Subject: [PATCH 1/5] Fix wrong plural I think "exercises" is about just one previous exercise. --- book/book.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/book.tex b/book/book.tex index 9e0368e..a74c4e0 100644 --- a/book/book.tex +++ b/book/book.tex @@ -10968,7 +10968,7 @@ \section{Data structures} Using Markov analysis to generate random text is fun, but there is also a point to this exercise: data structure selection. In your -solution to the previous exercises, you had to choose: +solution to the previous exercise, you had to choose: \begin{itemize} From f6f98c93c900681f60afdba770d6a1cc1a33c225 Mon Sep 17 00:00:00 2001 From: Jorge Espinoza Date: Thu, 16 Apr 2020 07:47:21 +0000 Subject: [PATCH 2/5] Remove unnecessary colon There is a figure on LaTeX code just next to the colon, but the document shows it elsewhere. It is a bit confusing. Also, the reference is enough. --- book/book.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/book.tex b/book/book.tex index a74c4e0..66d33de 100644 --- a/book/book.tex +++ b/book/book.tex @@ -9041,7 +9041,7 @@ \section{Memos} \index{function!fibonacci} To understand why, consider Figure~\ref{fig.fibonacci}, which shows -the {\bf call graph} for {\tt fibonacci} with {\tt n=4}: +the {\bf call graph} for {\tt fibonacci} with {\tt n=4}. \begin{figure} \centerline From 52c5bafdc8f8708696c4e4a4e5c8dfb3202dad10 Mon Sep 17 00:00:00 2001 From: Jorge Espinoza Date: Thu, 16 Apr 2020 07:51:56 +0000 Subject: [PATCH 3/5] Change inverse to inv Variable name 'inv' is what the state diagram shows, not 'inverse'. --- book/book.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/book.tex b/book/book.tex index 66d33de..ffb0ac8 100644 --- a/book/book.tex +++ b/book/book.tex @@ -8968,8 +8968,8 @@ \section{Dictionaries and lists} >>> hist = histogram('parrot') >>> hist {'a': 1, 'p': 1, 'r': 2, 't': 1, 'o': 1} ->>> inverse = invert_dict(hist) ->>> inverse +>>> inv = invert_dict(hist) +>>> inv {1: ['a', 'p', 't', 'o'], 2: ['r']} \end{verbatim} @@ -8980,7 +8980,7 @@ \section{Dictionaries and lists} \label{fig.dict1} \end{figure} -Figure~\ref{fig.dict1} is a state diagram showing {\tt hist} and {\tt inverse}. +Figure~\ref{fig.dict1} is a state diagram showing {\tt hist} and {\tt inv}. A dictionary is represented as a box with the type {\tt dict} above it and the key-value pairs inside. If the values are integers, floats or strings, I draw them inside the box, but I usually draw lists From 1ec3aab50d818f545c9cb312569ccb425045c65a Mon Sep 17 00:00:00 2001 From: Jorge Espinoza Date: Thu, 16 Apr 2020 10:00:53 +0000 Subject: [PATCH 4/5] Change "Chapter" to "Appendix" "Appendix B" is the name that I see on its pages, not "Chapter B". --- book/book.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/book.tex b/book/book.tex index ffb0ac8..06f6391 100644 --- a/book/book.tex +++ b/book/book.tex @@ -10367,7 +10367,7 @@ \chapter{Case study: data structure selection} At this point you have learned about Python's core data structures, and you have seen some of the algorithms that use them. If you would like to know more about algorithms, this might be a good -time to read Chapter~\ref{algorithms}. +time to read Appendix~\ref{algorithms}. But you don't have to read it before you go on; you can read it whenever you are interested. From c436d9904c4f1f2f88e211095f5f1f6affae2a69 Mon Sep 17 00:00:00 2001 From: Jorge Espinoza Date: Thu, 16 Apr 2020 10:24:56 +0000 Subject: [PATCH 5/5] Change order of tuple description "In each tuple, the frequency appears first", so they are not word-frequency tuples. --- book/book.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/book.tex b/book/book.tex index 06f6391..8ecc842 100644 --- a/book/book.tex +++ b/book/book.tex @@ -10637,7 +10637,7 @@ \section{Most common words} and sort it. The following function takes a histogram and returns a list of -word-frequency tuples: +frequency-word tuples: \begin{verbatim} def most_common(hist):