# Path: chirp/library/similarity.py
# def canonicalize_string(txt):
# def get_sort_key(text):
# def get_levenshtein_distance(string_1, string_2, max_value=None):
# def get_common_prefix(string_1, string_2):


import unittest
from chirp.library import similarity
#!/usr/bin/env python

###
### A unit test for similarity.py.
###



class CanonicalizeStringTest(unittest.TestCase):

    def test_basic(self):
        test_cases = (
            ("", u""),
            ("   ", u""),
            (u"foo", u"foo"),
            ("foo. bar.", u"foobar"),
            ("foo &   Bar  ", u"foo&bar"),
            ("The Foo and Bar", u"foo&bar"),
            ("Foo!!!", u"foo"),
            ("!!!!", u"!!!!"),
            )
        for before, after in test_cases:
            self.assertEqual(after, similarity.canonicalize_string(before))


class LevenshteinDistanceTest(unittest.TestCase):

    def test_basic(self):
        test_cases = (

# Path: chirp/library/similarity.py
# def canonicalize_string(txt):
# def get_sort_key(text):
# def get_levenshtein_distance(string_1, string_2, max_value=None):
# def get_common_prefix(string_1, string_2):


# Path: chirp/library/similarity_test.py
import unittest
from chirp.library import similarity

#!/usr/bin/env python

###
### A unit test for similarity.py.
###



class CanonicalizeStringTest(unittest.TestCase):

    def test_basic(self):
        test_cases = (
            ("", u""),
            ("   ", u""),
            (u"foo", u"foo"),
            ("foo. bar.", u"foobar"),
            ("foo &   Bar  ", u"foo&bar"),
            ("The Foo and Bar", u"foo&bar"),
            ("Foo!!!", u"foo"),
            ("!!!!", u"!!!!"),
            )
        for before, after in test_cases:
            self.assertEqual(after, similarity.canonicalize_string(before))


class LevenshteinDistanceTest(unittest.TestCase):

    def test_basic(self):
        test_cases = (

            (0, "", ""),