Skip to content

Commit 498c8f4

Browse files
alphabet: minor doc updates
1 parent 0cf51ad commit 498c8f4

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

src/alphabet.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,13 @@ letters is significant: it is the order used by :any:`letter` and
9494
thing.def(py::init<>(), R"pbdoc(
9595
:sig=(self: Alphabet, *, word: type) -> None:
9696
::only-document-once:
97-
Default constructor.
98-
This function constructs an empty alphabet.
97+
Create an empty alphabet.
98+
99+
This function creates an empty alphabet.
100+
101+
:Keyword Arguments:
102+
* **word** (*type*) -- the type of words to use. Must be either ``str`` or
103+
``list[int]``.
99104
100105
.. doctest:: python
101106
@@ -114,7 +119,7 @@ This function constructs an empty alphabet.
114119
Remove all letters.
115120
116121
This function clears the alphabet, putting it back into the state it would be in
117-
if it was newly constructed.
122+
if it was newly created.
118123
119124
:returns: ``self``.
120125
:rtype: Alphabet
@@ -132,9 +137,9 @@ if it was newly constructed.
132137
thing.def(py::init<native_word_type const&>(), R"pbdoc(
133138
:sig=(self: Alphabet, letters: str | list[int]) -> None:
134139
::only-document-once:
135-
Construct from letters.
140+
Create from letters.
136141
137-
Sets the alphabet to be the letters in *letters*.
142+
This function creates an alphabet with the letters in *letters*.
138143
139144
:param letters: the alphabet.
140145
:type letters: str | list[int]
@@ -185,9 +190,10 @@ This function sets the alphabet to be the letters in *letters*.
185190
:sig=(self: Alphabet, n: int, *, word: type) -> None:
186191
::only-document-once:
187192
188-
Construct the alphabet by size.
193+
Create an alphabet by size.
189194
190-
This function constructs an alphabet containing the first *n* human-readable letters.
195+
This function creates an alphabet containing the first *n* human-readable
196+
letters if the keyword argument *word* is ``str`` and the integers in the interval :math:`[0, n)` if *word* is ``list[int]``.
191197
192198
:param n: the size of the alphabet.
193199
:type n: int

0 commit comments

Comments
 (0)