<commit_before>from subfind.release.alice import ReleaseScoringAlice

__author__ = 'hiepsimu'
import logging
import unittest

logging.basicConfig(level=logging.DEBUG)


class ReleaseScoringAliceTestCase(unittest.TestCase):
    def test_01(self):
        """
        Release which match the movie title should be the higher priority

        :return:
        :rtype:
        """
        scoring = ReleaseScoringAlice()
        input_release_name = 'Survivor.2014.1080p.BluRay.H264.AAC-RARBG'

        found_releases = [
            {'name': 'The.Hobbit.The.Battle.of.the.Five.Armies.2014.1080p.BluRay.H264.AAC-RARBG'},
            {'name': 'Survivor.2015.1080p.BluRay.H264.AAC-RARBG'},
        ]
        scoring.sort(input_release_name, found_releases)

        self.assertEqual('Survivor.2015.1080p.BluRay.H264.AAC-RARBG', found_releases[0]['name'])

if __name__ == '__main__':
    unittest.main()<commit_msg>update test case for jaccard<commit_after>from pprint import pprint

from subfind.release.alice import ReleaseScoringAlice

__author__ = 'hiepsimu'
import logging
import unittest

logging.basicConfig(level=logging.DEBUG)


class ReleaseScoringAliceTestCase(unittest.TestCase):
    def test_01(self):
        """
        Release which match the movie title should be the higher priority

        :return:
        :rtype:
        """
        scoring = ReleaseScoringAlice()
        input_release_name = 'Survivor.2014.1080p.BluRay.H264.AAC-RARBG'

        found_releases = [
            {'name': 'The.Hobbit.The.Battle.of.the.Five.Armies.2014.1080p.BluRay.H264.AAC-RARBG'},
            {'name': 'Survivor.2015.1080p.BluRay.H264.AAC-RARBG'},
        ]
        scoring.sort(input_release_name, found_releases)

        self.assertEqual('Survivor.2015.1080p.BluRay.H264.AAC-RARBG', found_releases[0]['name'])

    def test_02(self):
        """
        Test 100% match

        :return:
        :rtype:
        """
        scoring = ReleaseScoringAlice()
        input_release_name = '400.Days.2015.1080p.BluRay.H264.AAC-RARBG'

        found_releases = [
            {'name': '400.Days.2015.1080p.BluRay.H264.AAC-RARBG'},
            {'name': '400.Days.2015.720p.BluRay.H264.AAC-RARBG'},
            {'name': '400.Days.2015.BRRip.XviD.AC3-RARBG'},
            {'name': '400.Days.2015.1080p.BluRay.H264.AAC-RARBG'},
            {'name': '400.Days.2015.720p.BluRay.x264.[YTS.AG]'},
        ]
        scoring.sort(input_release_name, found_releases)
        # pprint(found_releases)

        self.assertEqual('400.Days.2015.1080p.BluRay.H264.AAC-RARBG', found_releases[0]['name'])

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.1338403041825095, 'fraction_numerical': 0.07224334600760456, 'mean_word_length': 2.763948497854077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6417102', 'n_tokens_mistral': 1090, 'n_tokens_neox': 923, 'n_words': 124}