Skip to content

Commit

Permalink
explain evaluation more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Mar 29, 2024
1 parent d2c5420 commit 6686135
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import kotlin.to
fun main() {
// MAX_UNIQUE = 1_000
TIMEOUT_MS = 30_000
MAX_TOKENS = 79
// MAX_TOKENS = 40
// MAX_RADIUS = 3
CFG_THRESH = 10_000
evaluateBarHillelRepairOnStackOverflow()
// evaluateSeq2ParseRepair()
// evaluateBIFIRepair()
}

val LEN_BUCKET_INTERVAL = 10
val LEN_BUCKET_INTERVAL = 5

fun readPCFG3() =
File(File("").absolutePath + "/src/main/resources/models/pcfg3_BIFI.csv").readText()
Expand Down Expand Up @@ -269,13 +269,12 @@ val sizeAndDistBalancedRepairsUnminimized: Sequence<Π2A<Σᐩ>> by lazy {

val corruptedBIFIGoodCode by lazy {
readBIFIContents()
.map { it.mapToUnquotedPythonTokens() }
.map { it.mapToUnquotedPythonTokens().addNewLineIfMissing() }
.filter {
it.tokenizeByWhitespace().size in 3..MAX_TOKENS &&
it !in vanillaS2PCFG.language
it in vanillaS2PCFG.language
}
.flatMap { goodCodeTks ->
val goodCode = "$goodCodeTks NEWLINE"
.flatMap { goodCode ->
goodCode.nautralPythonCorruptions().distinct().filter {
levenshtein(goodCode, it) <= MAX_RADIUS &&
it !in vanillaS2PCFG.language
Expand Down

0 comments on commit 6686135

Please sign in to comment.