Diff2.st
changeset 14009 27022a1ba8f6
parent 13885 d01470638c24
child 14840 6cc4674bfd18
equal deleted inserted replaced
14008:289b26a46d64 14009:27022a1ba8f6
    31 
    31 
    32 Object subclass:#Diff2
    32 Object subclass:#Diff2
    33 	instanceVariableNames:'file1 file2'
    33 	instanceVariableNames:'file1 file2'
    34 	classVariableNames:''
    34 	classVariableNames:''
    35 	poolDictionaries:''
    35 	poolDictionaries:''
    36 	category:'Collections-Sequenceable-Diff2'
    36 	category:'Collections-Sequenceable-Diff'
    37 !
    37 !
    38 
    38 
    39 Object subclass:#Chunk
    39 Object subclass:#Chunk
    40 	instanceVariableNames:'offset length'
    40 	instanceVariableNames:'offset length'
    41 	classVariableNames:''
    41 	classVariableNames:''
   119 "
   119 "
   120 !
   120 !
   121 
   121 
   122 documentation
   122 documentation
   123 "
   123 "
   124 Generic diff/comm utilities. Agnostic as to the longestCommonSubsequence algorithm used.
   124     Generic diff/comm utilities. Agnostic as to the longestCommonSubsequence algorithm used.
   125 
   125 
   126 Instance Variables
   126     Instance Variables
   127         file1:          <SequenceableCollection> One of the two files to compare.
   127         file1:          <SequenceableCollection> One of the two files to compare.
   128         file2:          <SequenceableCollection> The other of the files to compare.
   128         file2:          <SequenceableCollection> The other of the files to compare.
   129 
   129 
   130     [author:]
   130     [author:]
   131         Tony Garnock-Jones <tonyg@lshift.com>
   131         Tony Garnock-Jones <tonyg@lshift.com>
   317 "
   317 "
   318 !
   318 !
   319 
   319 
   320 documentation
   320 documentation
   321 "
   321 "
   322 A DiffChunk represents a span of items within a collection (e.g. a collection of lines representing a text file).
   322     A DiffChunk represents a span of items within a collection (e.g. a collection of lines representing a text file).
   323 
   323 
   324 Instance Variables
   324     Instance Variables
   325         length:                 <Integer> Count of lines within the chunk; 0 is permitted
   325         length:                 <Integer> Count of lines within the chunk; 0 is permitted
   326         offset:                 <Integer> Index of first line within the chunk; 1-based
   326         offset:                 <Integer> Index of first line within the chunk; 1-based
   327 
   327 
   328     [author:]
   328     [author:]
   329         Tony Garnock-Jones <tonyg@lshift.com>
   329         Tony Garnock-Jones <tonyg@lshift.com>
   456 "
   456 "
   457 !
   457 !
   458 
   458 
   459 documentation
   459 documentation
   460 "
   460 "
   461 A HuntMcilroyDiff provides a longestCommonSubsequence algorithm following Hunt and McIlroy 1976 for use by the methods on GenericDiff.
   461     A HuntMcilroyDiff provides a longestCommonSubsequence algorithm following Hunt and McIlroy 1976 for use by the methods on GenericDiff.
   462 
   462 
   463 J. W. Hunt and M. D. McIlroy, An algorithm for differential file comparison, Bell Telephone Laboratories CSTR #41 (1976).
   463     J. W. Hunt and M. D. McIlroy, An algorithm for differential file comparison, Bell Telephone Laboratories CSTR #41 (1976).
   464 http://www.cs.dartmouth.edu/~doug/
   464     http://www.cs.dartmouth.edu/~doug/
   465 
   465 
   466 Instance Variables
   466     Instance Variables
   467         lcs:            cached longest common subsequence
   467         lcs:            cached longest common subsequence
   468 
   468 
   469     [author:]
   469     [author:]
   470         Tony Garnock-Jones <tonyg@lshift.com>
   470         Tony Garnock-Jones <tonyg@lshift.com>
   471 
   471 
   602 "
   602 "
   603 !
   603 !
   604 
   604 
   605 documentation
   605 documentation
   606 "
   606 "
   607 HuntMcilroyDiffCandidate is used internally by HuntMcilroyDiff.
   607     HuntMcilroyDiffCandidate is used internally by HuntMcilroyDiff.
   608 
   608 
   609     [author:]
   609     [author:]
   610         Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
   610         Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
   611 
   611 
   612     [instance variables:]
   612     [instance variables:]
   677 "
   677 "
   678 !
   678 !
   679 
   679 
   680 documentation
   680 documentation
   681 "
   681 "
   682 I implement a modified version of Myers' greedy lcs algorithm described in http://xmailserver.org/diff2.pdf. A similar version written in C can be found here http://research.janelia.org/myers/Papers/file.comparison.pdf. Ukkonen's version can be found here http://www.cs.helsinki.fi/u/ukkonen/InfCont85.PDF.
   682     I implement a modified version of Myers' greedy lcs algorithm described in http://xmailserver.org/diff2.pdf. 
       
   683     A similar version written in C can be found here http://research.janelia.org/myers/Papers/file.comparison.pdf. 
       
   684     Ukkonen's version can be found here http://www.cs.helsinki.fi/u/ukkonen/InfCont85.PDF.
   683 
   685 
   684     [author:]
   686     [author:]
   685         Tony Garnock-Jones <tonyg@lshift.com>
   687         Tony Garnock-Jones <tonyg@lshift.com>
   686 
   688 
   687     [instance variables:]
   689     [instance variables:]
   834 ! !
   836 ! !
   835 
   837 
   836 !Diff2 class methodsFor:'documentation'!
   838 !Diff2 class methodsFor:'documentation'!
   837 
   839 
   838 version
   840 version
   839     ^ '$Header: /cvs/stx/stx/libtool/Diff2.st,v 1.2 2014-02-05 19:13:29 cg Exp $'
   841     ^ '$Header: /cvs/stx/stx/libtool/Diff2.st,v 1.3 2014-02-25 07:00:18 cg Exp $'
   840 !
   842 !
   841 
   843 
   842 version_CVS
   844 version_CVS
   843     ^ '$Header: /cvs/stx/stx/libtool/Diff2.st,v 1.2 2014-02-05 19:13:29 cg Exp $'
   845     ^ '$Header: /cvs/stx/stx/libtool/Diff2.st,v 1.3 2014-02-25 07:00:18 cg Exp $'
   844 ! !
   846 ! !
   845 
   847