From f0c7dd1062be5422fa2c9fd17d1a008d02ab7acd Mon Sep 17 00:00:00 2001 From: spaette Date: Sun, 3 Dec 2023 14:05:35 -0600 Subject: [PATCH] typos --- src/cursors.jl | 2 +- src/iteration.jl | 4 ++-- src/printing.jl | 6 +++--- src/traits.jl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cursors.jl b/src/cursors.jl index 5d88d3c..0229bcc 100644 --- a/src/cursors.jl +++ b/src/cursors.jl @@ -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} diff --git a/src/iteration.jl b/src/iteration.jl index 2458ac5..32a3ac0 100644 --- a/src/iteration.jl +++ b/src/iteration.jl @@ -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 @@ -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. diff --git a/src/printing.jl b/src/printing.jl index d96751b..35fb267 100644 --- a/src/printing.jl +++ b/src/printing.jl @@ -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`. @@ -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. """ @@ -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 diff --git a/src/traits.jl b/src/traits.jl index e5633c5..6a745ff 100644 --- a/src/traits.jl +++ b/src/traits.jl @@ -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.