OT v0.1.0 OT.Text

A TP1 operational transformation implementation based heavily on ot-text, but modified to be invertable.

In this OT type, operations are represented as traversals of an entire string, with any final retain components implicit. This means that given the text “Foz Baz”, the operation needed to change it to “Foo Bar Baz” would be represented thusly:

[2, %{d: "z"}, %{i: "o Bar"}]

Notice that the final retain component, 4 (to skip over “ Baz”) is implicit and it not included.

Summary

Types

A string that this OT type can operate on

Types

datum()
datum() :: String.t

A string that this OT type can operate on

Functions

apply(text, op)

See OT.Text.Application.apply/2.

apply!(text, op)

See OT.Text.Application.apply!/2.

compose(op_a, op_b)

See OT.Text.Composition.compose/2.

init()
init() :: datum

Initialize a blank text datum.

init_random(length \\ 64)
init_random(non_neg_integer) :: datum

Initialize a random text for fuzz testing.

random_op(text)

See OT.Text.Operation.random/1.

transform(op_a, op_b, side)

See OT.Text.Transformation.transform/3.