Extension Of Similarity Functions And Their Application To Chemical Informatics Problems