]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/lcs/lcs-docs.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / lcs / lcs-docs.factor
index ad81a7b3465dd8666d6d4abfa2e5efa51a8f06e7..b37ad67929f363c7d0541433a54facd20ce39a3b 100644 (file)
@@ -1,39 +1,39 @@
-USING: help.syntax help.markup sequences ;\r
-IN: lcs\r
-\r
-HELP: levenshtein\r
-{ $values { "old" sequence } { "new" sequence } { "n" "the Levenshtein distance" } }\r
-{ $description "Calculates the Levenshtein distance between old and new, that is, the minimal number of changes from the old sequence to the new one, in terms of deleting, inserting and replacing characters." } ;\r
-\r
-HELP: lcs\r
-{ $values { "seq1" sequence } { "seq2" sequence } { "lcs" "a longest common subsequence" } }\r
-{ $description "Given two sequences, calculates a longest common subsequence between them. Note two things: this is only one of the many possible LCSs, and the LCS may not be contiguous." } ;\r
-\r
-HELP: lcs-diff\r
-{ $values { "old" sequence } { "new" sequence } { "diff" "an edit script" } }\r
-{ $description "Given two sequences, find a minimal edit script from the old to the new. There may be more than one minimal edit script, and this chooses one arbitrarily. This script is in the form of an array of the tuples of the classes " { $link retain } ", " { $link delete } " and " { $link insert } " which have their information stored in the 'item' slot." } ;\r
-\r
-HELP: retain\r
-{ $class-description "Represents an action in an edit script where an item is kept, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is retained" } ;\r
-\r
-HELP: delete\r
-{ $class-description "Represents an action in an edit script where an item is deleted, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is deleted" } ;\r
-\r
-HELP: insert\r
-{ $class-description "Represents an action in an edit script where an item is added, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is inserted" } ;\r
-\r
-ARTICLE: "lcs" "LCS, diffing and distance"\r
-"This vocabulary provides words for three apparently unrelated but in fact very similar problems: finding a longest common subsequence between two sequences, getting a minimal edit script (diff) between two sequences, and calculating the Levenshtein distance between two sequences. The implementations of these algorithms are very closely related, and all running times are O(nm), where n and m are the lengths of the input sequences."\r
-{ $subsections\r
-    lcs\r
-    lcs-diff\r
-    levenshtein\r
-}\r
-"The " { $link lcs-diff } " word returns a sequence of tuples of the following classes. They all hold their contents in the 'item' slot."\r
-{ $subsections\r
-    insert\r
-    delete\r
-    retain\r
-} ;\r
-\r
-ABOUT: "lcs"\r
+USING: help.syntax help.markup sequences ;
+IN: lcs
+
+HELP: levenshtein
+{ $values { "old" sequence } { "new" sequence } { "n" "the Levenshtein distance" } }
+{ $description "Calculates the Levenshtein distance between old and new, that is, the minimal number of changes from the old sequence to the new one, in terms of deleting, inserting and replacing characters." } ;
+
+HELP: lcs
+{ $values { "seq1" sequence } { "seq2" sequence } { "lcs" "a longest common subsequence" } }
+{ $description "Given two sequences, calculates a longest common subsequence between them. Note two things: this is only one of the many possible LCSs, and the LCS may not be contiguous." } ;
+
+HELP: lcs-diff
+{ $values { "old" sequence } { "new" sequence } { "diff" "an edit script" } }
+{ $description "Given two sequences, find a minimal edit script from the old to the new. There may be more than one minimal edit script, and this chooses one arbitrarily. This script is in the form of an array of the tuples of the classes " { $link retain } ", " { $link delete } " and " { $link insert } " which have their information stored in the 'item' slot." } ;
+
+HELP: retain
+{ $class-description "Represents an action in an edit script where an item is kept, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is retained" } ;
+
+HELP: delete
+{ $class-description "Represents an action in an edit script where an item is deleted, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is deleted" } ;
+
+HELP: insert
+{ $class-description "Represents an action in an edit script where an item is added, going from the initial sequence to the final sequence. This has one slot, called item, containing the thing which is inserted" } ;
+
+ARTICLE: "lcs" "LCS, diffing and distance"
+"This vocabulary provides words for three apparently unrelated but in fact very similar problems: finding a longest common subsequence between two sequences, getting a minimal edit script (diff) between two sequences, and calculating the Levenshtein distance between two sequences. The implementations of these algorithms are very closely related, and all running times are O(nm), where n and m are the lengths of the input sequences."
+{ $subsections
+    lcs
+    lcs-diff
+    levenshtein
+}
+"The " { $link lcs-diff } " word returns a sequence of tuples of the following classes. They all hold their contents in the 'item' slot."
+{ $subsections
+    insert
+    delete
+    retain
+} ;
+
+ABOUT: "lcs"