elixush v0.0.1 Elixush.Util

Summary

Functions

computes the next row using the prev-row current-element and the other seq

Returns the number of paren pairs in tree

Returns the number of points in tree, where each atom and each pair of parentheses counts as a point

really make-list-if-not-seq, but close enough for here

Returns a version of n that obeys limit parameters

Levenshtein Distance - http://en.wikipedia.org/wiki/Levenshtein_distance In information theory and computer science, the Levenshtein distance is a metric for measuring the amount of difference between two sequences. This is a functional implementation of the levenshtein edit distance with as little mutability as possible. Still maintains the O(n*m) guarantee

Like postwalk, but only for lists

Prints the provided thing and returns it

If thing is a literal, return its type — otherwise return false

If a number, rounds float f to n decimal places

Like walk, but only for lists

Functions

compute_next_row(prev_row, current_element, other_seq, pred)

computes the next row using the prev-row current-element and the other seq

count_parens(tree)

Specs

count_parens(Enum.t) :: integer

Returns the number of paren pairs in tree

count_points(tree)

Specs

count_points(Enum.t) :: integer

Returns the number of points in tree, where each atom and each pair of parentheses counts as a point.

ensure_list(thing)

really make-list-if-not-seq, but close enough for here

keep_number_reasonable(n)

Specs

keep_number_reasonable(number) :: number

Returns a version of n that obeys limit parameters.

levenshtein_distance(a, b, p)

Levenshtein Distance - http://en.wikipedia.org/wiki/Levenshtein_distance In information theory and computer science, the Levenshtein distance is a metric for measuring the amount of difference between two sequences. This is a functional implementation of the levenshtein edit distance with as little mutability as possible. Still maintains the O(n*m) guarantee.

postwalklist(f, form)

Like postwalk, but only for lists

recognize_literal(thing)

If thing is a literal, return its type — otherwise return false.

round_to_n_decimal_places(f, n)

If a number, rounds float f to n decimal places.

walklist(inner, outer, form)

Like walk, but only for lists.