Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 228f6e4

Browse files
committed
Fix up a few more consistency nits and incorrectly applied markup.
Further clarify the English-centricity of fix_sentence_endings.
1 parent 6ee7156 commit 228f6e4

1 file changed

Lines changed: 29 additions & 21 deletions

File tree

Doc/lib/libtextwrap.tex

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ \section{\module{textwrap} ---
6464
the constructor) are as follows:
6565

6666
\begin{memberdesc}{width}
67-
(default: 70) The maximum length of wrapped lines. As long as there are
68-
no individual words in the input text longer than \var{width},
69-
\class{TextWrapper} guarantees that no output line will be longer than
70-
\var{width} characters.
67+
(default: \code{70}) The maximum length of wrapped lines. As long as
68+
there are no individual words in the input text longer than
69+
\member{width}, \class{TextWrapper} guarantees that no output line
70+
will be longer than \member{width} characters.
7171
\end{memberdesc}
7272

7373
\begin{memberdesc}{expand_tabs}
@@ -77,11 +77,12 @@ \section{\module{textwrap} ---
7777
\end{memberdesc}
7878

7979
\begin{memberdesc}{replace_whitespace}
80-
(default: \code{True}) If true, each whitespace character (as defined by
81-
\var{string.whitespace}) remaining after tab expansion will be replaced
82-
by a single space. \note{If \var{expand_tabs} is false and
83-
\var{replace_whitespace} is true, each tab character will be replaced by
84-
a single space, which is \emph{not} the same as tab expansion.}
80+
(default: \code{True}) If true, each whitespace character (as defined
81+
by \code{string.whitespace}) remaining after tab expansion will be
82+
replaced by a single space. \note{If \member{expand_tabs} is false
83+
and \member{replace_whitespace} is true, each tab character will be
84+
replaced by a single space, which is \emph{not} the same as tab
85+
expansion.}
8586
\end{memberdesc}
8687

8788
\begin{memberdesc}{initial_indent}
@@ -106,35 +107,42 @@ \section{\module{textwrap} ---
106107
\character{"} or \character{'}, followed by a space. One problem
107108
with this is algorithm is that it is unable to detect the difference
108109
between ``Dr.'' in
110+
109111
\begin{verbatim}
110112
[...] Dr. Frankenstein's monster [...]
111113
\end{verbatim}
114+
112115
and ``Spot.'' in
116+
113117
\begin{verbatim}
114118
[...] See Spot. See Spot run [...]
115119
\end{verbatim}
116-
Furthermore, since it relies on \var{string.lowercase} for the
117-
definition of ``lowercase letter'', it is specific to English-language
118-
texts. Thus, \var{fix_sentence_endings} is false by default.
120+
121+
\member{fix_sentence_endings} is false by default.
122+
123+
Since the sentence detection algorithm relies on
124+
\code{string.lowercase} for the definition of ``lowercase letter,''
125+
and a convention of using two spaces after a period to separate
126+
sentences on the same line, it is specific to English-language texts.
119127
\end{memberdesc}
120128

121129
\begin{memberdesc}{break_long_words}
122130
(default: \code{True}) If true, then words longer than
123-
\var{width} will be broken in order to ensure that no lines are longer
124-
than \var{width}. If it is false, long words will not be broken, and
125-
some lines may be longer than
126-
\var{width}. (Long words will be put on a line by themselves, in order
127-
to minimize the amount by which \var{width} is exceeded.)
131+
\member{width} will be broken in order to ensure that no lines are
132+
longer than \member{width}. If it is false, long words will not be
133+
broken, and some lines may be longer than \member{width}. (Long words
134+
will be put on a line by themselves, in order to minimize the amount
135+
by which \member{width} is exceeded.)
128136
\end{memberdesc}
129137

130138
\class{TextWrapper} also provides two public methods, analogous to the
131139
module-level convenience functions:
132140

133141
\begin{methoddesc}{wrap}{text}
134-
Wraps the single paragraph in \var{text} (a string) so every line is at
135-
most \var{width} characters long. All wrapping options are taken from
136-
instance attributes of the \class{TextWrapper} instance. Returns a list
137-
of output lines, without final newlines.
142+
Wraps the single paragraph in \var{text} (a string) so every line is
143+
at most \member{width} characters long. All wrapping options are
144+
taken from instance attributes of the \class{TextWrapper} instance.
145+
Returns a list of output lines, without final newlines.
138146
\end{methoddesc}
139147

140148
\begin{methoddesc}{fill}{text}

0 commit comments

Comments
 (0)