Skip to content

Commit f1a180c

Browse files
committed
fix minimization and python tokenizer
1 parent 74264ca commit f1a180c

File tree

1 file changed

+2
-2
lines changed
  • src/commonMain/kotlin/ai/hypergraph/kaliningraph/repair

1 file changed

+2
-2
lines changed

src/commonMain/kotlin/ai/hypergraph/kaliningraph/repair/PatchUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ val COMMON_BRACKETS = "()[]{}".map { "$it" }.toSet()
1212
fun Σᐩ.defaultTokenizer(): List<Σᐩ> =
1313
split(Regex("[\\(\\)\\[\\]{}]|___".let { "((?<=($it))|(?=($it)))" }))
1414

15-
fun minimizeFix(
15+
fun minimizeFixStr(
1616
broke: Σᐩ,
1717
tokenize: Σᐩ.() -> List<Σᐩ>,
1818
fixed: Σᐩ,
@@ -136,7 +136,7 @@ fun List<Int>.minimalSubpatches(filter: List<Int>.() -> Boolean): Sequence<List<
136136
fun List<Pair<Int, Int>>.apply(indices: List<Int>): List<Int> =
137137
mapIndexed { i, it -> if (i in indices) it.second else it.first }
138138

139-
fun Patch.apply(indices: List<Int>, separator: Σᐩ = ""): Σᐩ =
139+
fun Patch.apply(indices: List<Int>, separator: Σᐩ = " "): Σᐩ =
140140
mapIndexed { i, it -> if (i in indices) it.new else it.old }.joinToString(separator)
141141

142142
fun Patch.apply(separator: Σᐩ = ""): Σᐩ = joinToString(separator) { it.new }

0 commit comments

Comments
 (0)