Skip to content

Instantly share code, notes, and snippets.

@serid
Created February 9, 2025 15:08
Show Gist options
  • Save serid/cb634d6522bfb06f8a3bb269e98179c3 to your computer and use it in GitHub Desktop.
Save serid/cb634d6522bfb06f8a3bb269e98179c3 to your computer and use it in GitHub Desktop.
import { toString, map, filter } from './util.js'
async function main() {
let txt = await (await fetch('1.txt')).text()
let sanaset = txt.matchAll(/\w*/g)
sanaset = map(sanaset, x=>x[0])
sanaset = filter(sanaset, x=>x!=='')
sanaset = map(sanaset, x=>x.toLowerCase())
sanaset = Object.fromEntries(sanaset.map(k => [k,'']));
//document.getElementById('out').innerText = toString(sanaset)
let s = ''
for (let x in sanaset) {
s += x+'\n'
}
document.getElementById('out').innerText = s
}
await main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment