test_class.file: descriptor/fingerprint/src/test/java/org/openscience/cdk/similarity/LingoSimilarityTest.java
test_class.identifier: LingoSimilarityTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testLingoSim() throws Exception {
          IAtomContainer mol1 = TestMoleculeFactory.makeIndole();
          IAtomContainer mol2 = TestMoleculeFactory.makeIndole();
          addImplicitHydrogens(mol1);
          addImplicitHydrogens(mol2);
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1);
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2);
          LingoFingerprinter fingerprinter = new LingoFingerprinter();
          Map<String, Integer> bs1 = fingerprinter.getRawFingerprint(mol1);
          Map<String, Integer> bs2 = fingerprinter.getRawFingerprint(mol2);
          float lingosim = LingoSimilarity.calculate(bs1, bs2);
          Assert.assertEquals(1.0, lingosim, 0.01);
      }
test_case.class_method_signature: LingoSimilarityTest.testLingoSim()
test_case.full_signature: @Test public void testLingoSim()
test_case.identifier: testLingoSim
test_case.invocations: makeIndole makeIndole addImplicitHydrogens addImplicitHydrogens percieveAtomTypesAndConfigureAtoms percieveAtomTypesAndConfigureAtoms getRawFingerprint getRawFingerprint calculate assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLingoSim()
focal_class.file: descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/LingoSimilarity.java
focal_class.identifier: LingoSimilarity
focal_class.class_method_signature: LingoSimilarity.LingoSimilarity()
focal_class.full_signature: private  LingoSimilarity()
focal_class.identifier: LingoSimilarity
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  LingoSimilarity()
focal_class.class_method_signature: LingoSimilarity.calculate(Map<String, Integer> features1, Map<String, Integer> features2)
focal_class.full_signature: public static float calculate(Map<String, Integer> features1, Map<String, Integer> features2)
focal_class.identifier: calculate
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Integer> features1, Map<String, Integer> features2)
focal_class.return: float
focal_class.signature: float calculate(Map<String, Integer> features1, Map<String, Integer> features2)
focal_method.body: public static float calculate(Map<String, Integer> features1, Map<String, Integer> features2) {
          TreeSet<String> keys = new TreeSet<String>(features1.keySet());
          keys.addAll(features2.keySet());
  
          float sum = 0.0f;
          for (String key : keys) {
              Integer c1 = features1.get(key);
              Integer c2 = features2.get(key);
  
              c1 = c1 == null ? 0 : c1;
              c2 = c2 == null ? 0 : c2;
              sum += 1.0 - Math.abs(c1 - c2) / (c1 + c2);
          }
  
          return sum / keys.size();
      }
focal_method.class_method_signature: LingoSimilarity.calculate(Map<String, Integer> features1, Map<String, Integer> features2)
focal_method.full_signature: public static float calculate(Map<String, Integer> features1, Map<String, Integer> features2)
focal_method.identifier: calculate
focal_method.invocations: keySet addAll keySet get get abs size
focal_method.modifiers: public static
focal_method.parameters: (Map<String, Integer> features1, Map<String, Integer> features2)
focal_method.return: float
focal_method.signature: float calculate(Map<String, Integer> features1, Map<String, Integer> features2)