daterecognition/parser.py
def find_repeat_matches(self, query_string, sub_string, pattern):
        "Find duplicate dates in same string"
        qs = copy.deepcopy(query_string)
        ret_list = []
        while True:
            orig_string = copy.deepcopy(qs)
            flag = False
            if sub_string in orig_string:
                ret_list.append((sub_string, orig_string.index(
                    sub_string), orig_string.index(sub_string) + len(sub_string) - 1, pattern))
                qs = copy.deepcopy(orig_string[:orig_string.index(sub_string)] + " " * len(
                    sub_string) + orig_string[orig_string.index(sub_string) + len(sub_string):])
                flag = True
            if not flag:
                break
        return ret_list
Find duplicate dates in same string
Find duplicate dates in same string
Find duplicate dates in same string
def find_repeat_matches(self, query_string, sub_string, pattern):
        qs = copy.deepcopy(query_string)
        ret_list = []
        while True:
            orig_string = copy.deepcopy(qs)
            flag = False
            if sub_string in orig_string:
                ret_list.append((sub_string, orig_string.index(
                    sub_string), orig_string.index(sub_string) + len(sub_string) - 1, pattern))
                qs = copy.deepcopy(orig_string[:orig_string.index(sub_string)] + " " * len(
                    sub_string) + orig_string[orig_string.index(sub_string) + len(sub_string):])
                flag = True
            if not flag:
                break
        return ret_list
def find_repeat_matches ( self , query_string , sub_string , pattern ) : qs = copy . deepcopy ( query_string ) ret_list = [ ] while True : orig_string = copy . deepcopy ( qs ) flag = False if sub_string in orig_string : ret_list . append ( ( sub_string , orig_string . index ( sub_string ) , orig_string . index ( sub_string ) + len ( sub_string ) - 1 , pattern ) ) qs = copy . deepcopy ( orig_string [ : orig_string . index ( sub_string ) ] + " " * len ( sub_string ) + orig_string [ orig_string . index ( sub_string ) + len ( sub_string ) : ] ) flag = True if not flag : break return ret_list
Find duplicate dates in same string
Find duplicate dates in same string
"Find duplicate dates in same string"
self
query_string
sub_string
pattern