Skip to content

Commit b4be510

Browse files
ready for review
1 parent 4db19bf commit b4be510

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/compareDataFrames.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class ComparisonDescription(
2121
*/
2222
internal fun <T> compareDataFramesImpl(dfA: DataFrame<T>, dfB: DataFrame<T>): DataFrame<ComparisonDescription> {
2323
var comparisonDf = emptyDataFrame<ComparisonDescription>()
24-
// make the comparison exploiting Myers difference algorithm
24+
// compare by exploiting Myers difference algorithm
2525
val shortestEditScript = myersDifferenceAlgorithmImpl(dfA, dfB)
2626
var x: Int?
2727
var y: Int?
@@ -33,20 +33,20 @@ internal fun <T> compareDataFramesImpl(dfA: DataFrame<T>, dfB: DataFrame<T>): Da
3333
xPrev = shortestEditScript[i - 1].first
3434
yPrev = shortestEditScript[i - 1].second
3535
when {
36-
// row in position 'x' of dfA was removed
36+
// row at index 'x-1' of dfA was removed
3737
xPrev + 1 == x && yPrev + 1 != y -> {
3838
comparisonDf = comparisonDf.concat(
3939
dataFrameOf
40-
(ComparisonDescription(x-1, "dfA", true, null, null)),
40+
(ComparisonDescription(x - 1, "dfA", true, null, null)),
4141
)
4242
}
4343

44-
// row in position 'y' of dfB was inserted after row in position 'x' of dfA
44+
// row at index 'y-1' of dfB was inserted after row in position 'x-1' of dfA
4545
yPrev + 1 == y && xPrev + 1 != x -> {
4646
comparisonDf = comparisonDf.concat(
4747
dataFrameOf(
4848
ComparisonDescription
49-
(y-1, "dfB", null, true, x-1),
49+
(y - 1, "dfB", null, true, x - 1),
5050
),
5151
)
5252
}
@@ -56,7 +56,7 @@ internal fun <T> compareDataFramesImpl(dfA: DataFrame<T>, dfB: DataFrame<T>): Da
5656
}
5757

5858
/**
59-
* dfs with same schema. Returns the path from origin to (N,M) in the edit graph.
59+
* dfs with same schema. Returns an optimal path from origin to (N,M) in the edit graph.
6060
* N is dfA.nrow, M is dfB.nrow.
6161
* Knowing this path is knowing the differences between dfA and dfB
6262
* and the shortest edit script to get B from A.

0 commit comments

Comments
 (0)