Skip to content

Instantly share code, notes, and snippets.

@gzomer
gzomer / Grammarly-gDocsCanvasInjectedCs.js
Last active August 30, 2023 14:47
Grammarly-gDocsCanvasInjectedCs - Google Docs Canvas integration
(function () {
Error;
console.log('aca')
function e(t, n, o) {
const r = o();
return t > 0 ? r.catch((r) => new Promise((e, t) => setTimeout(e, n)).then((r) => e(t - 1, n, o))) : r;
}
var t;
!(function (e) {
function t() {
def build_markov_chain(data, n):
chain = {
'_initial':{},
'_names': set(data)
}
for word in data:
word_wrapped = str(word) + '.'
for i in range(0, len(word_wrapped) - n):
tuple = word_wrapped[i:i + n]
next = word_wrapped[i + 1:i + n + 1]