reth

the display name is my initials

experimenting and all that.
chief executive dysfunction officer. few of my posts are high-effort, but at least they're funny.
current avatar is an old art by fireflufferz because i'm bored with having michiru pfps.
.-.-.-.-.-.

lastfm listening



cathoderaydude
@cathoderaydude

predictive text engine where you put in terms like "i18n" and it works out what you must have meant and expands them. any number found in a word acts as a "there's some number of letters here", even if you provide additional letters in the middle of the word. "i10alization" works. "i4n4n8n" works. "authoritarianism" can be "a14m", but if you find that's coming up with another word, you can put "tar" in the middle to hint at it: a6tar5m


reth
@reth

bit messy, but i threw this together as a proof of concept of course, might do a js rewrite and put it on a website, so that it computes locally and opens google with the end result as query.

edit: yes yes, i know the isalpha pass is useless and that i forgot to check for beginning/end of a word, but i fixed that already. not gonna update the screenshot.

editedit: it’s on codeberg now! https://codeberg.org/reth/s4h


You must log in to comment.

in reply to @cathoderaydude's post:

i mean… a dictionary of words, some code to transform a query to regex, then pick the first word that works from the dictionary, build the query and redirect to google with that search query parameter. it can’t be that hard to make as a little web app, can it? minus the processing power of regex search, of course.

Perhaps it could be made more efficient like this:

For each word, find all unique shortened forms. Only keep the canonical one (the shortest, first in alphabetical order). Repeat until no more words can be shortened.

This way, noncanonical shortened forms are freed up for other words. (No word is shortened more than once. On each round, the order in which the remaining words are shortened does not matter.)

An example with four made-up words:

  • aabaa, aabee, eebee, eeboo
  • 2baa, aabee, eebee, 2boo
  • 2baa, aab2, eeb2, 2boo