A syntax corrector with Codex

1 · Shane Mulligan · Sept. 1, 2021, 11:12 a.m.
Summary I just demonstrate the usage of a syntax corrector with Pen.el and codex. This is a lot like the spelling and grammar corrector prompt with GPT-3 Davinci. Demo -- Bad awk code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 if NR >= window_size && (effective_nr % step == 0) { s = "" for (i=1; i<window_size; i++) { s = s memory[i] RS } s = s memory[window_size] printf("(%s)", s) |& cmd close(cmd, "to"); $0 = "" + "my string"; brs=RS RS="##long read##" cmd |& getline $0; fflush(cmd); cl...