Kaydet (Commit) 228f6e4e authored tarafından Fred Drake's avatar Fred Drake

Fix up a few more consistency nits and incorrectly applied markup.

Further clarify the English-centricity of fix_sentence_endings.
üst 6ee71569
...@@ -64,10 +64,10 @@ The \class{TextWrapper} instance attributes (and keyword arguments to ...@@ -64,10 +64,10 @@ The \class{TextWrapper} instance attributes (and keyword arguments to
the constructor) are as follows: the constructor) are as follows:
\begin{memberdesc}{width} \begin{memberdesc}{width}
(default: 70) The maximum length of wrapped lines. As long as there are (default: \code{70}) The maximum length of wrapped lines. As long as
no individual words in the input text longer than \var{width}, there are no individual words in the input text longer than
\class{TextWrapper} guarantees that no output line will be longer than \member{width}, \class{TextWrapper} guarantees that no output line
\var{width} characters. will be longer than \member{width} characters.
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}{expand_tabs} \begin{memberdesc}{expand_tabs}
...@@ -77,11 +77,12 @@ will be expanded to spaces using the \method{expand_tabs()} method of ...@@ -77,11 +77,12 @@ will be expanded to spaces using the \method{expand_tabs()} method of
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}{replace_whitespace} \begin{memberdesc}{replace_whitespace}
(default: \code{True}) If true, each whitespace character (as defined by (default: \code{True}) If true, each whitespace character (as defined
\var{string.whitespace}) remaining after tab expansion will be replaced by \code{string.whitespace}) remaining after tab expansion will be
by a single space. \note{If \var{expand_tabs} is false and replaced by a single space. \note{If \member{expand_tabs} is false
\var{replace_whitespace} is true, each tab character will be replaced by and \member{replace_whitespace} is true, each tab character will be
a single space, which is \emph{not} the same as tab expansion.} replaced by a single space, which is \emph{not} the same as tab
expansion.}
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}{initial_indent} \begin{memberdesc}{initial_indent}
...@@ -106,35 +107,42 @@ by one of \character{.}, ...@@ -106,35 +107,42 @@ by one of \character{.},
\character{"} or \character{'}, followed by a space. One problem \character{"} or \character{'}, followed by a space. One problem
with this is algorithm is that it is unable to detect the difference with this is algorithm is that it is unable to detect the difference
between ``Dr.'' in between ``Dr.'' in
\begin{verbatim} \begin{verbatim}
[...] Dr. Frankenstein's monster [...] [...] Dr. Frankenstein's monster [...]
\end{verbatim} \end{verbatim}
and ``Spot.'' in and ``Spot.'' in
\begin{verbatim} \begin{verbatim}
[...] See Spot. See Spot run [...] [...] See Spot. See Spot run [...]
\end{verbatim} \end{verbatim}
Furthermore, since it relies on \var{string.lowercase} for the
definition of ``lowercase letter'', it is specific to English-language \member{fix_sentence_endings} is false by default.
texts. Thus, \var{fix_sentence_endings} is false by default.
Since the sentence detection algorithm relies on
\code{string.lowercase} for the definition of ``lowercase letter,''
and a convention of using two spaces after a period to separate
sentences on the same line, it is specific to English-language texts.
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}{break_long_words} \begin{memberdesc}{break_long_words}
(default: \code{True}) If true, then words longer than (default: \code{True}) If true, then words longer than
\var{width} will be broken in order to ensure that no lines are longer \member{width} will be broken in order to ensure that no lines are
than \var{width}. If it is false, long words will not be broken, and longer than \member{width}. If it is false, long words will not be
some lines may be longer than broken, and some lines may be longer than \member{width}. (Long words
\var{width}. (Long words will be put on a line by themselves, in order will be put on a line by themselves, in order to minimize the amount
to minimize the amount by which \var{width} is exceeded.) by which \member{width} is exceeded.)
\end{memberdesc} \end{memberdesc}
\class{TextWrapper} also provides two public methods, analogous to the \class{TextWrapper} also provides two public methods, analogous to the
module-level convenience functions: module-level convenience functions:
\begin{methoddesc}{wrap}{text} \begin{methoddesc}{wrap}{text}
Wraps the single paragraph in \var{text} (a string) so every line is at Wraps the single paragraph in \var{text} (a string) so every line is
most \var{width} characters long. All wrapping options are taken from at most \member{width} characters long. All wrapping options are
instance attributes of the \class{TextWrapper} instance. Returns a list taken from instance attributes of the \class{TextWrapper} instance.
of output lines, without final newlines. Returns a list of output lines, without final newlines.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{fill}{text} \begin{methoddesc}{fill}{text}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment