Monday, May 22, 2006

Moby II - the sequel

Well Moby I (the original version of the wirdz English Thesaurus) had a pretty short release life. With potentially hundreds of index matches (and corresponding word lists) for a single word, something had to be done. So after less than 24 hours, version 2 was released.

The new version has 2 search modes:


  • Root word matches only


  • All matches against the index


  • For the latter, the initial display shows only the matched word, the root word and a plus on minus sign used to show or hide the word list itself. This uses the display style property of the container divs for the word list and the two images as follows:

    // On click event for the plus sign
    expandDiv("divList"); 
    contractDiv("divPlus"); 
    expandDiv("divMinus");
    
    // On click event for the minus sign
    contractDiv("divList"); 
    contractDiv("divMinus"); 
    expandDiv("divPlus");
    
    // The Javascript Div expand and contract functions
    function expandDiv(divid) {
      if (document.layers) {
        document.layers[divid].display="block";
      }
      else {
        document.getElementById(divid).style.display="block";
      }  
    }
    
    function contractDiv(divid) {
      if (document.layers) {
        document.layers[divid].display="none";
      }
      else {
        document.getElementById(divid).style.display="none";
      }
    }

    Standard stuff but still pretty nifty in practice. In this case, usability is significantly improved - the Moby Thesaurus is such a monster that some level of paging through word lists is pretty much unavoidable. The Roget's Thesaurus (1911 public domain edition with updates) is much smaller (circa 1000 categories/word groups). This may well be a later addition to the wirdz site.

    0 Comments:

    Post a Comment

    << Home