Development Cycles
  Home arrow Development Cycles arrow Page 3 - How to Strike a Match
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DEVELOPMENT CYCLES

How to Strike a Match
By: Simon White
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 35
    2004-04-07

    Table of Contents:
  • How to Strike a Match
  • The New Metric
  • A Real World Example
  • A Java Implementation
  • Finishing the Java Implementation
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Strike a Match - A Real World Example


    (Page 3 of 6 )

    Now for an example that is a little closer to the real world. Suppose we are building a web site that sells books, and we want to allow our users to type in a string to search against the titles of books in our database. When the user’s string does not exactly match any of the books in our database, we return a list of the books whose title is most similar.

    Table 2 contains a list of book titles in its first column. If we search against these book titles with the query strings ‘Web Database Applications’, ‘PHP Web Applications’ and ‘Web Aplications’ using the metric described, then we get the results shown in the six right-most columns of the table.  (Note the intentional misspelling of ‘Applications’ in the third of these strings.) The ‘Rank’ columns indicate the order in which the books would be returned. Each rank is qualified by its corresponding percentage similarity value (rounded to the nearest whole number) in the next column. The three input strings were carefully chosen to target the book ‘Web Database Applications with PHP & MySQL’, but with a decreasing quality of input string as you move from ‘Web Database Applications’ to ‘Web Aplications’

    Web Database ApplicationsPHP Web ApplicationsWeb Aplications
    Book TitleRankValueRankValueRankValue
    Web Database Applications with PHP & MySQL182%168%159%
    Creating Database Web Applications with PHP and ASP271%359%350%
    Building Database Applications on the Web Using PHP3370%458%449%
    Building Web Database Applications with Visual Studio 6467%547%546%
    Web Application Development with PHP551%267%256%
    WebRAD: Building Database Applications on the Web with Visual FoxPro and Web Connection649%634%632%
    Structural Assesment: The Role of Large and Full Scale Testing712%87%87%
    How to Find a Scholarship Online810%711%712%

     Table 2: Three Searches for a Book

    Two main results are shown in the table. Firstly, the targeted book is scored as the top match in each case, and secondly, the similarity values decrease as you move left to right in the table, reflecting the intended degradation in the quality of the input.

    When presenting results of searches to users, you would normally set a threshold value of say, 20%, and only show the top 10 or so results that lie above the threshold. (We wouldn’t want to lose the trust of our users by showing results that are irrelevant.)

    It is worth pointing out that I devised this example by searching the books at Amazon.com with exactly the same three input strings as shown above, and selecting the top matches. Interestingly, for the third query ‘Web Aplications’, Amazon does not show any web application development books in its search results. In fact, Amazon’s top match is ‘How to Find a Scholarship Online’, a result which appears to confuse writing web applications with writing applications on the web! This suggests that Amazon’s search mechanism is not robust to spelling errors, but nevertheless uses a similarity metric based on product descriptions in an attempt to return a good match.

    More Development Cycles Articles
    More By Simon White


     

    DEVELOPMENT CYCLES ARTICLES

    - Branch and Bound Algorithm Technique
    - Dynamic Programming Algorithm Technique
    - Genetic Algorithm Techniques
    - Greedy Strategy as an Algorithm Technique
    - Divide and Conquer Algorithm Technique
    - The Backtracking Algorithm Technique
    - More Pattern Matching Algorithms: B-M
    - Pattern Matching Algorithms Demystified: KMP
    - Coding Standards
    - A Peek into the Future: Transactional Memory
    - Learning About the Graph Construct using Gam...
    - Learning About the Graph Construct using Gam...
    - Learning About the Graph Construct using Gam...
    - How to Strike a Match
    - Entity Relationship Modeling






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT