Common Lisp Package: COM.GIGAMONKEYS.PROSE-DIFF

README:

FUNCTION

Private

%LCS-TABLE (A B)

Compute the MxN table from which we can extract the LCS, and a bunch of other good stuff.

COMPOSE (FUNCTION &REST MORE-FUNCTIONS)

Returns a function composed of FUNCTION and MORE-FUNCTIONS that applies its arguments to to each in turn, starting from the rightmost of MORE-FUNCTIONS, and then calling the next one with the primary value of the last.

DETEXTIFY-MARKUP (V)

Convert a vector of propertied-text object (such as produced by textify-markup into a list of Markup sexps.

DIFF-TEXTIFIED (A B)

Diff two vectors of propertied-text, returning a single vector containing the diff as propertied-text.

DIFF-VECTORS (OLD NEW &OPTIONAL (LCS-FROBBER #'IDENTITY))

Diff two vectors returning a vector with the elements of old and new wrapped in conses whose CAR is either :LCS, :DELETE, or :ADD. Optionally frob the computed LCS before computing the diff.

ESTABLISH-PAIRS (ORIGINAL EDITED &KEY UNPAIR-SHORT)

Establish the pairing between two lists of chunks.

EXTRACT (MARKUP WHAT)

Find all the what elements in markup.

FINER-GRAINED-P (NEW-DIFF ORIG-DIFF)

Is the new-diff finer-grained than the original?

HAS-NESTED-ADD-OR-DELETE-P (TREE)

Tree has a nested :add or :delete tag and it's not the only tag. Returns which one it is since there should only be one or the other.

LCS (A B)

Compute the longest common subsequence of vectors `a' and `b'

LCS-LENGTH (A B)

Compute the length of the longest common subsequence of vectors `a' and `b'

LCS-POSITIONS (A B)

Find the indices in a and b of the elements of the LCS.

MAP-TREE (FN TREE)

Map fn down tree, replacing each element of the tree with the return value of fn. When the return value is identical to the original sub-tree it is recursively mapped.

MARK-MOVES (MARKUP)

Take the output of diff-to-markup/no-moves and find the adds and deletes which are actually moves.

NESTED-TAGS (TREE)

Give a tree like '(:a (:b (:c ...))) the nested tags are (:a :b :c)

ONE-WAY-SIMILARITY (A B)

Like `similarity' but in only one direction.

PARAGRAPHS (PARSED)

Split file into chunks, one per paragraph.

REMOVE-EMPTIES (TREE)

Remove empty sub-trees from tree.

REWRITE-ADDS-AND-DELETES (TREE)

Rewrite the Markup tree so that :add and :delete tags are moved out as far as possible. E.g. given (:p (:add something)) we tranform it to: (:add (:p something)).

SET-MOST-SIMILAR (ORIGINAL EDITED)

Make each chunk in original and edited point to the most similar chunk on the other side unless they have already been paired with an identical chunk.

SIMILARITY (A B)

Compute the similarity of vectors `a' and `b' in terms of the average of the ratios of the length of the LCS to their length.

TAKE (LIST N)

Return a list of of the first n values of list and the left-over tail as a secondary value.

TEXTIFY-MARKUP (MARKUP-LIST)

Convert a list of Markup sexps into a vector of interned propertied-text objects.

TOKENIZE-TEXT (TEXT)

Split a text string into a list of tokens containing either all the text split into words, whitespace, and punctuation or just the words.

UNPAIR-SHORT (CHUNKS ORIGINAL-P)

Unpair very short chunks.

VECTOR-PUSH-EXTEND* (LIST V)

Push all the elements of `list' onto v as if by vector-push-extend

Undocumented

%DETEXTIFY-MARKUP (V START END OPEN-PROPS)

ADD-PROPERTY (TEXT NEW-PROP)

AS-PAIRS (CHUNKS)

BLOCK-ELEMENT-P (X)

CLEAN-ADDS-AND-DELETES (DIFF)

CLEAN-EMPTIES (DIFF)

CLEANED-DIFF-OUTPUT (DIFF)

CLEAR-INTERNED-TEXT

COMBINE-CHUNKS (&REST CHUNKS)

COMMENTREF->HTML (SEXP)

COMMENTS->HTML (SEXP)

CONCATENATE-VECTORS (VECTORS)

DEDIFF (TEXTIFIED)

DIFF-PAIR (PAIR)

DIFF-TO-HTML (ORIGINAL-FILE EDITED-FILE OUTPUT &KEY (CSS-DIR ) (JS-DIR ))

DIFF-TO-MARKUP (ORIGINAL EDITED)

DIFF-TO-MARKUP/NO-MOVES (ORIGINAL-PARSED EDITED-PARSED)

EMIT-DIFFS (NEXT-LCS V I MAX-I MARKER OUTPUT)

EMPTY-CHUNK-P (CHUNK)

EXTRACT-COMMENTS (SEXP)

FIND-MOST-REFINING (ADD DELETES)

FIND-MOST-SIMILAR (CHUNK OTHERS)

HAS-PROPERTY-P (PROP TEXT)

IDENTICAL-P (P)

INTERN-TEXT (TEXT &OPTIONAL PROPERTIES)

LONGER (LIST-A LIST-B)

MAKE-CHUNK (MARKUP)

MAKE-EMPTY-CHUNK

MAXIMUM (LIST &KEY (KEY #'IDENTITY))

NEW-OPEN-P (TEXT-PROPS OPEN-PROPS)

PAIR-ADDS-AND-DELETES (ORIGINAL-FILE EDITED-FILE)

PAIR-CHUNKS (ORIGINAL EDITED)

PAIR-IDENTICAL (ORIGINAL EDITED)

PAIR-SYMMETRICAL (ORIGINAL EDITED)

PART-OF-DIFF-P (TEXT)

PROMOTE-TAG (TAG TREE)

REFINEMENT (DELETE ADD)

REMOVE-COMMENTS (SEXP)

REMOVE-PROPERTIES (TEXT PROPS)

REMOVE-TAG (TAG TREE)

SHOW-PAIRING (LABEL ADD)

SPLIT-LIST (LIST TAIL)

SYMMETRICAL-P (P)

UNDIFFED (MARKUP)

UNOPEN (TEXT-PROPS OPEN-PROPS)

UNPAIR (CHUNK ORIGINAL-P)

UNPAIR-ASYMMETRICAL (CHUNKS ORIGINAL-P)

WRAP-ADD-DELETE (SEXP)

GENERIC-FUNCTION

Private

Undocumented

%TEXTIFY-MARKUP (MARKUP PROPERTIES)

SLOT-ACCESSOR

Private

Undocumented

EDITED (OBJECT)

MARKUP (OBJECT)

SETFMARKUP (NEW-VALUE OBJECT)

MOST-SIMILAR (OBJECT)

SETFMOST-SIMILAR (NEW-VALUE OBJECT)

ORIGINAL (OBJECT)

PAIR (OBJECT)

SETFPAIR (NEW-VALUE OBJECT)

PROPERTIES (OBJECT)

SETFPROPERTIES (NEW-VALUE OBJECT)

TEXT (OBJECT)

SETFTEXT (NEW-VALUE OBJECT)

TEXTIFIED (OBJECT)

VARIABLE

Private

Undocumented

*INTERNED-TEXT*

*RETAGGER*

*SHORT-LENGTH*

*TOKEN-SCANNER*

CLASS

Private

Undocumented

CHUNK

PAIR (OBJECT)

PROPERTIED-TEXT