Exemplo n.º 1
0
def find(db, pid, isre, subset):
    if pid in db:
        subset[pid] = db[pid]
    else:
        match = pid.lower()
        for ppid, p in db.items():
            title = p.title
            if isre:
                if re.match(pid, title):
                    subset[ppid] = p
            else:
                s = title.lower()
                s = Utils.removeAccents(s)
                if s.find(match) != -1:
                    subset[ppid] = p
Exemplo n.º 2
0
def find(db, pid, isre, subset):
    if pid in db:
        subset[pid] = db[pid]
    else:
        match = pid.lower()
        for ppid, p in db.items():
            title = p.title
            if isre:
                if re.match(pid, title):
                    subset[ppid] = p
            else:
                s = title.lower()
                s = Utils.removeAccents(s)
                if s.find(match) != -1:
                    subset[ppid] = p