@@ -26,7 +26,7 @@ Additionally, the following is implemented on top of it:
2626The core algorithm outputs a set of instructions to get from ` SeqA ` to ` SeqB ` , something like this:
2727
2828```
29- to get from s1="bcdefgzio" to s2="abcxyfgi") :
29+ in order to get from s1="bcdefgzio" to s2="abcxyfgi":
3030
3131Insert a from s2 before position 0 into s1.
3232Delete d from s1 at position 2 in s1.
@@ -54,16 +54,16 @@ object DiffElement {
5454
5555The result of the interpretation (without any transformations applied) for the same example:
5656
57+ ``` scala
58+ StringDiff
59+ .raw(
60+ " bcdefgzio" ,
61+ " abcxyfgi" ,
62+ collapse = false
63+ ).mkString(" [\n " , " \n " , " \n ]" )
5764```
58- println(
59- StringDiff
60- .raw(
61- "bcdefgzio",
62- "abcxyfgi",
63- collapse = false
64- ).mkString("[\n ", "\n ", "\n]")
65- )
6665
66+ ```
6767[
6868 InSecond(a)
6969 InBoth(bc)
@@ -82,16 +82,16 @@ The result of the interpretation (without any transformations applied) for the s
8282
8383By default, diff functions will collapse the diff:
8484
85+ ``` scala
86+ StringDiff
87+ .raw(
88+ " bcdefgzio" ,
89+ " abcxyfgi" ,
90+ collapse = true // default is true
91+ ).mkString(" [\n " , " \n " , " \n ]" )
8592```
86- println(
87- StringDiff
88- .raw(
89- "bcdefgzio",
90- "abcxyfgi",
91- collapse = true // default is true
92- ).mkString("[\n ", "\n ", "\n]")
93- )
9493
94+ ```
9595[
9696 InSecond(a)
9797 InBoth(bc)
@@ -101,18 +101,22 @@ By default, diff functions will collapse the diff:
101101 InBoth(i)
102102 InFirst(o)
103103]
104+ ```
104105
105106Here, the following list of DiffElements:
106107
108+ ```
107109[
108110 InFirst(d)
109111 InSecond(x)
110112 InSecond(y)
111113 InFirst(e)
112114]
115+ ```
113116
114117got collapsed into a single one:
115-
118+
119+ ```
116120[
117121 Diff(de,xy)
118122]
@@ -130,15 +134,15 @@ Examples:
130134
131135### Diff'ing sequences:
132136
137+ ``` scala
138+ SeqDiff
139+ .seq(
140+ Seq (1 , 2 , 3 , 4 , 5 ).toIndexedSeq,
141+ Seq (1 , 2 , 8 , 3 , 8 , 4 , 5 , 0 ).toIndexedSeq
142+ ).mkString(" [\n " , " \n " , " \n ]" )
143+ ```
144+
133145```
134- println(
135- SeqDiff
136- .seq(
137- Seq(1, 2, 3, 4, 5).toIndexedSeq,
138- Seq(1, 2, 8, 3, 8, 4, 5, 0).toIndexedSeq
139- ).mkString("[\n ", "\n ", "\n]")
140- )
141-
142146[
143147 InBoth(Vector(1, 2))
144148 InSecond(Vector(8))
@@ -161,6 +165,7 @@ Raw diff:
161165 )
162166 )
163167```
168+
164169```
165170[
166171 InSecond(a)
0 commit comments