1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import logging, os, os.path, string
20
21
23 """ Lit un fichier dans le dossier courant et renvoie une chaine """
24 path=os.path.join(os.getcwd(),"MediteAppli","test",name)
25 f = open(path)
26 res = f.read()
27 f.close()
28 return res
29
31 comite = _readFile('comite.txt')
32 papers = _readFile('papers.txt')
33 lcom = comite.splitlines()
34 logging.debug('# comite='+str(len(lcom)))
35 sepTable = string.maketrans("""\r\n\t"""," ")
36 i = 0
37 for c in lcom:
38 liste_nom = c.split()
39 nom = liste_nom[-1]
40 pos = papers.find(nom)
41 if pos != -1:
42 p = papers[pos-30:pos+70]
43 p = p.translate(sepTable)
44 logging.debug(c+' / '+ p +'\n')
45 i += 1
46 logging.debug('# comite member with paper='+str(i))
47
48
50 """Classe contenant les paires de duplicats"""
52
53
54
55
56 self.liste = [(("Arnie Morton's of Chicago 435 S. La Cienega Blvd. Los Angeles 310-246-1501 Steakhouses",
57 "Arnie Morton's of Chicago 435 S. La Cienega Blvd. Los Angeles Steakhouses",
58 "Arnie Morton's of Chicago", "435 S. La Cienega Blvd"),
59 ("Arnie Morton's of Chicago 435 S. La Cienega Blvd. Los Angeles 310/246-1501 American",
60 "Arnie Morton's of Chicago", "435 S. La Cienega Blvd")),
61
62 (("Art's Deli 12224 Ventura Blvd. Studio City 818-762-1221 Delis",
63 "Art's Deli 12224 Ventura Blvd. Studio City Delis",
64 "Art's Deli", "12224 Ventura Blvd."),
65 ("Art's Delicatessen 12224 Ventura Blvd. Studio City 818/762-1221 American",
66 "Art's Delicatessen", "12224 Ventura Blvd. Studio City")),
67
68 (("Bel-Air Hotel 701 Stone Canyon Rd. Bel Air 310-472-1211 Californian",
69 "Bel-Air Hotel 701 Stone Canyon Rd. Bel Air Californian",
70 "Bel-Air Hotel", "701 Stone Canyon Rd. Bel Air"),
71 ("Hotel Bel-Air 701 Stone Canyon Rd. Bel Air 310/472-1211 Californian",
72 "Hotel Bel-Air", "701 Stone Canyon Rd")),
73
74 (("Cafe Bizou 14016 Ventura Blvd. Sherman Oaks 818-788-3536 French Bistro",
75 "Cafe Bizou 14016 Ventura Blvd. Sherman Oaks French Bistro",
76 "Cafe Bizou", "14016 Ventura Blvd."),
77 ("Cafe Bizou 14016 Ventura Blvd. Sherman Oaks 818/788-3536 French",
78 "Cafe Bizou", "14016 Ventura Blvd. Sherman Oaks")),
79
80 (("Campanile 624 S. La Brea Ave. Los Angeles 213-938-1447 Californian",
81 "Campanile 624 S. La Brea Ave. Los Angeles Californian",
82 "Campanile", "624 S. La Brea Ave."),
83 ("Campanile 624 S. La Brea Ave. Los Angeles 213/938-1447 American",
84 "Campanile", "624 S. La Brea Ave.")),
85
86 (("Chinois on Main 2709 Main St. Santa Monica 310-392-9025 Pacific New Wave",
87 "Chinois on Main 2709 Main St. Santa Monica Pacific New Wave",
88 "Chinois on Main", "2709 Main St."),
89 ("Chinois on Main 2709 Main St. Santa Monica 310/392-9025 French",
90 "Chinois on Main", "2709 Main St. Santa Monica")),
91
92 (("Citrus 6703 Melrose Ave. Los Angeles 213-857-0034 Californian",
93 "Citrus 6703 Melrose Ave. Los Angeles Californian",
94 "Citrus", "6703 Melrose Ave."),
95 ("Citrus 6703 Melrose Ave. Los Angeles 213/857-0034 Californian",
96 "Citrus", "6703 Melrose Ave.")),
97
98 (("Fenix at the Argyle 8358 Sunset Blvd. W. Hollywood 213-848-6677 French (New)",
99 "Fenix at the Argyle 8358 Sunset Blvd. W. Hollywood French (New)",
100 "Fenix at the Argyle", "8358 Sunset Blvd."),
101 ("Fenix 8358 Sunset Blvd. West Hollywood 213/848-6677 American",
102 "Fenix", "8358 Sunset Blvd. West Hollywood")),
103
104 (("23725 W. Malibu Rd. Malibu 310-456-0488 Californian",
105 "23725 W. Malibu Rd. Malibu Californian",
106 "Granita", "23725 W. Malibu Rd."),
107 ("23725 W. Malibu Rd. Malibu 310/456-0488 Californian",
108 "Granita", "23725 W. Malibu Rd. Malibu")),
109
110 (("Grill The 9560 Dayton Way Beverly Hills 310-276-0615 American (Traditional)",
111 "Grill The 9560 Dayton Way Beverly Hills American (Traditional)",
112 "Grill", "The 9560 Dayton Way"),
113 ("Grill on the Alley 9560 Dayton Way Los Angeles 310/276-0615 American",
114 "Grill on the Alley", "9560 Dayton Way Los Angeles")),
115
116 (("Katsu 1972 Hillhurst Ave. Los Feliz 213-665-1891 Japanese",
117 "Katsu 1972 Hillhurst Ave. Los Feliz Japanese",
118 "Katsu", "1972 Hillhurst Ave."),
119 ("Restaurant Katsu 1972 N. Hillhurst Ave. Los Angeles 213/665-1891 Asian",
120 "Restaurant Katsu", "1972 N. Hillhurst Ave.")),
121
122 (("L'Orangerie 903 N. La Cienega Blvd. W. Hollywood 310-652-9770 French (Classic)",
123 "L'Orangerie 903 N. La Cienega Blvd. W. Hollywood French (Classic)",
124 "L'Orangerie", "903 N. La Cienega Blvd."),
125 ("L'Orangerie 903 N. La Cienega Blvd. Los Angeles 310/652-9770 French",
126 "L'Orangerie", "903 N. La Cienega Blvd. W. Hollywood")),
127
128 (("Le Chardonnay (Los Angeles) 8284 Melrose Ave. Los Angeles 213-655-8880 French Bistro",
129 "Le Chardonnay (Los Angeles) 8284 Melrose Ave. Los Angeles French Bistro",
130 "Le Chardonnay", "8284 Melrose Ave."),
131 ("Le Chardonnay 8284 Melrose Ave. Los Angeles 213/655-8880 French",
132 "Le Chardonnay", "8284 Melrose Ave.")),
133
134 (("Locanda Veneta 8638 W. Third St. Los Angeles 310-274-1893 Italian",
135 "Locanda Veneta 8638 W. Third St. Los Angeles Italian",
136 "Locanda Veneta", "8638 W. Third St."),
137 ("Locanda Veneta 3rd St. Los Angeles 310/274-1893 Italian",
138 "Locanda Veneta", "3rd St.")),
139
140 (("Matsuhisa 129 N. La Cienega Blvd. Beverly Hills 310-659-9639 Seafood",
141 "Matsuhisa 129 N. La Cienega Blvd. Beverly Hills Seafood",
142 "Matsuhisa", "129 N. La Cienega Blvd."),
143 ("Matsuhisa 129 N. La Cienega Blvd. Beverly Hills 310/659-9639 Asian",
144 "Matsuhisa", "129 N. La Cienega Blvd. Beverly Hills")),
145
146 (("Palm The (Los Angeles) 9001 Santa Monica Blvd. W. Hollywood 310-550-8811 Steakhouses",
147 "Palm The (Los Angeles) 9001 Santa Monica Blvd. W. Hollywood Steakhouses",
148 "Palm The ", "9001 Santa Monica Blvd."),
149 ("The Palm 9001 Santa Monica Blvd. Los Angeles 310/550-8811 American",
150 "The Palm", "9001 Santa Monica Blvd.")),
151
152 (("Patina 5955 Melrose Ave. Los Angeles 213-467-1108 Californian",
153 "Patina 5955 Melrose Ave. Los Angeles Californian",
154 "Patina", "5955 Melrose Ave."),
155 ("Patina 5955 Melrose Ave. Los Angeles 213/467-1108 Californian",
156 "Patina", "5955 Melrose Ave.")),
157
158 (("Philippe The Original 1001 N. Alameda St. Chinatown 213-628-3781 Cafeterias",
159 "Philippe The Original 1001 N. Alameda St. Chinatown Cafeterias",
160 "Philippe The Original", "1001 N. Alameda St."),
161 ("Philippe's The Original 1001 N. Alameda St. Los Angeles 213/628-3781 American",
162 "Philippe's The Original", "1001 N. Alameda St.")),
163
164 (("Pinot Bistro 12969 Ventura Blvd. Studio City 818-990-0500 French Bistro",
165 "Pinot Bistro 12969 Ventura Blvd. Studio City French Bistro",
166 "Pinot Bistro", "12969 Ventura Blvd."),
167 ("Pinot Bistro 12969 Ventura Blvd. Los Angeles 818/990-0500 French",
168 "Pinot Bistro", "12969 Ventura Blvd.")),
169
170 (("Rex Il Ristorante 617 S. Olive St. Los Angeles 213-627-2300 Nuova Cucina Italian",
171 "Rex Il Ristorante 617 S. Olive St. Los Angeles Nuova Cucina Italian",
172 "Rex Il Ristorante", "617 S. Olive St."),
173 ("Rex Il Ristorante 617 S. Olive St. Los Angeles 213/627-2300 Italian",
174 "Rex Il Ristorante", "617 S. Olive St.")),
175
176 (("Spago (Los Angeles) 8795 Sunset Blvd. W. Hollywood 310-652-4025 Californian",
177 "Spago (Los Angeles) 8795 Sunset Blvd. W. Hollywood Californian",
178 "Spago", "8795 Sunset Blvd."),
179 ("Spago 1114 Horn Ave. Los Angeles 310/652-4025 Californian",
180 "Spago", "1114 Horn Ave.")),
181
182 (("Valentino 3115 Pico Blvd. Santa Monica 310-829-4313 Italian",
183 "Valentino 3115 Pico Blvd. Santa Monica Italian",
184 "Valentino", "3115 Pico Blvd."),
185 ("Valentino 3115 Pico Blvd. Santa Monica 310/829-4313 Italian",
186 "Valentino", "3115 Pico Blvd. Santa Monica")),
187
188 (("Yujean Kang's 67 N. Raymond Ave. Pasadena 818-585-0855 Chinese",
189 "Yujean Kang's 67 N. Raymond Ave. Pasadena Chinese",
190 "Yujean Kang's", "67 N. Raymond Ave. Pasadena"),
191 ("Yujean Kang's Gourmet Chinese Cuisine 67 N. Raymond Ave. Los Angeles 818/585-0855 Asian",
192 "Yujean Kang's Gourmet Chinese Cuisine", "67 N. Raymond Ave.")),
193
194 (("21 Club 21 W. 52nd St. New York City 212-582-7200 American (New)",
195 "21 Club 21 W. 52nd St. New York City American (New)",
196 "21 Club", "21 W. 52nd St."),
197 ("21 Club 21 W. 52nd St. New York 212/582-7200 American",
198 "21 Club", "21 W. 52nd St.")),
199
200 (("Aquavit 13 W. 54th St. New York City 212-307-7311 Scandinavian",
201 "Aquavit 13 W. 54th St. New York City Scandinavian",
202 "Aquavit", "13 W. 54th St."),
203 ("Aquavit 13 W. 54th St. New York 212/307-7311 Continental",
204 "Aquavit", "13 W. 54th St. New York")),
205
206 (("Aureole 34 E. 61st St. New York City 212-319-1660 American (New)",
207 "Aureole 34 E. 61st St. New York City American (New)",
208 "Aureole", "34 E. 61st St."),
209 ("Aureole 34 E. 61st St. New York 212/ 319-1660 American",
210 "Aureole", "34 E. 61st St. New York")),
211
212 (("BCafe Lalo 201 W. 83rd St. New York City 212-496-6031 Coffeehouses",
213 "BCafe Lalo 201 W. 83rd St. New York City Coffeehouses",
214 "BCafe Lalo", "201 W. 83rd St."),
215 ("Café Lalo 201 W. 83rd St. New York 212/496-6031 Coffee Bar",
216 "Café Lalo", "201 W. 83rd St. New York")),
217
218 (("Cafe des Artistes 1 W. 67th St. New York City 212-877-3500 French (Classic)",
219 "Cafe des Artistes 1 W. 67th St. New York City French (Classic)",
220 "Cafe des Artistes", "1 W. 67th St."),
221 ("Café des Artistes 1 W. 67th St. New York 212/877-3500 Continental",
222 "Café des Artistes", "1 W. 67th St. New York")),
223
224 (("Carmine's 2450 Broadway New York City 212-362-2200 Italian",
225 "Carmine's 2450 Broadway New York City Italian",
226 "Carmine's", "2450 Broadway"),
227 ("Carmine's 2450 Broadway between 90th and 91st Sts. New York 212/362-2200 Italian",
228 "Carmine's", "2450 Broadway between 90th and 91st Sts. New York")),
229
230 (("Carnegie Deli 854 Seventh Ave. New York City 212-757-2245 Delis",
231 "Carnegie Deli 854 Seventh Ave. New York City Delis",
232 "Carnegie Deli", "854 Seventh Ave."),
233 ("Carnegie Deli 854 7th Ave. between 54th and 55th Sts. New York 212/757-2245 Delicatessen",
234 "Carnegie Deli", "854 7th Ave. between 54th and 55th Sts. New York")),
235
236 (("Chanterelle 2 Harrison St. New York City 212-966-6960 French (New)",
237 "Chanterelle 2 Harrison St. New York City French (New)",
238 "Chanterelle", "2 Harrison St."),
239 ("Chanterelle 2 Harrison St. near Hudson St. New York 212/966-6960 American",
240 "Chanterelle", "2 Harrison St. near Hudson St.")),
241
242 (("CDaniel 20 E. 76th St. New York City 212-288-0033 French (New)",
243 "CDaniel 20 E. 76th St. New York City French (New)",
244 "CDaniel", "20 E. 76th St."),
245 ("Daniel 20 E. 76th St. New York 212/288-0033 French",
246 "Daniel", "20 E. 76th St.")),
247
248 (("Dawat 210 E. 58th St. New York City 212-355-7555 Indian",
249 "Dawat 210 E. 58th St. New York City Indian",
250 "Dawat", "210 E. 58th St."),
251 ("Dawat 210 E. 58th St. New York 212/355-7555 Asian",
252 "Dawat", "210 E. 58th St.")),
253
254 (("Felidia 243 E. 58th St. New York City 212-758-1479 Italian",
255 "Felidia 243 E. 58th St. New York City Italian",
256 "Felidia", "243 E. 58th St."),
257 ("Felidia 243 E. 58th St. New York 212/758-1479 Italian",
258 "Felidia", "243 E. 58th St.")),
259
260 (("Four Seasons 99 E. 52nd St. New York City 212-754-9494 American (New)",
261 "Four Seasons 99 E. 52nd St. New York City American (New)",
262 "Four Seasons", "99 E. 52nd St."),
263 ("Four Seasons Grill Room 99 E. 52nd St. New York 212/754-9494 American",
264 "Four Seasons Grill Room", "99 E. 52nd St.")),
265
266 (("Gotham Bar & Grill 12 E. 12th St. New York City 212-620-4020 American (New)",
267 "Gotham Bar & Grill 12 E. 12th St. New York City American (New)",
268 "Gotham Bar & Grill", "12 E. 12th St."),
269 ("Gotham Bar & Grill 12 E. 12th St. New York 212/620-4020 American",
270 "Gotham Bar & Grill", "12 E. 12th St.")),
271
272 (("Gramercy Tavern 42 E. 20th St. New York City 212-477-0777 American (New)",
273 "Gramercy Tavern 42 E. 20th St. New York City American (New)",
274 "Gramercy Tavern", "42 E. 20th St."),
275 ("Gramercy Tavern 42 E. 20th St. between Park Ave. S and Broadway New York 212/477-0777 American",
276 "Gramercy Tavern", "42 E. 20th St.")),
277
278 (("Island Spice 402 W. 44th St. New York City 212-765-1737 Caribbean",
279 "Island Spice 402 W. 44th St. New York City Caribbean",
280 "Island Spice", "402 W. 44th St."),
281 ("Island Spice 402 W. 44th St. New York 212/765-1737 tel Caribbean",
282 "Island Spice", "402 W. 44th St.")),
283
284 (("Jo Jo 160 E. 64th St. New York City 212-223-5656 French Bistro",
285 "Jo Jo 160 E. 64th St. New York City French Bistro",
286 "Jo Jo", "160 E. 64th St."),
287 ("Jo Jo 160 E. 64th St. New York 212/223-5656 American",
288 "Jo Jo", "160 E. 64th St.")),
289
290 (("La Caravelle 33 W. 55th St. New York City 212-586-4252 French (Classic)",
291 "La Caravelle 33 W. 55th St. New York City French (Classic)",
292 "La Caravelle", "33 W. 55th St."),
293 ("La Caravelle 33 W. 55th St. New York 212/586-4252 French",
294 "La Caravelle", "33 W. 55th St.")),
295
296 (("La Cote Basque 60 W. 55th St. New York City 212-688-6525 French (Classic)",
297 "La Cote Basque 60 W. 55th St. New York City French (Classic)",
298 "La Cote Basque", "60 W. 55th St."),
299 ("La Cote Basque 60 W. 55th St. between 5th and 6th Ave. New York 212/688-6525 French",
300 "La Cote Basque", "60 W. 55th St. between 5th and 6th Ave.")),
301
302 (("Le Bernardin 155 W. 51st St. New York City 212-489-1515 Seafood",
303 "Le Bernardin 155 W. 51st St. New York City Seafood",
304 "Le Bernardin", "155 W. 51st St."),
305 ("Le Bernardin 155 W. 51st St. New York 212/489-1515 French",
306 "Le Bernardin", "155 W. 51st St.")),
307
308 (("Les Celebrites 155 W. 58th St. New York City 212-484-5113 French (Classic)",
309 "Les Celebrites 155 W. 58th St. New York City French (Classic)",
310 "Les Celebrites", "155 W. 58th St."),
311 ("Les Célébrités 160 Central Park S New York 212/484-5113 French",
312 "Les Célébrités", "160 Central Park S")),
313
314 (("Lespinasse (New York City) 2 E. 55th St. New York City 212-339-6719 Asian",
315 "Lespinasse (New York City) 2 E. 55th St. New York City Asian",
316 "Lespinasse", "2 E. 55th St."),
317 ("Lespinasse 2 E. 55th St. New York 212/339-6719 American",
318 "Lespinasse", "2 E. 55th St.")),
319
320 (("Lutece 249 E. 50th St. New York City 212-752-2225 French (Classic)",
321 "Lutece 249 E. 50th St. New York City French (Classic)",
322 "Lutece", "249 E. 50th St."),
323 ("Lutèce 249 E. 50th St. New York 212/752-2225 French",
324 "Lutèce", "249 E. 50th St.")),
325
326 (("Manhattan Ocean Club 57 W. 58th St. New York City 212-371-7777 Seafood",
327 "Manhattan Ocean Club 57 W. 58th St. New York City Seafood",
328 "Manhattan Ocean Club", "57 W. 58th St."),
329 ("Manhattan Ocean Club 57 W. 58th St. New York 212/ 371-7777 Seafood",
330 "Manhattan Ocean Club", "57 W. 58th St.")),
331
332 (("March 405 E. 58th St. New York City 212-754-6272 American (New)",
333 "March 405 E. 58th St. New York City American (New)",
334 "March", "405 E. 58th St."),
335 ("March 405 E. 58th St. New York 212/754-6272 American",
336 "March", "405 E. 58th St.")),
337
338 (("Mesa Grill 102 Fifth Ave. New York City 212-807-7400 Southwestern",
339 "Mesa Grill 102 Fifth Ave. New York City Southwestern",
340 "Mesa Grill", "102 Fifth Ave."),
341 ("Mesa Grill 102 5th Ave. between 15th and 16th Sts. New York 212/807-7400 American",
342 "Mesa Grill", "102 5th Ave. between 15th and 16th Sts.")),
343
344 (("Mi Cocina 57 Jane St. New York City 212-627-8273 Mexican",
345 "Mi Cocina 57 Jane St. New York City Mexican",
346 "Mi Cocina", "57 Jane St."),
347 ("Mi Cocina 57 Jane St. off Hudson St. New York 212/627-8273 Mexican",
348 "Mi Cocina", "57 Jane St. off Hudson St.")),
349
350 (("Montrachet 239 W. Broadway New York City 212-219-2777 French Bistro",
351 "Montrachet 239 W. Broadway New York City French Bistro",
352 "Montrachet", "239 W. Broadway"),
353 ("Montrachet 239 W. Broadway between Walker and White Sts. New York 212/ 219-2777 French",
354 "Montrachet", "239 W. Broadway between Walker and White Sts.")),
355
356 (("Oceana 55 E. 54th St. New York City 212-759-5941 Seafood",
357 "Oceana 55 E. 54th St. New York City Seafood",
358 "Oceana", "55 E. 54th St."),
359 ("Oceana 55 E. 54th St. New York 212/759-5941 Seafood",
360 "Oceana", "55 E. 54th St.")),
361
362 (("Park Avenue Cafe (New York City) 100 E. 63rd St. New York City 212-644-1900 American (New)",
363 "Park Avenue Cafe (New York City) 100 E. 63rd St. New York City American (New)",
364 "Park Avenue Cafe", "100 E. 63rd St."),
365 ("Park Avenue Cafe 100 E. 63rd St. New York 212/644-1900 American",
366 "Park Avenue Cafe", "100 E. 63rd St.")),
367
368 (("Petrossian 182 W. 58th St. New York City 212-245-2214 Russian",
369 "Petrossian 182 W. 58th St. New York City Russian",
370 "Petrossian", "182 W. 58th St."),
371 ("Petrossian 182 W. 58th St. New York 212/245-2214 French",
372 "Petrossian", "182 W. 58th St.")),
373
374 (("Picholine 35 W. 64th St. New York City 212-724-8585 Mediterranean",
375 "Picholine 35 W. 64th St. New York City Mediterranean",
376 "Picholine", "35 W. 64th St."),
377 ("Picholine 35 W. 64th St. New York 212/724-8585 Mediterranean",
378 "Picholine", "35 W. 64th St.")),
379
380 (("Pisces 95 Ave. A New York City 212-260-6660 Seafood",
381 "Pisces 95 Ave. A New York City Seafood",
382 "Pisces", "95 Ave."),
383 ("Pisces 95 Ave. A at 6th St. New York 212/260-6660 Seafood",
384 "Pisces", "95 Ave. A at 6th St.")),
385
386 (("Rainbow Room 30 Rockefeller Plaza New York City 212-632-5000 American (New)",
387 "Rainbow Room 30 Rockefeller Plaza New York City American (New)",
388 "Rainbow Room", "30 Rockefeller Plaza"),
389 ("Rainbow Room 30 Rockefeller Plaza New York 212/632-5000 or 212/632-5100 American",
390 "Rainbow Room", "30 Rockefeller Plaza")),
391
392 (("River Cafe 1 Water St. Brooklyn 718-522-5200 American (New)",
393 "River Cafe 1 Water St. Brooklyn American (New)",
394 "River Cafe", "1 Water St. Brooklyn"),
395 ("River Café 1 Water St. at the East River Brooklyn 718/522-5200 American",
396 "River Café", "1 Water St. at the East River Brooklyn")),
397
398 (("San Domenico 240 Central Park S. New York City 212-265-5959 Italian",
399 "San Domenico 240 Central Park S. New York City Italian",
400 "San Domenico", "240 Central Park S."),
401 ("San Domenico 240 Central Park S New York 212/265-5959 Italian",
402 "San Domenico", "240 Central Park S")),
403
404 (("Second Avenue Deli 156 Second Ave. New York City 212-677-0606 Delis",
405 "Second Avenue Deli 156 Second Ave. New York City Delis",
406 "Second Avenue Deli", "156 Second Ave."),
407 ("Second Avenue Deli 156 2nd Ave. at 10th St. New York 212/677-0606 Delicatessen",
408 "Second Avenue Deli", "156 2nd Ave. at 10th St.")),
409
410 (("Seryna 11 E. 53rd St. New York City 212-980-9393 Japanese",
411 "Seryna 11 E. 53rd St. New York City Japanese",
412 "Seryna", "11 E. 53rd St."),
413 ("Seryna 11 E. 53rd St. New York 212/980-9393 Asian",
414 "Seryna", "11 E. 53rd St.")),
415
416 (("Shun Lee Palace 155 E. 55th St. New York City 212-371-8844 Chinese",
417 "Shun Lee Palace 155 E. 55th St. New York City Chinese",
418 "Shun Lee Palace", "155 E. 55th St."),
419 ("Shun Lee West 43 W. 65th St. New York 212/371-8844 Asian",
420 "Shun Lee West", "43 W. 65th St.")),
421
422 (("Sign of the Dove 1110 Third Ave. New York City 212-861-8080 American (New)",
423 "Sign of the Dove 1110 Third Ave. New York City American (New)",
424 "Sign of the Dove", "1110 Third Ave."),
425 ("Sign of the Dove 1110 3rd Ave. at 65th St. New York 212/861-8080 American",
426 "Sign of the Dove", "1110 3rd Ave. at 65th St.")),
427
428 (("Smith & Wollensky 797 Third Ave. New York City 212-753-1530 Steakhouses",
429 "Smith & Wollensky 797 Third Ave. New York City Steakhouses",
430 "Smith & Wollensky", "797 Third Ave."),
431 ("Smith & Wollensky 201 E. 49th St. New York 212/753-1530 American",
432 "Smith & Wollensky", "201 E. 49th St.")),
433
434 (("Tavern on the Green Central Park West New York City 212-873-3200 American (New)",
435 "Tavern on the Green Central Park West New York City American (New)",
436 "Tavern on the Green", "Central Park West"),
437 ("Tavern on the Green In Central Park at 67th St. New York 212/873-3200 American",
438 "Tavern on the Green", "In Central Park at 67th St.")),
439
440 (("Uncle Nick's 747 Ninth Ave. New York City 212-245-7992 Greek",
441 "Uncle Nick's 747 Ninth Ave. New York City Greek",
442 "Uncle Nick's", "747 Ninth Ave."),
443 ("Uncle Nick's 747 9th Ave. between 50th and 51st Sts. New York 212/315-1726 Mediterranean",
444 "Uncle Nick's", "747 9th Ave. between 50th and 51st Sts.")),
445
446 (("Union Square Cafe 21 E. 16th St. New York City 212-243-4020 American (New)",
447 "Union Square Cafe 21 E. 16th St. New York City American (New)",
448 "Union Square Cafe", "21 E. 16th St."),
449 ("Union Square Cafe 21 E. 16th St. New York 212/243-4020 American",
450 "Union Square Cafe", "21 E. 16th St.")),
451
452 (("Virgil's Real BBQ 152 W. 44th St. New York City 212-921-9494 BBQ",
453 "Virgil's Real BBQ 152 W. 44th St. New York City BBQ",
454 "Virgil's Real BBQ", "152 W. 44th St."),
455 ("Virgil's 152 W. 44th St. New York 212/ 921-9494 American",
456 "Virgil's", "152 W. 44th St.")),
457
458 (("Chin's 3200 Las Vegas Blvd. S. Las Vegas 702-733-8899 Chinese",
459 "Chin's 3200 Las Vegas Blvd. S. Las Vegas Chinese",
460 "Chin's", "3200 Las Vegas Blvd. S."),
461 ("Chin's 3200 Las Vegas Blvd. S Las Vegas 702/733-8899 Asian",
462 "Chin's", "3200 Las Vegas Blvd. S")),
463
464 (("Coyote Cafe (Las Vegas) 3799 Las Vegas Blvd. S. Las Vegas 702-891-7349 Southwestern",
465 "Coyote Cafe (Las Vegas) 3799 Las Vegas Blvd. S. Las Vegas Southwestern",
466 "Coyote Cafe", "3799 Las Vegas Blvd. S."),
467 ("Coyote Café 3799 Las Vegas Blvd. S Las Vegas 702/891-7349 Southwestern",
468 "Coyote Café", "3799 Las Vegas Blvd. S")),
469
470 (("Le Montrachet Bistro 3000 Paradise Rd. Las Vegas 702-732-5651 French Bistro",
471 "Le Montrachet Bistro 3000 Paradise Rd. Las Vegas French Bistro",
472 "Le Montrachet Bistro", "3000 Paradise Rd."),
473 ("Le Montrachet 3000 W. Paradise Rd. Las Vegas 702/732-5111 Continental",
474 "Le Montrachet", "3000 W. Paradise Rd.")),
475
476 (("Palace Court 3570 Las Vegas Blvd. S. Las Vegas 702-731-7110 French (New)",
477 "Palace Court 3570 Las Vegas Blvd. S. Las Vegas French (New)",
478 "Palace Court", "3570 Las Vegas Blvd. S."),
479 ("Palace Court 3570 Las Vegas Blvd. S Las Vegas 702/731-7547 Continental",
480 "Palace Court", "3570 Las Vegas Blvd. S.")),
481
482 (("Second Street Grill 200 E. Fremont St. Las Vegas 702-385-6277 Pacific Rim",
483 "Second Street Grill 200 E. Fremont St. Las Vegas Pacific Rim",
484 "Second Street Grill", "200 E. Fremont St."),
485 ("Second Street Grille 200 E. Fremont St. Las Vegas 702/385-3232 Seafood",
486 "Second Street Grille", "200 E. Fremont St.")),
487
488 (("Steak House The 2880 Las Vegas Blvd. S. Las Vegas 702-734-0410 Steakhouses",
489 "Steak House The 2880 Las Vegas Blvd. S. Las Vegas Steakhouses",
490 "Steak House The", "2880 Las Vegas Blvd. S."),
491 ("Steak House 2880 Las Vegas Blvd. S Las Vegas 702/734-0410 Steak Houses",
492 "Steak House", "2880 Las Vegas Blvd. S")),
493
494 (("Tillerman The 2245 E. Flamingo Rd. Las Vegas 702-731-4036 Steakhouses",
495 "Tillerman The 2245 E. Flamingo Rd. Las Vegas Steakhouses",
496 "Tillerman The", "2245 E. Flamingo Rd."),
497 ("Tillerman 2245 E. Flamingo Rd. Las Vegas 702/731-4036 Seafood",
498 "Tillerman", "2245 E. Flamingo Rd.")),
499
500 (("Abruzzi 2355 Peachtree Rd. NE Atlanta 404-261-8186 Italian",
501 "Abruzzi 2355 Peachtree Rd. NE Atlanta Italian",
502 "Abruzzi", "2355 Peachtree Rd. NE"),
503 ("Abruzzi 2355 Peachtree Rd. Peachtree Battle Shopping Center Atlanta 404/261-8186 Italian",
504 "Abruzzi", "2355 Peachtree Rd. Peachtree Battle Shopping Center")),
505
506 (("Bacchanalia 3125 Piedmont Rd. Atlanta 404-365-0410 Californian",
507 "Bacchanalia 3125 Piedmont Rd. Atlanta Californian",
508 "Bacchanalia", "3125 Piedmont Rd."),
509 ("Bacchanalia 3125 Piedmont Rd. near Peachtree Rd. Atlanta 404/365-0410 International",
510 "Bacchanalia", "3125 Piedmont Rd. near Peachtree Rd.")),
511
512 (("Bone's Restaurant 3130 Piedmont Rd. NE Atlanta 404-237-2663 Steakhouses",
513 "Bone's Restaurant 3130 Piedmont Rd. NE Atlanta Steakhouses",
514 "Bone's Restaurant", "3130 Piedmont Rd. NE"),
515 ("Bone's 3130 Piedmont Road Atlanta 404/237-2663 American",
516 "Bone's", "3130 Piedmont Road")),
517
518 (("Brasserie Le Coze 3393 Peachtree Rd. Atlanta 404-266-1440 French Bistro",
519 "Brasserie Le Coze 3393 Peachtree Rd. Atlanta French Bistro",
520 "Brasserie Le Coze", "3393 Peachtree Rd."),
521 ("Brasserie Le Coze 3393 Peachtree Rd. Lenox Square Mall near Neiman Marcus Atlanta 404/266-1440 French",
522 "Brasserie Le Coze", "3393 Peachtree Rd. Lenox Square Mall near Neiman Marcus")),
523
524 (("Buckhead Diner 3073 Piedmont Rd. Atlanta 404-262-3336 American (New)",
525 "Buckhead Diner 3073 Piedmont Rd. Atlanta American (New)",
526 "Buckhead Diner", "3073 Piedmont Rd."),
527 ("Buckhead Diner 3073 Piedmont Road Atlanta 404/262-3336 American",
528 "Buckhead Diner", "3073 Piedmont Road")),
529
530 (("Ciboulette Restaurant 1529 Piedmont Ave. Atlanta 404-874-7600 French (New)",
531 "Ciboulette Restaurant 1529 Piedmont Ave. Atlanta French (New)",
532 "Ciboulette Restaurant", "1529 Piedmont Ave."),
533 ("Ciboulette 1529 Piedmont Ave. Atlanta 404/874-7600 French",
534 "Ciboulette", "1529 Piedmont Ave.")),
535
536 (("Delectables 1 Margaret Mitchell Sq. Atlanta 404-681-2909 Cafeterias",
537 "Delectables 1 Margaret Mitchell Sq. Atlanta Cafeterias",
538 "Delectables", "1 Margaret Mitchell Sq."),
539 ("Delectables 1 Margaret Mitchell Sq. Atlanta 404/681-2909 American",
540 "Delectables", "1 Margaret Mitchell Sq.")),
541
542 (("Georgia Grille 2290 Peachtree Rd. Atlanta 404-352-3517 Southwestern",
543 "Georgia Grille 2290 Peachtree Rd. Atlanta Southwestern",
544 "Georgia Grille", "2290 Peachtree Rd."),
545 ("Georgia Grille 2290 Peachtree Rd. Peachtree Square Shopping Center Atlanta 404/352-3517 American",
546 "Georgia Grille", "2290 Peachtree Rd. Peachtree Square Shopping Center")),
547
548 (("GHedgerose Heights Inn The 490 E. Paces Ferry Rd. NE Atlanta 404-233-7673 Continental",
549 "GHedgerose Heights Inn The 490 E. Paces Ferry Rd. NE Atlanta Continental",
550 "GHedgerose Heights Inn The", "490 E. Paces Ferry Rd. NE"),
551 ("Hedgerose Heights Inn 490 E. Paces Ferry Rd. Atlanta 404/233-7673 International",
552 "Hedgerose Heights Inn", "490 E. Paces Ferry Rd.")),
553
554 (("Heera of India 595 Piedmont Ave. Atlanta 404-876-4408 Indian",
555 "Heera of India 595 Piedmont Ave. Atlanta Indian",
556 "Heera of India", "595 Piedmont Ave."),
557 ("Heera of India 595 Piedmont Ave. Rio Shopping Mall Atlanta 404/876-4408 Asian",
558 "Heera of India", "595 Piedmont Ave. Rio Shopping Mall")),
559
560 (("Indigo Coastal Grill 1397 N. Highland Ave. Atlanta 404-876-0676 Eclectic",
561 "Indigo Coastal Grill 1397 N. Highland Ave. Atlanta Eclectic",
562 "Indigo Coastal Grill", "1397 N. Highland Ave."),
563 ("Indigo Coastal Grill 1397 N. Highland Ave. Atlanta 404/876-0676 Caribbean",
564 "Indigo Coastal Grill", "1397 N. Highland Ave.")),
565
566 (("La Grotta 2637 Peachtree Rd. NE Atlanta 404-231-1368 Italian",
567 "La Grotta 2637 Peachtree Rd. NE Atlanta Italian",
568 "La Grotta", "2637 Peachtree Rd."),
569 ("La Grotta 2637 Peachtree Rd. Peachtree House Condominium Atlanta 404/231-1368 Italian",
570 "La Grotta", "2637 Peachtree Rd. Peachtree House Condominium")),
571
572 (("Mary Mac's Tea Room 224 Ponce de Leon Ave. Atlanta 404-876-1800 Southern/Soul",
573 "Mary Mac's Tea Room 224 Ponce de Leon Ave. Atlanta Southern/Soul",
574 "Mary Mac's Tea Room", "224 Ponce de Leon Ave."),
575 ("Mary Mac's Tea Room 224 Ponce de Leon Ave. Atlanta 404/876-1800 Southern",
576 "Mary Mac's Tea Room", "224 Ponce de Leon Ave.")),
577
578 (("Nikolai's Roof 255 Courtland St. Atlanta 404-221-6362 Continental",
579 "Nikolai's Roof 255 Courtland St. Atlanta Continental",
580 "Nikolai's Roof", "255 Courtland St."),
581 ("Nikolai's Roof 255 Courtland St. at Harris St. Atlanta 404/221-6362 Continental",
582 "Nikolai's Roof", "255 Courtland St. at Harris St.")),
583
584 (("Pano's & Paul's 1232 W. Paces Ferry Rd. Atlanta 404-261-3662 American (New)",
585 "Pano's & Paul's 1232 W. Paces Ferry Rd. Atlanta American (New)",
586 "Pano's & Paul's", "1232 W. Paces Ferry Rd."),
587 ("Pano's and Paul's 1232 W. Paces Ferry Rd. Atlanta 404/261-3662 International",
588 "Pano's & Paul's", "1232 W. Paces Ferry Rd.")),
589
590 (("Ritz-Carlton Cafe (Buckhead) 3434 Peachtree Rd. NE Atlanta 404-237-2700 American (New)",
591 "Ritz-Carlton Cafe (Buckhead) 3434 Peachtree Rd. NE Atlanta American (New)",
592 "Ritz-Carlton Cafe", "3434 Peachtree Rd. NE"),
593 ("Café Ritz-Carlton Buckhead,3434 Peachtree Rd. Atlanta Georgia 404/237-2700 ext 6108 International",
594 "Café Ritz-Carlton Buckhead", "3434 Peachtree Rd.")),
595
596 (("Ritz-Carlton Dining Room (Buckhead) 3434 Peachtree Rd. NE Atlanta 404-237-2700 American (New)",
597 "Ritz-Carlton Dining Room (Buckhead) 3434 Peachtree Rd. NE Atlanta American (New)",
598 "Ritz-Carlton Dining Room", "3434 Peachtree Rd."),
599 ("Dining Room Ritz-Carlton Buckhead 3434 Peachtree Rd. Atlanta 404/237-2700 International",
600 "Dining Room Ritz-Carlton Buckhead", "3434 Peachtree Rd.")),
601
602 (("Ritz-Carlton Restaurant 181 Peachtree St. Atlanta 404-659-0400 French (Classic)",
603 "Ritz-Carlton Restaurant 181 Peachtree St. Atlanta French (Classic)",
604 "Ritz-Carlton Restaurant", "181 Peachtree St."),
605 ("Restaurant Ritz-Carlton Atlanta 181 Peachtree St. Atlanta 404/659-0400 Continental",
606 "Restaurant Ritz-Carlton", "181 Peachtree St.")),
607
608 (("Toulouse 293-B Peachtree Rd. Atlanta 404-351-9533 French (New)",
609 "Toulouse 293-B Peachtree Rd. Atlanta French (New)",
610 "Toulouse", "293-B Peachtree Rd."),
611 ("Toulouse B Peachtree Rd. Atlanta 404/351-9533 French",
612 "Toulouse", "B Peachtree Rd.")),
613
614 (("Veni Vidi Vici 41 14th St. Atlanta 404-875-8424 Italian",
615 "Veni Vidi Vici 41 14th St. Atlanta Italian",
616 "Veni Vidi Vici", "41 14th St."),
617 ("Veni Vidi Vici 41 14th St. Atlanta 404/875-8424 Italian",
618 "Veni Vidi Vici", "41 14th St.")),
619
620 (("Alain Rondelli 126 Clement St. San Francisco 415-387-0408 French (New)",
621 "Alain Rondelli 126 Clement St. San Francisco French (New)",
622 "Alain Rondelli", "126 Clement St."),
623 ("Alain Rondelli 126 Clement St. San Francisco 415/387-0408 French",
624 "Alain Rondelli", "126 Clement St.")),
625
626 (("Aqua 252 California St. San Francisco 415-956-9662 American (New)",
627 "Aqua 252 California St. San Francisco American (New)",
628 "Aqua", "252 California St."),
629 ("Aqua 252 California St. San Francisco 415/956-9662 Seafood",
630 "Aqua", "252 California St.")),
631
632 (("Boulevard 1 Mission St. San Francisco 415-543-6084 American (New)",
633 "Boulevard 1 Mission St. San Francisco American (New)",
634 "Boulevard", "1 Mission St."),
635 ("Boulevard 1 Mission St. San Francisco 415/543-6084 American",
636 "Boulevard", "1 Mission St.")),
637
638 (("Cafe Claude 7 Claude Ln. San Francisco 415-392-3505 French Bistro",
639 "Cafe Claude 7 Claude Ln. San Francisco French Bistro",
640 "Cafe Claude", "7 Claude Ln."),
641 ("Café Claude 7 Claude La. San Francisco 415/392-3505 French",
642 "Café Claude", "7 Claude La.")),
643
644 (("Campton Place 340 Stockton St. San Francisco 415-955-5555 American (New)",
645 "Campton Place 340 Stockton St. San Francisco American (New)",
646 "Campton Place", "340 Stockton St."),
647 ("Campton Place 340 Stockton St. San Francisco 415/955-5555 American",
648 "Campton Place", "340 Stockton St.")),
649
650 (("Chez Michel 804 North Point St. San Francisco 415-775-7036 Californian",
651 "Chez Michel 804 North Point St. San Francisco Californian",
652 "Chez Michel", "804 North Point St."),
653 ("Chez Michel 804 Northpoint San Francisco 415/775-7036 French",
654 "Chez Michel", "804 Northpoint")),
655
656 (("Fleur de Lys 777 Sutter St. San Francisco 415-673-7779 French (New)",
657 "Fleur de Lys 777 Sutter St. San Francisco French (New)",
658 "Fleur de Lys", "777 Sutter St."),
659 ("Fleur de Lys 777 Sutter St. San Francisco 415/673-7779 French",
660 "Fleur de Lys", "777 Sutter St.")),
661
662 (("Fringale 570 Fourth St. San Francisco 415-543-0573 French Bistro",
663 "Fringale 570 Fourth St. San Francisco French Bistro",
664 "Fringale", "570 Fourth St."),
665 ("Fringale 570 4th St. San Francisco 415/543-0573 French",
666 "Fringale", "570 4th St.")),
667
668 (("Hawthorne Lane 22 Hawthorne St. San Francisco 415-777-9779 Californian",
669 "Hawthorne Lane 22 Hawthorne St. San Francisco Californian",
670 "Hawthorne Lane", "22 Hawthorne St."),
671 ("Hawthorne Lane 22 Hawthorne St. San Francisco 415/777-9779 American",
672 "Hawthorne Lane", "22 Hawthorne St.")),
673
674 (("Khan Toke Thai House 5937 Geary Blvd. San Francisco 415-668-6654 Thai",
675 "Khan Toke Thai House 5937 Geary Blvd. San Francisco Thai",
676 "Khan Toke Thai House", "5937 Geary Blvd."),
677 ("Khan Toke Thai House 5937 Geary Blvd. San Francisco 415/668-6654 Asian",
678 "Khan Toke Thai House", "5937 Geary Blvd.")),
679
680 (("La Folie 2316 Polk St. San Francisco 415-776-5577 French (New)",
681 "La Folie 2316 Polk St. San Francisco French (New)",
682 "La Folie", "2316 Polk St."),
683 ("La Folie 2316 Polk St. San Francisco 415/776-5577 French",
684 "La Folie", "2316 Polk St.")),
685
686 (("LuLu Restaurant-Bis-Cafe 816 Folsom St. San Francisco 415-495-5775 Mediterranean",
687 "LuLu Restaurant-Bis-Cafe 816 Folsom St. San Francisco Mediterranean",
688 "LuLu Restaurant-Bis-Cafe","816 Folsom St."),
689 ("LuLu 816 Folsom St. San Francisco 415/495-5775 Mediterranean",
690 "LuLu", "816 Folsom St.")),
691
692 (("Masa's 648 Bush St. San Francisco 415-989-7154 French (New)",
693 "Masa's 648 Bush St. San Francisco French (New)",
694 "Masa's", "648 Bush St."),
695 ("Masa's 648 Bush St. San Francisco 415/989-7154 French",
696 "Masa's", "648 Bush St.")),
697
698 (("Mifune 1737 Post St. San Francisco 415-922-0337 Japanese",
699 "Mifune 1737 Post St. San Francisco Japanese",
700 "Mifune", "1737 Post St."),
701 ("Mifune Japan Center Kintetsu Building 1737 Post St. San Francisco 415/922-0337 Asian",
702 "Mifune", "Japan Center Kintetsu Building 1737 Post St.")),
703
704 (("PlumpJack Cafe 3127 Fillmore St. San Francisco 415-563-4755 American (New)",
705 "PlumpJack Cafe 3127 Fillmore St. San Francisco American (New)",
706 "PlumpJack Cafe", "3127 Fillmore St."),
707 ("PlumpJack Café 3201 Fillmore St. San Francisco 415/563-4755 Mediterranean",
708 "PlumpJack Café", "3201 Fillmore St.")),
709
710 (("Postrio 545 Post St. San Francisco 415-776-7825 Californian",
711 "Postrio 545 Post St. San Francisco Californian",
712 "Postrio", "545 Post St."),
713 ("Postrio 545 Post St. San Francisco 415/776-7825 American",
714 "Postrio", "545 Post St.")),
715
716 (("Ritz-Carlton Dining Room (San Francisco) 600 Stockton St. San Francisco 415-296-7465 French (New)",
717 "Ritz-Carlton Dining Room (San Francisco) 600 Stockton St. San Francisco French (New)",
718 "Ritz-Carlton Dining Room", "600 Stockton St."),
719 ("Ritz-Carlton Restaurant and Dining Room 600 Stockton St. San Francisco 415/296-7465 American",
720 "Ritz-Carlton Restaurant and Dining Room", "600 Stockton St.")),
721
722 (("Rose Pistola 532 Columbus Ave. San Francisco 415-399-0499 Italian",
723 "Rose Pistola 532 Columbus Ave. San Francisco Italian",
724 "Rose Pistola", "532 Columbus Ave."),
725 ("Rose Pistola 532 Columbus Ave. San Francisco 415/399-0499 Italian",
726 "Rose Pistola", "532 Columbus Ave."))]
727
728 assert len(self.liste) == 112
729 self.nb_dup = 112
730
731 BC = 1
732 DEP = 2
735 self.bc_match_full = self.bc_match_name = self.bc_match_address = 0
736 self.dep_match_full = self.dep_match_name = self.dep_match_address = 0
737 self.bc_total_full = self.bc_total_name = self.bc_total_address = 0
738 self.dep_total_full = self.dep_total_name = self.dep_total_address = 0
739 self.bc_total_full_filtered = self.bc_total_name_filtered = self.bc_total_address_filtered = 0
740 self.dep_total_full_filtered = self.dep_total_name_filtered = self.dep_total_address_filtered = 0
741 self.NB_DUP = nb_dup
742
744 recall_name = 100 * (0.0 + self.bc_match_name + self.dep_match_name) / self.NB_DUP
745 recall_address = 100 * (0.0 + self.bc_match_address + self.dep_match_address) / self.NB_DUP
746
747 prec_name = 100 * (0.0 + self.bc_match_name + self.dep_match_name) / (self.bc_total_name + self.dep_total_name)
748 prec_address = 100 * (0.0 + self.bc_match_address + self.dep_match_address) / (self.bc_total_address + self.dep_total_address)
749
750 prec_name_filtered = 100 * (0.0 + self.bc_match_name + self.dep_match_name) / (self.bc_total_name_filtered + self.dep_total_name_filtered)
751 prec_address_filtered = 100 * (0.0 + self.bc_match_address + self.dep_match_address) / (self.bc_total_address_filtered + self.dep_total_address_filtered)
752
753 f_mesure_name = (2 * prec_name * recall_name) / (prec_name + recall_name)
754 f_mesure_address = (2 * prec_address * recall_address) / (prec_address + recall_address)
755
756 f_mesure_name_filtered = (2 * prec_name_filtered * recall_name) / (prec_name_filtered + recall_name)
757 f_mesure_address_filtered = (2 * prec_address_filtered * recall_address) / (prec_address_filtered + recall_address)
758
759 res = ("bc_match_full = " +str(self.bc_match_full) +
760 ' / bc_match_name = ' +str(self.bc_match_name) +
761 ' / bc_match_address = ' +str(self.bc_match_address)+
762 '\ndep_match_full = ' +str(self.dep_match_full) +
763 ' / dep_match_name = ' +str(self.dep_match_name) +
764 ' / dep_match_address = ' +str(self.dep_match_address) +
765 '\nRecall Name = ' +str(recall_name) +
766 '\nRecall Address = ' +str(recall_address) +
767 '\nbc_total_full = ' +str(self.bc_total_full) +
768 ' / bc_total_name = ' +str(self.bc_total_name) +
769 ' / bc_total_address = ' +str(self.bc_total_address)+
770 '\ndep_total_full = ' +str(self.dep_total_full) +
771 ' / dep_total_name = ' +str(self.dep_total_name) +
772 ' / dep_total_address = ' +str(self.dep_total_address) +
773 '\nPrecision Name = ' +str(prec_name) +
774 '\nPrecision Address = ' +str(prec_address)+
775 '\nF-mesure Name = ' +str(f_mesure_name) +
776 '\nF-mesure Address = ' +str(f_mesure_address) +
777 '\n----------------------------------' +
778 '\nbc_total_full_filtered = ' +str(self.bc_total_full_filtered) +
779 ' / bc_total_name_filtered = ' +str(self.bc_total_name_filtered) +
780 ' / bc_total_address_filtered = ' +str(self.bc_total_address_filtered)+
781 '\ndep_total_full_filtered = ' +str(self.dep_total_full_filtered) +
782 ' / dep_total_name_filtered = ' +str(self.dep_total_name_filtered) +
783 ' / dep_total_address_filtered = ' +str(self.dep_total_address_filtered) +
784 '\nPrecision Name Filtered = ' +str(prec_name_filtered) +
785 '\nPrecision Address Filtered = ' +str(prec_address_filtered)+
786 '\nF-mesure Name Filtered = ' +str(f_mesure_name_filtered) +
787 '\nF-mesure Address Filtered = ' +str(f_mesure_address_filtered))
788 return res
789
790 - def inc(self, bcdep, part):
791 if bcdep == BC:
792 if part == 'full':
793 self.bc_match_full += 1
794 elif part == 'name':
795 self.bc_match_name += 1
796 elif part == 'address':
797 self.bc_match_address += 1
798 else:
799 if part == 'full':
800 self.dep_match_full += 1
801 elif part == 'name':
802 self.dep_match_name += 1
803 elif part == 'address':
804 self.dep_match_address += 1
805
807 if bcdep == BC:
808 if part == 'full':
809 self.bc_total_full += 1
810 elif part == 'name':
811 self.bc_total_name += 1
812 elif part == 'address':
813 self.bc_total_address += 1
814 else:
815 if part == 'full':
816 self.dep_total_full += 1
817 elif part == 'name':
818 self.dep_total_name += 1
819 elif part == 'address':
820 self.dep_total_address += 1
821
823 if bcdep == BC:
824 if part == 'full':
825 self.bc_total_full_filtered += 1
826 elif part == 'name':
827 self.bc_total_name_filtered += 1
828 elif part == 'address':
829 self.bc_total_address_filtered += 1
830 else:
831 if part == 'full':
832 self.dep_total_full_filtered += 1
833 elif part == 'name':
834 self.dep_total_name_filtered += 1
835 elif part == 'address':
836 self.dep_total_address_filtered += 1
837
839 """Classe prenant en entrée un alignement entre Zagat et Fodor et
840 calculant les duplicats identifiés """
842 self.bbl = bbl
843 self.mp = MatchedPairs()
844 self.matched_name = [0] * self.mp.nb_dup
845 self.matched_address = [0] * self.mp.nb_dup
846
847
851
853 """ La partie gauche de part_text est une sous-chaine de full_text"""
854 splitted_part_text = part_text.split()
855 nb_words = len(splitted_part_text)
856 match = False
857 i = nb_words
858 while i >= minimum and not match:
859
860 joined_part_text = ' '.join(splitted_part_text[:i])
861 if (joined_part_text in full_text and
862 joined_part_text not in ['The','Le', 'the','of',"'s",'Restaurant']):
863 match = True
864
865 assert minimum <= i < nb_words
866 break
867 assert match == False
868 i -= 1
869 if i > minimum: assert match == True,(i,minimum)
870 return match,i
871
873 """ La partie droite de part_text est une sous-chaine de full_text"""
874 splitted_part_text = part_text.split()
875 nb_words = len(splitted_part_text)
876 match = False
877 i = 0
878 while i < nb_words and not match:
879 if nb_words - i < minimum: break
880 joined_part_text = ' '.join(splitted_part_text[i:])
881 if (joined_part_text in full_text and
882 joined_part_text not in ['The','Le', 'the','of',"'s",'Restaurant']):
883 match = True
884
885 break
886 i += 1
887 return match
888
889 - def match_bloc(self, texte_bloc, bcdep, precision):
890 texte_bloc = texte_bloc.lstrip(' \r\n\t')
891 texte_bloc = texte_bloc.rstrip(' \r\n\t')
892 if len(texte_bloc) < 1: return
893 logging.debug("BC: "+texte_bloc)
894 precision.inc_total(bcdep, 'name')
895 precision.inc_total(bcdep, 'address')
896 for stop_word in ['The', 'Ave.', 'Blvd.','New','(New)','Hotel','St.',
897 'Hollywood','Beverly','New York',
898 'French', 'American', 'Californian','Chinese','Italian','French (','American (',
899 'Seafood','Caribbean', 'Mexican', 'Mediterranean','Grill']:
900 if texte_bloc.lower() == stop_word.lower():
901 return
902 precision.inc_total_filtered(bcdep, 'name')
903 precision.inc_total_filtered(bcdep, 'address')
904 i = 0
905 for (Z, F) in self.mp.liste:
906 Zfull, ZfullNoPhone, Zname, Zaddress = Z
907 if (texte_bloc in ZfullNoPhone or
908 self.match_part_left(ZfullNoPhone, texte_bloc) ):
909
910
911
912 match_name = match_address = False
913 match_name_left, pos_mnl = self.match_part_left(Zname, texte_bloc)
914 if (self.matched_name[i] == 0 and
915 (
916 self.match_part_right(Zname, texte_bloc) or
917 match_name_left)):
918 match_name = True
919 precision.inc(bcdep, 'name')
920 self.matched_name[i] = 1
921 logging.debug(str(bcdep)+" MATCH NAME: "+ Zname)
922
923 if match_name and match_name_left:
924 splitted_part_text = texte_bloc.split()
925 text_bloc_minus_name = ' '.join(splitted_part_text[pos_mnl:])
926
927 match_address_left, pos_mal = self.match_part_left(Zaddress, text_bloc_minus_name, 3)
928 if (self.matched_address[i] == 0 and
929 (
930 match_address_left)):
931 match_address = True
932 precision.inc(bcdep, 'address')
933 self.matched_address[i] = 1
934 logging.debug(str(bcdep)+ " MATCH ADDRESS: "+ Zaddress)
935
936 match_address_left, pos_mal = self.match_part_left(Zaddress, texte_bloc, 3)
937 if (self.matched_address[i] == 0 and
938 (
939 match_address_left)):
940 match_address = True
941 precision.inc(bcdep, 'address')
942 self.matched_address[i] = 1
943 logging.debug(str(bcdep)+ " MATCH ADDRESS: "+ Zaddress)
944 if match_name or match_address:
945 break
946 i += 1
947
949 texte = self.bbl.texte
950 recall = Recall(self.mp.nb_dup)
951 for (B1, B2) in self.bbl.liste:
952
953 if B1 is not None and B2 is not None and B1[0] == 'BC':
954 logging.debug("########################################################")
955 texte_bloc = texte[B1[1]:B1[2]]
956 self.match_bloc(texte_bloc, BC, recall)
957 for debut_dep, fin_dep in B1[3]:
958 texte_bloc = texte[debut_dep:fin_dep]
959 self.match_bloc(texte_bloc, DEP, recall)
960 elif B1 is not None and B1[0] == 'D':
961 logging.debug("%%%%%%%%%%%%%%%%%%%%%%%%%")
962 texte_bloc = texte[B1[1]:B1[2]]
963 self.match_bloc(texte_bloc, DEP, recall)
964 elif B1 is not None:
965 logging.debug("%%%%%%%%%%%%%%%%%%%%%%%%%")
966 for debut_dep, fin_dep in B1[3]:
967 texte_bloc = texte[debut_dep:fin_dep]
968 self.match_bloc(texte_bloc, DEP, recall)
969
970 print recall
971
974
975 if __name__ == '__main__':
976 logging.basicConfig(level=logging.DEBUG,
977 format='%(asctime)s %(levelname)s %(message)s',
978
979 filename=os.path.join(os.getcwd(),'log.txt'),
980 filemode='w')
981 console = logging.StreamHandler()
982 console.setLevel(logging.INFO)
983 test()
984