Data update

This commit is contained in:
Ingy döt Net 2023-12-16 21:33:55 -08:00
parent 35bcdeebf8
commit 74c69a0df6
2427 changed files with 31826 additions and 3468 deletions

View file

@ -0,0 +1,21 @@
library(stringi)
abbrev <- function(w) {
w1 <- stri_split_fixed(w," ") %>% unlist()
if (length(w1) != 7) stop("Error: not enough days in the week.")
maxv <- max(sapply(w1,\(x) nchar(x)))
for (i in 1:maxv) {
tl <- stri_sub(w1,1,i) %>% unique() %>% length()
if (tl == 7) return(i)
}
}
# Main
lines <- readLines("daysOfWeek.txt")
for (l in lines) {
if (nchar(l) == 0) {
cat("\n")
} else {
cat(paste(abbrev(l),l),"\n")
}
}

View file

@ -1,7 +1,7 @@
import "io" for File
import "/pattern" for Pattern
import "/seq" for Lst
import "/fmt" for Fmt
import "./pattern" for Pattern
import "./seq" for Lst
import "./fmt" for Fmt
var p = Pattern.new("+1/s")
var lines = File.read("days_of_week.txt").split("\n").map { |l| l.trim() }