From 32f2ef8ebfd28c05db972c6581629477ea1ef2fb Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Thu, 30 Apr 2026 12:11:19 +0100 Subject: [PATCH 1/9] presentation: minor doc fixes --- src/present.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/present.cpp b/src/present.cpp index 66e09ae2b..05fec05bc 100644 --- a/src/present.cpp +++ b/src/present.cpp @@ -107,7 +107,6 @@ Return the alphabet of the presentation. :rtype: :ref:`Word` :complexity: Constant. - )pbdoc"); thing.def( "alphabet", @@ -121,7 +120,7 @@ Set the alphabet by size. Sets the alphabet to the the first :math:`n` values with type :ref:`Letter`. For :any:`str`-types, we assume the -order of letters to be a-zA-Z0-9. +order of letters to be ``a-zA-Z0-9``. :param n: the size of the alphabet. :type n: int @@ -160,7 +159,7 @@ Sets the alphabet to be the letters in *lphbt*. .. seealso:: * :any:`throw_if_bad_rules` - * :any:throw_if_bad_alphabet_or_rules + * :any:`throw_if_bad_alphabet_or_rules` )pbdoc"); thing.def("alphabet_from_rules", @@ -178,7 +177,7 @@ Set the alphabet to be the letters in the rules. .. seealso:: * :any:`throw_if_bad_rules` - * :any:throw_if_bad_alphabet_or_rules + * :any:`throw_if_bad_alphabet_or_rules` )pbdoc"); thing.def( From 8b8f3b0105ef51e72be538c2ea16ef4b4889eb03 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 12:18:01 +0100 Subject: [PATCH 2/9] Fix presentation documentation issues --- src/present.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/present.cpp b/src/present.cpp index 05fec05bc..51ca7ecb9 100644 --- a/src/present.cpp +++ b/src/present.cpp @@ -655,7 +655,7 @@ such that ``!p.in_alphabet(letter(p, i))`` if such a letter exists. :type p: Presentation :returns: the letter. -:rtype: :ref:`Letter` +:rtype: :ref:`Letter` :raises LibsemigroupsError: if *p* already has an alphabet of the maximum possible size. @@ -679,7 +679,7 @@ word. :type p: Presentation :raises LibsemigroupsError: - if :any:`longest_subword_reducing_length` or :any:`replace_word` does. + if :any:`longest_subword_reducing_length` or :any:`replace_subword` does. )pbdoc"); m.def("presentation_greedy_reduce_length_and_number_of_gens", &presentation::greedy_reduce_length_and_number_of_gens, @@ -703,7 +703,7 @@ was in after the previous iteration. :type p: Presentation :raises LibsemigroupsError: - if :any:`longest_subword_reducing_length` or :any:`replace_word` does. + if :any:`longest_subword_reducing_length` or :any:`replace_subword` does. )pbdoc"); m.def("presentation_is_strongly_compressible", &presentation::is_strongly_compressible, @@ -718,7 +718,7 @@ words start with the same letter and end with the same letter. In other words, if the alphabet of the presentation *p* is :math:`A` and the relation words are of the form :math:`aub = avb` where :math:`a, b\in A` (possibly :math:` a = b` ) and :math:`u, v\in A ^ *`, then *p* is strongly compressible. -See`Section 3.2 `_ for details. +See `Section 3.2 `_ for details. :param p: the presentation. :type p: Presentation @@ -1253,7 +1253,7 @@ acts as an inverse for the :math:`i`-th value in ``p.alphabet()``. Let :math:`x_i` be the :math:`i`-th letter in ``p.alphabet()``, and suppose that :math:`x_i=v_j` is in the :math:`j`-th position of *vals*. This function -checks that :math:`v_i = x_j`, and therefore that :math:`(x_i^{-1})^{-1} = x`. +checks that :math:`v_i = x_j`, and therefore that :math:`(x_i^{-1})^{-1} = x_i`. :param p: the presentation. :type p: Presentation @@ -1577,10 +1577,10 @@ Return the inverse of a letter in the alphabet. Returns the inverse of the letter *x*. -:param x: the letter whose index is sought. +:param x: the letter whose inverse is sought. :type x: :ref:`Letter` -:returns: the index of *x*. +:returns: the inverse of *x*. :rtype: :ref:`Letter` :raises LibsemigroupsError: if no inverses have been set, or if ``index(x)`` throws. From 3410e0e1d8157f372a30270ae6a49387ca0a7182 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 12:22:39 +0100 Subject: [PATCH 3/9] Fix action side enum docs --- src/action.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action.cpp b/src/action.cpp index 4c8bd04f6..7f8fe8652 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -530,7 +530,7 @@ This function returns the point obtained by applying the action defined by "side", R"pbdoc( The values in this enum can be used to indicate that the action in an -:any:`Action` instance should be a left action. +:any:`Action` instance should be a left or right action. The valid values are: @@ -541,7 +541,7 @@ The valid values are: left action. .. py:attribute:: side.right - :value: + :value: Value indicating that the action in an :any:`Action` instance should be a right action. From cef1a53a65bcb3384ec9ee8a77333ccc0a154da8 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:04:06 +0100 Subject: [PATCH 4/9] Fix Aho-Corasick documentation issues --- src/aho-corasick.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/aho-corasick.cpp b/src/aho-corasick.cpp index ec488ec4c..feb25fba2 100644 --- a/src/aho-corasick.cpp +++ b/src/aho-corasick.cpp @@ -54,8 +54,7 @@ The implementation of :any:`AhoCorasick` uses two different types of node; in the trie. An inactive node is a node that used to be part of the trie, but has since been removed. It may later become active again after being reinitialised, and exists as a way of minimising how frequently memory needs -to be allocated and deallocated for nodes. This function validates whether the -given index *i* corresponds to an active node. +to be allocated and deallocated for nodes. Several helper functions are provided in the ``aho_corasick`` module, documented :doc:`here `. @@ -110,7 +109,7 @@ This function returns the index of the child of the node with index :returns: the index of the child. :rtype: int | Undefined -:raises LibsemigroupsError: if ``throw_if_node_index_not_active(parent)`` throws. +:raises LibsemigroupsError: if ``throw_if_node_index_not_active(parent)`` raises an exception. :complexity: Constant. @@ -130,7 +129,7 @@ Calculate the height of a node. :returns: the height. :rtype: int -:raises LibsemigroupsError: if ``throw_if_node_index_not_active(i)`` throws. +:raises LibsemigroupsError: if ``throw_if_node_index_not_active(i)`` raises an exception. :complexity: Linear in the return value which is, at worst, the maximum length @@ -158,9 +157,9 @@ if it had been newly default constructed. R"pbdoc( Returns the number of nodes in the trie. -This function Returns the number of nodes in the trie. +This function returns the number of nodes in the trie. -:returns: The number of nodes> +:returns: The number of nodes. :rtype: int :complexity: Constant @@ -206,7 +205,7 @@ the longest proper suffix of :math:`W` contained in the trie. :returns: The index of the suffix link. :rtype: int -:raises LibsemigroupsError: if ``throw_if_node_index_not_active(current)`` throws. +:raises LibsemigroupsError: if ``throw_if_node_index_not_active(current)`` raises an exception. :complexity: Linear in the height of the node. @@ -240,10 +239,10 @@ trie. :returns: The index of the node traversed to :rtype: int -:raises LibsemigroupsError: if ``throw_if_node_index_not_active(current)`` throws. +:raises LibsemigroupsError: + if ``throw_if_node_index_not_active(current)`` raises an exception. .. seealso:: :any:`throw_if_node_index_not_active`. - )pbdoc"); thing.def("throw_if_node_index_not_active", @@ -257,7 +256,8 @@ Check if an index corresponds to a node currently in the trie. :param i: the index to validate :type i: int -:raises LibsemigroupsError: if ``throw_if_node_index_out_of_range(i)`` throws, or if *i* is +:raises LibsemigroupsError: + if ``throw_if_node_index_out_of_range(i)`` raises an exception, or if *i* is not an active node. :complexity: Constant @@ -351,8 +351,7 @@ Add a word to the trie of *ac* Calling this function immediately adds the word *w* to the trie of *ac*, and makes the final node on the path labelled by this word terminal (if it wasn't already). After adding a word, existing suffix links become -invalid. If an identical word has already been added to the trie of *ac*, then -this function does nothing. +invalid. :param ac: object whose trie is to be added to :type ac: AhoCorasick @@ -364,6 +363,9 @@ this function does nothing. This node will have a :any:`signature` equal to that of *w*. :rtype: int +:raises LibsemigroupsError: + if an identical word has already been added to the trie of *ac*. + :complexity: Linear in the length of *w*. .. seealso:: :any:`AhoCorasick.signature` @@ -397,10 +399,9 @@ that correspond to the largest suffix *w*, such that each :math:`n_i` has either zero children or one. After this, existing suffix links become invalid. If *w* corresponds to a terminal node :math:`n` with children, then calling this -function makes :math`n` not terminal. +function makes :math:`n` not terminal. -If *w* does not correspond to a terminal node, then calling this function does -nothing. +If *w* does not correspond to a terminal node, then this function raises an exception. :param ac: the trie. :type ac: AhoCorasick @@ -411,6 +412,9 @@ nothing. :returns: The index corresponding to the node with signature equal to *w*. :rtype: int +:raises LibsemigroupsError: + if *w* does not correspond to a terminal node. + :complexity: Linear in the length of *w*. .. seealso:: :any:`AhoCorasick.signature` From 8a8f3110dc4c1fabcc7a3793b1fda3915bb29fc4 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:08:12 +0100 Subject: [PATCH 5/9] Fix bipartition documentation issues --- src/bipart.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bipart.cpp b/src/bipart.cpp index fce7a1f18..64fed418c 100644 --- a/src/bipart.cpp +++ b/src/bipart.cpp @@ -319,7 +319,7 @@ The parameter *lookup*: * must have length :math:`2n` for some positive integer :math:`n`; * consist of non-negative integers; and * have the property that if :math:`i`, :math:`i > 0` occurs in *lookup*, - then :math:`i - 1` occurs earlier in *lookup*. The value of ``blocks[i]`` + then :math:`i - 1` occurs earlier in *lookup*. The value of ``lookup[i]`` should represent the index of the block containing ``i``. For example, if *lookup* is ``[0, 1, 1, 2, 1, 1, 3, 1, 1, 4, 5, 6]``, then @@ -503,13 +503,13 @@ are referred to as the *transverse* blocks. &Bipartition::one, py::arg("n"), R"pbdoc( -:sig=(self: Bipartition, n: int) -> Bipartition: +:sig=(n: int) -> Bipartition: Return the identity bipartition of given degree. Returns the identity bipartition of degree ``n``. The *identity bipartition* of -degree :math:`n` has blocks :math:`\{i, -i\}` for all :math:`i\in \{0, \ldots, -n - 1\}`. This member function returns a new identity bipartition of degree +degree :math:`n` has blocks :math:`\{i, -i\}` for all :math:`i\in \{1, \ldots, +n\}`. This member function returns a new identity bipartition of degree equal to ``n``. :param n: the degree of the identity to be returned. @@ -547,7 +547,7 @@ returned list is ``True`` if the block with index ``i`` is transverse and Return the identity bipartition with the same degree as the given bipartition. The *identity bipartition* of degree :math:`n` has blocks :math:`\{i, -i\}` for -all :math:`i\in \{0, \ldots, n - 1\}`. This function returns a new identity +all :math:`i\in \{1, \ldots, n\}`. This function returns a new identity bipartition of degree equal to the degree of *self*. :param f: a bipartition @@ -569,7 +569,7 @@ partition* of a bipartition *f* is the partition of a subset :math:`P` of - :math:`\{|y|\mid y\in P\} = \{1, \ldots, n\}` ; - a block of the partition consists of negative numbers if and only if - the corresponding block of *y* is a transverse block. + the corresponding block of *f* is a transverse block. :param f: the bipartition :type f: Bipartition @@ -622,7 +622,7 @@ at random from among all bipartitions of degree equal to *deg*. :rtype: Bipartition :raises LibsemigroupsError: - if the degree of *deg* is too large. The implementation depends on + if *deg* is too large. The implementation depends on computing several values that can easily exceed the maximum value of any fixed precision integer or float type. When this occurs this exception is thrown.)pbdoc"); From 4d7398cee0dd9fafa32889642ab07c00ee071ce6 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:11:25 +0100 Subject: [PATCH 6/9] Fix congruence common documentation issues --- src/cong-common.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cong-common.cpp b/src/cong-common.cpp index 4375ce483..4dd536580 100644 --- a/src/cong-common.cpp +++ b/src/cong-common.cpp @@ -862,7 +862,7 @@ input word. &Thing::generating_pairs, make_doc( R"pbdoc( -:sig=(self : {name}) -> list[list[int] | str]: +:sig=(self: {name}) -> list[list[int] | str]: {only_document_once} Get the generating pairs of the congruence. @@ -989,7 +989,7 @@ presentation, then this presentation is returned by this function. py::arg(extra_doc.var.data()), py::arg("words"), make_doc(R"pbdoc( -:sig=({var}: {name}, words: list[list[int] | str]) -> list[list[list[int]] | list[str]]: +:sig=({var}: {name}, words: list[list[int] | str]) -> list[list[list[int]]] | list[list[str]]: {only_document_once} Partition a list of words. @@ -1007,7 +1007,7 @@ triggers a full enumeration of *{var}*. :type words: list[list[int] | str] :returns: The partitioned list of words. -:rtype: list[list[list[int]] | list[str]] +:rtype: list[list[list[int]]] | list[list[str]] {raises} )pbdoc", @@ -1057,7 +1057,7 @@ triggers a full enumeration of *{var}*. py::arg("words"), make_doc( R"pbdoc( -:sig=({var}: {name}, words: list[list[int] | str]) -> list[list[list[int]] | list[str]]: +:sig=({var}: {name}, words: list[list[int] | str]) -> list[list[list[int]]] | list[list[str]]: {only_document_once} Find the non-trivial classes in the partition of a list of words. @@ -1074,8 +1074,8 @@ instance *{var}*. :param words: the input list of words. :type words: list[list[int] | str] -:returns: The partition of the input list. -:rtype: list[list[list[int]] | list[str]] +:returns: The non-trivial classes in the partition of the input list. +:rtype: list[list[list[int]]] | list[list[str]] {raises})pbdoc", class_name, From cf99d855e1336a717eadf3dabf834be23bbb986a Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:15:17 +0100 Subject: [PATCH 7/9] Fix congruence documentation wording --- src/cong.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cong.cpp b/src/cong.cpp index 535990099..6d2f679da 100644 --- a/src/cong.cpp +++ b/src/cong.cpp @@ -227,7 +227,7 @@ contained in a :any:`Congruence` object. R"pbdoc( :sig=(c: Congruence) -> bool: -Function for checking if a congruence obviously has infinite many +Function for checking if a congruence obviously has infinitely many classes. This function returns ``True`` if the quotient of the finitely presented From da849d37ce2048028c5efef6c4381d96f96a6f9e Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:17:14 +0100 Subject: [PATCH 8/9] Fix Dot documentation wording --- src/dot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dot.cpp b/src/dot.cpp index 771e35bae..80f74d89d 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -74,7 +74,7 @@ The name of the node. &Dot::Node::add_attr, py::arg("key"), py::arg("val"), - R"pbdoc(Add an attribute to an node. + R"pbdoc(Add an attribute to a node. This function adds a new attribute, or replaces the value of an existing attribute of a :any:`Dot.Node`. @@ -95,7 +95,7 @@ attribute of a :any:`Dot.Node`. py::class_ e(dot, "Edge", R"pbdoc( -Instances of this nested class represents an edge in the represented graph. +Instances of this nested class represent an edge in the represented graph. :any:`Edge` objects can only be constructed by calling :any:`Dot.add_edge`. )pbdoc"); @@ -105,7 +105,7 @@ Instances of this nested class represents an edge in the represented graph. "attrs", [](Dot::Edge& self) { return self.attrs; }, R"pbdoc( -Read-only dictionary containing containing the attributes of the :any:`Edge`. +Read-only dictionary containing the attributes of the :any:`Edge`. )pbdoc"); e.def_readonly("head", &Dot::Edge::head, @@ -252,7 +252,7 @@ This function adds an edge from the node named *head* to the node named *tail*. // last edge reference is collected. py::arg("subgraph"), R"pbdoc( -This functions adds the :any:`Dot` object *subgraph* as a subgraph of *self*. +This function adds the :any:`Dot` object *subgraph* as a subgraph of *self*. The following transformations are performed * the ``label`` attribute of the added subgraph is the :any:`Dot.name` of From 78eb02a22e4d402f774abf13b047dec621c176e0 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 30 Apr 2026 15:22:21 +0100 Subject: [PATCH 9/9] Fix forest documentation wording --- src/forest.cpp | 56 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/forest.cpp b/src/forest.cpp index 2de6c4932..cd244eb2b 100644 --- a/src/forest.cpp +++ b/src/forest.cpp @@ -85,7 +85,7 @@ Constructs a forest with *n* nodes, that is initialised so that the R"pbdoc( :sig=(self: Forest, parents:list[int | Undefined], labels:list[int | Undefined]) -> None: -Construct a :any:`Forest` from list of *parents* and *labels*. +Construct a :any:`Forest` from lists of *parents* and *labels*. :param parents: the list of parents of nodes. :type parents: list[int | Undefined] @@ -93,13 +93,13 @@ Construct a :any:`Forest` from list of *parents* and *labels*. :type labels: list[int | Undefined] :raises LibsemigroupsError: - if *parent* and *labels* have different sizes; + if *parents* and *labels* have different sizes; :raises LibsemigroupsError: - *parent* and *labels* do not have the value :any:`UNDEFINED` in the same + if *parents* and *labels* do not have the value :any:`UNDEFINED` in the same positions (these values indicate where the roots of the trees in the forest are located and so must coincide). :raises LibsemigroupsError: - :any:`set_parent_and_label` throws for ``parent[i]`` and ``edge_labels[i]`` + if :any:`set_parent_and_label` throws for ``parents[i]`` and ``labels[i]`` for any value of ``i``. )pbdoc"); @@ -109,7 +109,7 @@ Construct a :any:`Forest` from list of *parents* and *labels*. R"pbdoc( :sig=(self: Forest, n: int) -> None: -Add nodes to the :any:`Forest`. +Add nodes to the forest. This function adds *n* nodes to the forest, but no edges. @@ -201,7 +201,7 @@ Returns the label of the edge from a node to its parent. R"pbdoc( :sig=(self: Forest) -> list[int | Undefined]: -Returns a copy of the list of edge labels in the :any:`Forest`. The value +Returns a copy of the list of edge labels in the forest. The value in position *i* of this list is the label of the edge from the parent of node *i* to *i*. If the parent equals :any:`UNDEFINED`, then node *i* is a root node. @@ -278,7 +278,7 @@ Returns the parent of a node. R"pbdoc( :sig=(self: Forest) -> list[int | Undefined]: -Returns a list of parents in the :any:`Forest`. The value in position ``i`` of +Returns a list of parents in the forest. The value in position ``i`` of this list is the parent of node ``i``. If the parent equals :any:`UNDEFINED`, then node ``i`` is a root node. @@ -306,7 +306,7 @@ Returns a list containing the labels of the edges on the path from the node *i* :param i: the node. :type i: int -:returns: The word labelling the path from the root to *i*. +:returns: The word labelling the path from *i* to a root. :rtype: list[int] :raises LibsemigroupsError: @@ -358,13 +358,13 @@ Set the parent and edge label for a node. This function sets the parent of Returns a list containing the labels of the edges on the path from node *n* to a root node. -:param f: the Forest. +:param f: the forest. :type f: Forest :param n: the node. :type n: int -:returns: The word labelling the path from the root to *n*. +:returns: The word labelling the path from *n* to a root. :rtype: list[int] :raises LibsemigroupsError: @@ -385,7 +385,7 @@ number of edges, from a root. This function returns the length of the word returned by :any:`path_to_root` and :any:`path_from_root`. -:param f: the Forest. +:param f: the forest. :type f: Forest :param n: the node. @@ -404,11 +404,11 @@ This function returns the length of the word returned by [](Forest const& f) { return forest::dot(f); }, py::arg("f"), R"pbdoc( -Returns a :any:`Dot` object representing a Forest. +Returns a :any:`Dot` object representing a :any:`Forest`. This function returns a :any:`Dot` object representing the :any:`Forest` *f*. -:param f: the Forest. +:param f: the forest. :type f: Forest :returns: A :any:`Dot` object. @@ -426,7 +426,7 @@ This function returns a :any:`Dot` object representing the :any:`Forest` *f*. R"pbdoc( :sig=(f: Forest, labels: list[str]) -> Dot: -Returns a :any:`Dot` object representing a Forest. +Returns a :any:`Dot` object representing a :any:`Forest`. This function returns a :any:`Dot` object representing the :any:`Forest` *f*. If *labels* is not empty, then each node is labelled with the path from @@ -434,7 +434,7 @@ that node to the root of its tree with each letter replaced by the string in the corresponding position of *labels*. If *labels* is empty, then the nodes are not labelled by their paths. -:param f: the Forest. +:param f: the forest. :type f: Forest :param labels: substitute for each edge label. @@ -454,12 +454,12 @@ the nodes are not labelled by their paths. R"pbdoc( :sig=(f: Forest, n: int) -> bool: -Check if a node is the root of any tree in the :any:`Forest`. +Check if a node is the root of any tree in the forest. This function returns ``True`` if the node *n* in the :any:`Forest` *f* is a root node, and ``False`` if it is not. -:param f: the Forest. +:param f: the forest. :type f: Forest :param n: the node. @@ -487,7 +487,7 @@ Returns the maximum label of any edge in a :any:`Forest`. This function returns the maximum label of any edge in the :any:`Forest` *f* or :any:`UNDEFINED` if there are no edges. -:param f: the Forest. +:param f: the forest. :type f: Forest :returns: The maximum label or :any:`UNDEFINED`. @@ -556,7 +556,7 @@ This function returns the number of paths in the range. thing.def("forest", &forest::detail::PathsFromToRootsCommon::forest, R"pbdoc( -Returns the underlying Forest object. +Returns the underlying :any:`Forest` object. This function returns the :any:`Forest` object used to construct or initialise *self*. @@ -570,7 +570,7 @@ initialise *self*. R"pbdoc( Returns a reference to the current path. -This function returns a const reference to the current path from the root of +This function returns the current path from the root of the tree containing :any:`target` to :any:`target`. :returns: The current path. @@ -636,7 +636,7 @@ This function constructs a new :any:`PathsToRoots` for the :any:`Forest` *f*. The newly constructed object does not copy *f* and is not valid if *f* is destroyed. -:param f: the Forest. +:param f: the forest. :type f: Forest )pbdoc"); @@ -656,7 +656,7 @@ This function re-initializes *self* so that its underlying :any:`Forest` object is *f*. This puts *self* back into the same state it would have been in if it had been newly constructed from *f*. -:param f: the Forest. +:param f: the forest. :type f: Forest :returns: ``self`` @@ -704,7 +704,7 @@ This function returns an input iterator pointing to the first word in a Advance to the next path in the range. -This function advances to the current path in the range. +This function advances to the next path in the range. If :any:`at_end` returns ``True``, then this function does nothing. :returns: ``None`` @@ -745,8 +745,8 @@ Range object for iterating through paths in a :any:`Forest`. This class represents a range object that facilitates iterating through the paths from the root of each subtree to every node in a :any:`Forest` object. These nodes are taken in numerical order, so the first value -returned by :any:`get` is the word to a root from node ``0``, after :any:`next` -is called, :any:`get` returns the word to a root from node ``1``, and so on. +returned by :any:`get` is the word from a root to node ``0``, after :any:`next` +is called, :any:`get` returns the word from a root to node ``1``, and so on. The point of this class is to permit more efficient iteration over many paths in a :any:`Forest` object than :any:`path_from_root` (and its associated helper functions). :any:`path_from_root` traverses @@ -778,7 +778,7 @@ This function constructs a new :any:`PathsFromRoots` for the :any:`Forest` *f*. The newly constructed object does not copy *f* and is not valid if *f* is destroyed. -:param f: the Forest. +:param f: the forest. :type f: Forest )pbdoc"); @@ -798,7 +798,7 @@ This function re-initializes *self* so that its underlying :any:`Forest` object is *f*. This puts *self* back into the same state it would have been in if it had been newly constructed from *f*. -:param f: the Forest. +:param f: the forest. :type f: Forest :returns: ``self`` @@ -846,7 +846,7 @@ This function returns an input iterator pointing to the first word in a Advance to the next path in the range. -This function advances to the current path in the range. +This function advances to the next path in the range. If :any:`at_end` returns ``True``, then this function does nothing. :returns: ``None``