What was that song, the one with the words?

My wife and I are both big music lovers, and I’m happy to have influenced her listening habits a bit and have loved what she’s introduced me to. Given we both love music, we’ve also been known to sing along at times. (You can take a guess as to how well that goes.) She normally gets the lyrics right. I’m normally a bit more… loose in terms of how well I remember the lyrics. I was thinking about this and was curious how well AI could be used to identity lyrics and match them to a song, especially when the lyrics may not be exactly right. I spent some time hacking on it and here’s what I built. Strike One I meant to type take one, accidentally wrote strike one,... more →
Posted in: JavaScript

Counting Words with Intl.Segmenter

Yesterday, I gave my presentation on Intl, the browser’s built-in support for internationalization. I’ve been using this for a while now, but while researching the spec for my presentation, I ran into multiple cool aspects of it I wasn’t aware of. One feature I thought was particularly interesting was the Segementer object. MDN’s description is nice and succinct: The Intl.Segmenter object enables locale-sensitive text segmentation, enabling you to get meaningful items (graphemes, words or sentences) from a string. In particular, I thought the ability to get words would be an interesting use case. In the past, I’ve either done a lame split on " ", or used... more →
Posted in: JavaScript