Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #139

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cursors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ A [`TreeCursor`](@ref) for tree nodes with the [`IndexedChildren`](@ref) trait b
are not directly accessible.

This type is very similar to [`ImplicitCursor`](@ref) except that it is free to assume that the child iteration
state is an integer starting at `1` which drastially simplifies type inference and slightly simplifies the
state is an integer starting at `1` which drastically simplifies type inference and slightly simplifies the
iteration methods.
"""
struct IndexedCursor{N,P} <: TreeCursor{N,P}
Expand Down
4 changes: 2 additions & 2 deletions src/iteration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Any[1,Any[2,3]]
we will get `[[1, [2,3]], 1, [2, 3], 2, 3]`.

WARNING: This is \$O(n^2)\$, only use this if you know you need it, as opposed to
a more standard statefull approach.
a more standard stateful approach.
"""
struct StatelessBFS{T} <: TreeIterator{T}
root::T
Expand Down Expand Up @@ -469,7 +469,7 @@ Note that in most common cases tree nodes are of a type which depends on their c
`Int` or `Vector`. Alternatively, to only operate on leaves do `map(𝒻, Leaves(itr))`.

It's very easy to write an `f` that makes `treemap` stack-overflow. To avoid this, ensure that `f` eventually
termiantes, i.e. that sometimes it returns empty `children`. For example, if `f(n) = (nothing, [0; children(n)])` will
terminates, i.e. that sometimes it returns empty `children`. For example, if `f(n) = (nothing, [0; children(n)])` will
stack-overflow because every node will have at least 1 child.

To create a tree with [`HasNodeType`](@ref) which enables efficient iteration, see [`StableNode`](@ref) instead.
Expand Down
6 changes: 3 additions & 3 deletions src/printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ printnode(io::IO, node; kw...) = show(IOContext(io, :compact => true, :limit =>
repr_node(node; context=nothing)

Get the string representation of a node using [`printnode`](@ref). This works
analagously to `Base.repr`.
analogously to `Base.repr`.

`context` is an `IO` or `IOContext` object whose attributes are used for the
I/O stream passed to `printnode`.
Expand All @@ -119,7 +119,7 @@ Set of characters (or strings) used to pretty-print tree branches in [`print_tre
- `mid`: "Forked" branch segment connecting to middle children.
- `terminator`: Final branch segment connecting to last child.
- `skip`: Vertical branch segment.
- `dash`: Horizontal branch segmentt printed to the right of `mid` and `terminator`.
- `dash`: Horizontal branch segment printed to the right of `mid` and `terminator`.
- `trunc`: Used to indicate the subtree has been truncated at the maximum depth.
- `pair`: Printed between a child node and its key.
"""
Expand Down Expand Up @@ -163,7 +163,7 @@ function TreeCharSet(name::Symbol=:unicode)
elseif name == :ascii
TreeCharSet("+", "\\", "|", "--", "...", " => ")
else
throw(ArgumentError("unrecognized dfeault TreeCharSet name: $name"))
throw(ArgumentError("unrecognized default TreeCharSet name: $name"))
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ childstatetype(node) = childstatetype(typeof(node))
NodeType(::Type)
NodeType(node)

A trait which specifiees whether a tree has a predictable node type (`HasNodeType()`) or not (`NodeTypeUnknown()`).
A trait which specifies whether a tree has a predictable node type (`HasNodeType()`) or not (`NodeTypeUnknown()`).

This is analogous to `Base.IteratorEltype`. In particular the `IteratorEltype` of [`TreeIterator`](@ref) is dictated
by this trait.
Expand Down
Loading