Skip to content

Instantly share code, notes, and snippets.

@solidfox
Created January 14, 2015 17:25
Show Gist options
  • Save solidfox/5f2dab3fb4a21390e4e5 to your computer and use it in GitHub Desktop.
Save solidfox/5f2dab3fb4a21390e4e5 to your computer and use it in GitHub Desktop.
expected_result_for_length = [
(1, 0.849),
(2, 0.580),
(3, 0.478),
(4, 0.439),
(5, 0.406),
(6, 0.370),
]
str1 = "science is organized knowledge"
str2 = "wisdom is organized life"
for plambda in linspace(0, 1, 30):
for length, expected_result in expected_result_for_length:
actual_result = SSK(length, plambda, str1, str2)
self.assertAlmostEqual(expected_result, actual_result, delta=0.001, msg="Failed for length %i. %f != %f" % (length, actual_result, expected_result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment