My latest short project is Real Count™. Yet another word counter web page, but for voice-over actors. Numbers expand into several words, telephone numbers into many, and URLs are quite lengthy!
http://ratingstone.agmsmith.ca/server01/wordcounter
Taking a slight detour from my less evil social media web site and Ruby on Rails self education project, I helped out Dane, a voice-over actor and radio station automation purveyor (owner of Tune Tracker Systems) who had an idea. He wanted a way to count words as actually spoken, since gig economy actors are paid by the word. It wasn't worth doing as a stand-alone program or otherwise spending much time on it since the concept is easy for anyone to copy and difficult to monetise. So I decided to add it as a form on my existing web site. Should take a weekend, right? Well it did, starting on November 28 2020, but then I kept on thinking of more things to expand. Dane also liked it and added the "Real Count™" branding, and now recommends it to his fellow actors and students. So now we have publicity and real users!
Conveniently Ruby has a couple of "gems" of library code for reading out numbers as words, one was simple enough, the other was sophisticated and multinational. Since I don't expect much demand for internationalising things (been there, done that) I used the simpler one. Works great for my purposes! I ended up building on it for special cases (like telephone numbers) which I see in common situations. I also used another gem for making the colourful difference listing, showing you the changes in words. Lots of great code out there!
Of course, this can all be done by AI, and it already exists! One instance is Google's text to speech service. They charge a few dollars per million characters, and it reads them aloud to you too (in your own voice if you wish, using a waveform generation AI!). Sounds really good. There's probably a way to get the expanded script from their APIs. However, the ethics of using AI which would later replace the voice-actors makes me hesitant.
Instead I'm using lots and lots of regular expressions. I've actually used just about everything that is available in Ruby's system and am now overly familiar with that web page in the documentation :-) Each of those expandable things in the long list on the Real Count page starts with a regular expression. If you want to see the source code, have a look at https://github.com/agmsmith/RatingStone/blob/main/app/controllers/word_counter_controller.rb Of course, the regular expressions aren't perfect, so I keep on improving them. Looks like this is a month long project!
Copyright © 2020 by Alexander G. M. Smith.