Tag Archives: dictionary

ADMIN: Site layout and Dictionary reworked

As you can see, I’ve reworked the site layout. Actually, this started when I felt like generally reworking the dictionary front- and querying backend some two weeks ago.

Back when I designed the old layout of the site, I just made a hard copy of the theme my design was based on, unaware that it’s much easier and space-saving to simply create a child theme. I’ve done so now, hopefully giving you a still functional way to access this website, in spite of all the CSS styling bells and whistles I couldn’t resist playing with.

As for the dictionary, it’s always annoyed me a little that there were two subpages for searching – one for simple queries, one for more complex ones – that repeated more or less the same (terrible and messy) code also in two separate PHP files that would do the database requests. I’ve now condensed everything into just one file each, i.e. one page for the form presented to users and one file for querying the database. I’ve also rewritten the querying script from scratch, so I hope I didn’t break any functionality. Due to my lack in expertise on MySQL, I wasn’t yet able to make querying tags for dictionary entries possible. I may want to try and find out and add this function later, though. One thing that I managed to add easily, however, is suggesting existing, similar-sounding entries from the database if a search didn’t return any results. This is achieved with MySQL’s SOUNDEX( ) function, which has an anglocentric caveat, though:

This function, as currently implemented, is intended to work well with strings that are in the English language only. Strings in other languages may not produce reliable results.
— MySQL 5.6 Reference Manual

I think it still works OK, though. You can test this by searching, for example, for *tounce.

  • “SOUNDEX(str).” MySQL 5.6 Reference Manual. MySQL. Revision 33321. Oracle, 2012. Web. 1 Dec. 2012. ‹http://dev.mysql.com/
  • Search by tags is possible as well now after some more tinkering, but note that so far, only rather recent additions to the dictionary have been tagged. Since I’ve recently added a whole bunch of vulgarities, don’t be surprised if you get a whole lot of entries for naughty words.