code: public static double oliverSimilarity(String text1, String text2) {
          preprocessDocument(text1);
          preprocessDocument(text2);
  
          String smallerDoc=text1;
          String biggerDoc=text2;
          if(text1.length()>text2.length()) {
              smallerDoc=text2;
              biggerDoc=text1;
          }
  
          double p=PHPSimilarText.similarityPercentage(smallerDoc, biggerDoc);
          p/=100.0;
  
          return p;
      }
docs: This calculates the similarity between two strings as described in Programming
  Classics: Implementing the World's Best Algorithms by Oliver (ISBN 0-131-00413-1).
  
  @param text1
  @param text2
  @return