Skip to content

Commit ae2efac

Browse files
codexjames-d-mitchell
authored andcommitted
Fix forest documentation wording
1 parent 6cdeeda commit ae2efac

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

src/forest.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,21 @@ Constructs a forest with *n* nodes, that is initialised so that the
8585
R"pbdoc(
8686
:sig=(self: Forest, parents:list[int | Undefined], labels:list[int | Undefined]) -> None:
8787
88-
Construct a :any:`Forest` from list of *parents* and *labels*.
88+
Construct a :any:`Forest` from lists of *parents* and *labels*.
8989
9090
:param parents: the list of parents of nodes.
9191
:type parents: list[int | Undefined]
9292
:param labels: the list of edge labels.
9393
:type labels: list[int | Undefined]
9494
9595
:raises LibsemigroupsError:
96-
if *parent* and *labels* have different sizes;
96+
if *parents* and *labels* have different sizes;
9797
:raises LibsemigroupsError:
98-
*parent* and *labels* do not have the value :any:`UNDEFINED` in the same
98+
if *parents* and *labels* do not have the value :any:`UNDEFINED` in the same
9999
positions (these values indicate where the roots of the trees in the forest
100100
are located and so must coincide).
101101
:raises LibsemigroupsError:
102-
:any:`set_parent_and_label` throws for ``parent[i]`` and ``edge_labels[i]``
102+
if :any:`set_parent_and_label` throws for ``parents[i]`` and ``labels[i]``
103103
for any value of ``i``.
104104
)pbdoc");
105105

@@ -306,7 +306,7 @@ Returns a list containing the labels of the edges on the path from the node *i*
306306
:param i: the node.
307307
:type i: int
308308
309-
:returns: The word labelling the path from the root to *i*.
309+
:returns: The word labelling the path from *i* to a root.
310310
:rtype: list[int]
311311
312312
:raises LibsemigroupsError:
@@ -358,13 +358,13 @@ Set the parent and edge label for a node. This function sets the parent of
358358
Returns a list containing the labels of the edges on the path from node *n* to
359359
a root node.
360360
361-
:param f: the Forest.
361+
:param f: the:any:`Forest`.
362362
:type f: Forest
363363
364364
:param n: the node.
365365
:type n: int
366366
367-
:returns: The word labelling the path from the root to *n*.
367+
:returns: The word labelling the path from *n* to a root.
368368
:rtype: list[int]
369369
370370
:raises LibsemigroupsError:
@@ -385,7 +385,7 @@ number of edges, from a root.
385385
This function returns the length of the word returned by
386386
:any:`path_to_root` and :any:`path_from_root`.
387387
388-
:param f: the Forest.
388+
:param f: the:any:`Forest`.
389389
:type f: Forest
390390
391391
:param n: the node.
@@ -404,11 +404,11 @@ This function returns the length of the word returned by
404404
[](Forest const& f) { return forest::dot(f); },
405405
py::arg("f"),
406406
R"pbdoc(
407-
Returns a :any:`Dot` object representing a Forest.
407+
Returns a :any:`Dot` object representing a:any:`Forest`.
408408
409409
This function returns a :any:`Dot` object representing the :any:`Forest` *f*.
410410
411-
:param f: the Forest.
411+
:param f: the:any:`Forest`.
412412
:type f: Forest
413413
414414
:returns: A :any:`Dot` object.
@@ -426,15 +426,15 @@ This function returns a :any:`Dot` object representing the :any:`Forest` *f*.
426426
R"pbdoc(
427427
:sig=(f: Forest, labels: list[str]) -> Dot:
428428
429-
Returns a :any:`Dot` object representing a Forest.
429+
Returns a :any:`Dot` object representing a:any:`Forest`.
430430
431431
This function returns a :any:`Dot` object representing the :any:`Forest` *f*.
432432
If *labels* is not empty, then each node is labelled with the path from
433433
that node to the root of its tree with each letter replaced by the string
434434
in the corresponding position of *labels*. If *labels* is empty, then
435435
the nodes are not labelled by their paths.
436436
437-
:param f: the Forest.
437+
:param f: the:any:`Forest`.
438438
:type f: Forest
439439
440440
:param labels: substitute for each edge label.
@@ -459,7 +459,7 @@ Check if a node is the root of any tree in the :any:`Forest`.
459459
This function returns ``True`` if the node *n* in the :any:`Forest` *f* is
460460
a root node, and ``False`` if it is not.
461461
462-
:param f: the Forest.
462+
:param f: the:any:`Forest`.
463463
:type f: Forest
464464
465465
:param n: the node.
@@ -487,7 +487,7 @@ Returns the maximum label of any edge in a :any:`Forest`.
487487
This function returns the maximum label of any edge in the :any:`Forest` *f*
488488
or :any:`UNDEFINED` if there are no edges.
489489
490-
:param f: the Forest.
490+
:param f: the:any:`Forest`.
491491
:type f: Forest
492492
493493
:returns: The maximum label or :any:`UNDEFINED`.
@@ -556,7 +556,7 @@ This function returns the number of paths in the range.
556556
thing.def("forest",
557557
&forest::detail::PathsFromToRootsCommon::forest,
558558
R"pbdoc(
559-
Returns the underlying Forest object.
559+
Returns the underlying :any:`Forest` object.
560560
561561
This function returns the :any:`Forest` object used to construct or
562562
initialise *self*.
@@ -570,7 +570,7 @@ initialise *self*.
570570
R"pbdoc(
571571
Returns a reference to the current path.
572572
573-
This function returns a const reference to the current path from the root of
573+
This function returns the current path from the root of
574574
the tree containing :any:`target` to :any:`target`.
575575
576576
:returns: The current path.
@@ -636,7 +636,7 @@ This function constructs a new :any:`PathsToRoots` for the :any:`Forest` *f*.
636636
The newly constructed object does not copy *f* and is not valid if *f* is
637637
destroyed.
638638
639-
:param f: the Forest.
639+
:param f: the :any:`Forest`.
640640
:type f: Forest
641641
)pbdoc");
642642

@@ -656,7 +656,7 @@ This function re-initializes *self* so that its underlying :any:`Forest`
656656
object is *f*. This puts *self* back into the same state it
657657
would have been in if it had been newly constructed from *f*.
658658
659-
:param f: the Forest.
659+
:param f: the:any:`Forest`.
660660
:type f: Forest
661661
662662
:returns: ``self``
@@ -704,7 +704,7 @@ This function returns an input iterator pointing to the first word in a
704704
705705
Advance to the next path in the range.
706706
707-
This function advances to the current path in the range.
707+
This function advances to the next path in the range.
708708
If :any:`at_end` returns ``True``, then this function does nothing.
709709
710710
:returns: ``None``
@@ -745,8 +745,8 @@ Range object for iterating through paths in a :any:`Forest`.
745745
This class represents a range object that facilitates
746746
iterating through the paths from the root of each subtree to every node in a
747747
:any:`Forest` object. These nodes are taken in numerical order, so the first value
748-
returned by :any:`get` is the word to a root from node ``0``, after :any:`next`
749-
is called, :any:`get` returns the word to a root from node ``1``, and so on.
748+
returned by :any:`get` is the word from a root to node ``0``, after :any:`next`
749+
is called, :any:`get` returns the word from a root to node ``1``, and so on.
750750
The point of this class is to permit more efficient iteration over many paths
751751
in a :any:`Forest` object than :any:`path_from_root` (and its
752752
associated helper functions). :any:`path_from_root` traverses
@@ -778,7 +778,7 @@ This function constructs a new :any:`PathsFromRoots` for the :any:`Forest` *f*.
778778
The newly constructed object does not copy *f* and is not valid if *f* is
779779
destroyed.
780780
781-
:param f: the Forest.
781+
:param f: the:any:`Forest`.
782782
:type f: Forest
783783
)pbdoc");
784784

@@ -798,7 +798,7 @@ This function re-initializes *self* so that its underlying :any:`Forest`
798798
object is *f*. This puts *self* back into the same state it
799799
would have been in if it had been newly constructed from *f*.
800800
801-
:param f: the Forest.
801+
:param f: the:any:`Forest`.
802802
:type f: Forest
803803
804804
:returns: ``self``
@@ -846,7 +846,7 @@ This function returns an input iterator pointing to the first word in a
846846
847847
Advance to the next path in the range.
848848
849-
This function advances to the current path in the range.
849+
This function advances to the next path in the range.
850850
If :any:`at_end` returns ``True``, then this function does nothing.
851851
852852
:returns: ``None``

0 commit comments

Comments
 (0)