5 ms·
Oh lordy, I've got a thing to say about your Javascript. You could keep the word pairs server side and retrieve them as the page is accessed... or at the very
by asdfman123 6y ago
Oh lordy, I've got a thing to say about your Javascript.
You could keep the word pairs server side and retrieve them as the page is accessed... or at the very least if you're going to store all your data in a static file you could store them in an array to save space, instead of the whole links. You could get real fancy and make some kind of soundex map thing.
Question: did you just break each word into syllables, and find soundex matches?
No worries, though, I like the compulsive punning. I just like talking about things on the internet.
- westcort 6y agoI just did string matching (on about 7.6 billion items 133000^2) and matched the pronunciation portion. It’s a fun lark.
- Xevi 6y agoWhat the... Is that a function with a 560000+ lines long comment inside of it, that gets turned into a string, then sliced, and split on newlines, then assigned to a global variable that gets used in another global function? It took a minute just to open the source code in my browser. Chrome used 5.2GB of RAM while viewing the source code, just for that tab.
- umvi 6y agoYeah! Just goes to show you can make a cool thing that is really quick and dirty under the hood. You could make this page load instantly by making the random selection happen in the backend instead of in the browser, but then I guess it would no longer just be a static file. You could also just have a compact array of pairs and then generate the sentences in the browser instead of having half a million pre-generated strings.
- deleted 6y ago[deleted]
- Gene_Parmesan 6y agoThis is one of those things I would have just assumed was impossible, so never would have tried. Not that I should try something like this, mind, but it is a good reminder not to underestimate these machines we have.