Skip to content

Instantly share code, notes, and snippets.

#*-*encoding: utf-8*-*
import re
PATTERN = re.compile('^(http[s]?|ftp):\/?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$')
class Search(object):
"""docstring for ClassName"""
def __init__(self):
self.list_of_links = self.get_links()
# -*- coding: utf-8 -*-
from difflib import SequenceMatcher
def f1(string_list):
d = {}
for s in string_list:
d[s] = score(s, string_list)
return d
def score(string, string_list):
# -*- coding: utf-8 -*-
import os, sys, re
lib_path = os.path.realpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'lib'))
if lib_path not in sys.path:
sys.path[0:0] = [lib_path]
# Main
import json
import random