Exemple #1
0
                    elif isinstance(brev[ket],
                                    list) and ket == 'representative':
                        if len(brev[ket]) == 0:
                            tempo2[ket] = 0
                        else:
                            tempo2[ket] = max(brev[ket])
                    elif isinstance(brev[ket],
                                    list) and ket == 'family lenght':
                        tempo2[ket] = max(brev[ket])
                    else:
                        pass
                else:
                    tempo2[ket] = 0
    #        print compt
    #next function will split each patent wich as multivaluated entries in a list of patents for each multivaluated one (hope its clear :-) )
            tempoBrev = DecoupeOnTheFly(tempo2, [])
            LstExp2.extend([res for res in tempoBrev if res not in LstExp2])
    #        for thing in pat:
    #            LstExp2.append(byteify(thing))
    #        try:
    #            contenu2 = json.dumps(LstExp2,  indent = 3) #,
    #        except:
    #            print "error, compt=", compt
    #            contenu2 = json.dumps(LstExp2,  indent = 3, ensure_ascii=True) #,

        print("Expanded to ", len(LstExp2), " lines with monomavue colums")
        #    with open(ListBiblioPath + '//Expanded' + ndf, 'w') as SavFic:
        #        pickle.dump(LstExp2, SavFic) if "Families" not in ndf:

        #    Exclude = []
        print("entering formating html process")
Exemple #2
0
                else:
                    pat[key] = ''
            if 'CitO' in list(pat.keys()):
                if pat['CitO'] != '' and pat['CitO'] != []:
                    pat['CitO'] = [
                        thing.replace('\n', ' ') for thing in pat['CitO']
                    ]
                    if isinstance(pat['CitO'], list):
                        pat['CitO'] = [
                            Cleaning(truc)[0:14] for truc in pat['CitO']
                            if Cleaning(truc) is not None
                        ]

                    else:
                        pat['CitO'] = Cleaning(pat['CitO'])[0:14]
            tempoBrev = DecoupeOnTheFly(pat, ['prior-dateDate'])
            pattents = [res for res in tempoBrev if res not in ListeBrevet]
            ListeBrevet.extend(pattents)
            if pat['label'] not in Patents:
                Patents.add(pat['label'])

        for lab in Patents:
            temp = []

            for bre in [brev for brev in ListeBrevet if brev['label'] == lab]:
                for cat in mixNet:
                    if (bre[cat], cat) not in temp:
                        temp.append((bre[cat], cat))
                        Dates = []
                        tempo = bre['date'].split('-')
                        Dates.append(