Skip to content

Commit d39eedc

Browse files
committed
Corrected some typos
1 parent 7e22d86 commit d39eedc

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/sage/sets/recursively_enumerated_set.pyx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ search, breadth first search and elements of given depth.
1313
1414
See :wikipedia:`Recursively_enumerable_set`.
1515
16-
See documentation of :func:`RecursivelyEnumeratedSet` below for the
16+
See the documentation of :func:`RecursivelyEnumeratedSet` below for the
1717
description of the inputs.
1818
1919
AUTHORS:
@@ -25,7 +25,7 @@ No hypothesis on the structure
2525
2626
What we mean by "no hypothesis" is that the set is not known
2727
to be a forest, symmetric, or graded. However, it may have other
28-
structure, like not containing an oriented cycle, that does not
28+
structures, such as not containing an oriented cycle, that do not
2929
help with the enumeration.
3030
3131
In this example, the seed is 0 and the successor function is either ``+2``
@@ -139,7 +139,7 @@ Forest structure
139139
----------------
140140
141141
The set of words over the alphabet `\{a,b\}` can be generated from the
142-
empty word by appending letter `a` or `b` as a successor function. This set
142+
empty word by appending the letter `a` or `b` as a successor function. This set
143143
has a forest structure::
144144
145145
sage: seeds = ['']
@@ -182,7 +182,7 @@ For the previous example, the two necessary pieces of information are:
182182
183183
lambda x: [x + letter for letter in ['a', 'b', 'c']
184184
185-
This would actually describe an **infinite** set, as such rules describes
185+
This would actually describe an **infinite** set, as such rules describe
186186
"all words" on 3 letters. Hence, it is a good idea to replace the function by::
187187
188188
lambda x: [x + letter for letter in ['a', 'b', 'c']] if len(x) < 2 else []
@@ -283,7 +283,7 @@ def RecursivelyEnumeratedSet(seeds, successors, structure=None,
283283
284284
A set `S` is called recursively enumerable if there is an algorithm that
285285
enumerates the members of `S`. We consider here the recursively
286-
enumerated set that are described by some ``seeds`` and a successor
286+
enumerated sets that are described by some ``seeds`` and a successor
287287
function ``successors``.
288288
289289
Let `U` be a set and ``successors`` `:U \to 2^U` be a successor function
@@ -369,7 +369,7 @@ def RecursivelyEnumeratedSet(seeds, successors, structure=None,
369369
370370
.. WARNING::
371371
372-
If you do not set the good structure, you might obtain bad results,
372+
If you do not set a good structure, you might obtain bad results,
373373
like elements generated twice::
374374
375375
sage: f = lambda a: [a-1,a+1]
@@ -744,8 +744,8 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
744744
r"""
745745
Iterate over the elements of ``self`` of given depth.
746746
747-
An element of depth `n` can be obtained applying `n` times the
748-
successor function to a seed.
747+
An element of depth `n` can be obtained by applying the
748+
successor function `n` times to a seed.
749749
750750
INPUT:
751751
@@ -810,7 +810,7 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
810810
r"""
811811
Iterate on the elements of ``self`` (breadth first).
812812
813-
This code remembers every elements generated and uses python
813+
This code remembers every element generated and uses python
814814
queues. It is 3 times slower than the other one.
815815
816816
See :wikipedia:`Breadth-first_search`.
@@ -839,7 +839,7 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
839839
r"""
840840
Iterate on the elements of ``self`` (in no particular order).
841841
842-
This code remembers every elements generated.
842+
This code remembers every element generated.
843843
844844
TESTS:
845845
@@ -868,7 +868,7 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
868868
r"""
869869
Iterate on the elements of ``self`` (depth first).
870870
871-
This code remembers every elements generated.
871+
This code remembers every element generated.
872872
873873
The elements are traversed right-to-left, so the last element returned
874874
by the successor function is visited first.
@@ -1515,7 +1515,7 @@ def search_forest_iterator(roots, children, algorithm='depth'):
15151515
[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1],
15161516
[1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]]
15171517
1518-
This allows for iterating trough trees of infinite depth::
1518+
This allows for iterating through trees of infinite depth::
15191519
15201520
sage: it = search_forest_iterator([[]], lambda l: [l+[0], l+[1]], algorithm='breadth')
15211521
sage: [ next(it) for i in range(16) ]
@@ -1537,7 +1537,7 @@ def search_forest_iterator(roots, children, algorithm='depth'):
15371537
[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
15381538
"""
15391539
# Little trick: the same implementation handles both depth and
1540-
# breadth first search. Setting position to -1 makes a depth search
1540+
# breadth first search. Setting the position to -1 makes a depth search
15411541
# (you ask the children for the last node you met). Setting
15421542
# position on 0 makes a breadth search (enumerate all the
15431543
# descendants of a node before going on to the next father)
@@ -1883,8 +1883,8 @@ class RecursivelyEnumeratedSet_forest(Parent):
18831883
def _elements_of_depth_iterator_rec(self, depth=0):
18841884
r"""
18851885
Return an iterator over the elements of ``self`` of given depth.
1886-
An element of depth `n` can be obtained applying `n` times the
1887-
children function from a root. This function is not affected
1886+
An element of depth `n` can be obtained by applying the
1887+
children function `n` times from the root. This function is not affected
18881888
by post processing.
18891889
18901890
EXAMPLES::
@@ -1914,8 +1914,8 @@ class RecursivelyEnumeratedSet_forest(Parent):
19141914
def elements_of_depth_iterator(self, depth=0):
19151915
r"""
19161916
Return an iterator over the elements of ``self`` of given depth.
1917-
An element of depth `n` can be obtained applying `n` times the
1918-
children function from a root.
1917+
An element of depth `n` can be obtained by applying the
1918+
children function `n` times from the root.
19191919
19201920
EXAMPLES::
19211921
@@ -1973,7 +1973,7 @@ class RecursivelyEnumeratedSet_forest(Parent):
19731973
depth first search and breadth first search failed. The
19741974
following example enumerates all ordered pairs of nonnegative
19751975
integers, starting from an infinite set of roots, where each
1976-
roots has an infinite number of children::
1976+
root has an infinite number of children::
19771977
19781978
sage: from sage.sets.recursively_enumerated_set import RecursivelyEnumeratedSet_forest
19791979
sage: S = RecursivelyEnumeratedSet_forest(Family(NN, lambda x : (x, 0)),

0 commit comments

Comments
 (0)