Project

General

Profile

RE: XMLTV, Kazer & French categories » category-filter.pl

thierry castelot, 2018-02-11 13:05

 
1
#!/usr/bin/perl -w
2

    
3
#
4
# The categories recognized by tvheadend (see epg.c) 
5
#  
6

    
7
my $MOVIE             =    "Movie / Drama";
8
my $THRILLER          =    "Detective / Thriller";
9
my $ADVENTURE         =    "Adventure / Western / War";
10
my $SF                =    "Science fiction / Fantasy / Horror";
11
my $COMEDY            =    "Comedy";
12
my $SOAP              =    "Soap / Melodrama / Folkloric";
13
my $ROMANCE           =    "Romance";
14
my $HISTORICAL        =    "Serious / Classical / Religious / Historical movie / Drama";
15
my $XXX               =    "Adult movie / Drama";
16

    
17
my $NEWS              =    "News / Current affairs";
18
my $WEATHER           =    "News / Weather report";
19
my $NEWS_MAGAZINE     =    "News magazine";
20
my $DOCUMENTARY       =    "Documentary";
21
my $DEBATE            =    "Discussion / Interview / Debate";
22
my $INTERVIEW         =    $DEBATE ;
23

    
24
my $SHOW              =    "Show / Game show";
25
my $GAME              =    "Game show / Quiz / Contest";
26
my $VARIETY           =    "Variety show";
27
my $TALKSHOW          =    "Talk show";
28

    
29
my $SPORT             =    "Sports";
30
my $SPORT_SPECIAL     =    "Special events (Olympic Games; World Cup; etc.)";
31
my $SPORT_MAGAZINE    =    "Sports magazines";
32
my $FOOTBALL          =    "Football / Soccer";
33
my $TENNIS            =    "Tennis / Squash";
34
my $SPORT_TEAM        =    "Team sports (excluding football)";
35
my $ATHLETICS         =    "Athletics";
36
my $SPORT_MOTOR       =    "Motor sport";
37
my $SPORT_WATER       =    "Water sport";
38

    
39
my $KIDS              =    "Children's / Youth programs";
40
my $KIDS_0_5          =    "Pre-school children's programs";
41
my $KIDS_6_14         =    "Entertainment programs for 6 to 14";
42
my $KIDS_10_16        =    "Entertainment programs for 10 to 16";
43
my $EDUCATIONAL       =    "Informational / Educational / School programs";
44
my $CARTOON           =    "Cartoons / Puppets";
45

    
46
my $MUSIC             =    "Music / Ballet / Dance";
47
my $ROCK_POP          =    "Rock / Pop";
48
my $CLASSICAL         =    "Serious music / Classical music";
49
my $FOLK              =    "Folk / Traditional music";
50
my $JAZZ              =    "Jazz";
51
my $OPERA             =    "Musical / Opera";
52

    
53
my $CULTURE           =    "Arts / Culture (without music)";
54
my $PERFORMING        =    "Performing arts";
55
my $FINE_ARTS         =    "Fine arts";
56
my $RELIGION          =    "Religion";
57
my $POPULAR_ART       =    "Popular culture / Traditional arts";
58
my $LITERATURE        =    "Literature";
59
my $FILM              =    "Film / Cinema";
60
my $EXPERIMENTAL_FILM =    "Experimental film / Video";
61
my $BROADCASTING      =    "Broadcasting / Press";
62

    
63
my $SOCIAL            =    "Social / Political issues / Economics";
64
my $MAGAZINE          =    "Magazines / Reports / Documentary";
65
my $ECONOMIC          =    "Economics / Social advisory";
66
my $VIP               =    "Remarkable people";
67

    
68
my $SCIENCE           =    "Education / Science / Factual topics";
69
my $NATURE            =    "Nature / Animals / Environment";
70
my $TECHNOLOGY        =    "Technology / Natural sciences";
71
my $DIOLOGY           =    $TECHNOLOGY;
72
my $MEDECINE          =    "Medicine / Physiology / Psychology";
73
my $FOREIGN           =    "Foreign countries / Expeditions";
74
my $SPIRITUAL         =    "Social / Spiritual sciences";
75
my $FURTHER_EDUCATION =    "Further education";
76
my $LANGUAGES         =    "Languages";
77

    
78
my $HOBBIES           =    "Leisure hobbies";
79
my $TRAVEL            =    "Tourism / Travel";
80
my $HANDICRAF         =    "Handicraft";
81
my $MOTORING          =    "Motoring";
82
my $FITNESS           =    "Fitness and health";
83
my $COOKING           =    "Cooking";
84
my $SHOPPING          =    "Advertisement / Shopping";
85
my $GARDENING         =    "Gardening";
86

    
87
#
88
# This is the 
89
#
90
#
91
#
92

    
93
my %REPLACE=(
94
    
95
    "Émission"          				 => 0 ,
96
    "fin"               				 => 0 ,
97
    "Fin des programmes" 				 => 0 ,
98
    "loterie"           				 => 0 ,
99
	"programme indéterminé" 			 => 0 ,
100
    "autre"                              => 0 ,
101
	"Divers"							=> 0 ,
102
	"Education"							=> $EDUCATIONAL ,
103
    "pop %26 rock"                      	=> $ROCK_POP ,
104
	"documentaire : rock-pop"                      	=> $ROCK_POP ,
105
    "Série TV"                           => $MOVIE ,
106
    "Série Télé"                         => $MOVIE ,
107
    "Série"                              => $MOVIE ,  
108
	"feuilleton réaliste"                              => $MOVIE ,  
109
	"série hospitalière"                              => $MOVIE , 
110
	"série carcérale"                              => $MOVIE , 
111
    "Emission spéciale"                  => 0 ,
112
	"Marathon"							=> $ATHLETICS ,
113
	"talk show"							 => $TALKSHOW ,
114
    "Talk-show"							 => $TALKSHOW ,
115
    "météo"								 => $WEATHER ,
116
    "Drame"								 => $MOVIE ,
117
    "Série fantastique"                  => $SF ,
118
	"film : fantastique"                  => $SF ,
119
	"téléfilm d'épouvante"                  => $SF ,
120
	"film d'horreur"                  => $SF ,
121
	"film fantastique"                  => $SF ,
122
	"téléfilm d'horreur"                  => $SF ,
123
	"série d'horreur"                  => $SF ,
124
	"série de science-fiction"                  => $SF ,
125
	"magazine scientifique"              => $SCIENCE ,
126
	"documentaire : sciences et technique"              => $SCIENCE ,	
127
	"magazine de télé-achat"             => $SHOPPING , 
128
    "Publicité"                          => $SHOPPING , 
129
	"COMMERCIAL"						=> $SHOPPING , 
130
	"Série réaliste"                     => $MOVIE ,
131
	"Série hospitalière"                 => $MOVIE ,
132
    "Mélodrame"                          => $MOVIE ,
133
	"série réaliste"                          => $SOAP ,
134
	"jeu"               				 => $GAME ,
135
	"magazine de la gastronomie"  		 => $COOKING , 
136
	"documentaire : gastronomie"  		 => $COOKING , 
137
	
138
	"magazine culinaire"  		 => $COOKING , 
139
    "journal"            				 => $NEWS ,
140
    "Actualité"            				 => $NEWS ,
141
    "Information"            			 => $NEWS ,
142
    "feuilleton sentimental"      		 => $ROMANCE ,
143
	"TELENOVELA"						=> $SOAP ,
144
    "Téléfilm romanesque"          		 => $ROMANCE  ,
145
    "Feuilleton réaliste"         		 => $SOAP ,
146
    "Série sentimentale"          		 => $ROMANCE  ,
147
	 "téléfilm sentimental"          		 => $ROMANCE  ,
148
	 "film : comédie sentimentale"          		 => $ROMANCE  , 
149
    "Téléfilm de suspense"         		 => $THRILLER ,
150
	"Film noir"							=> $THRILLER ,
151
	"film : thriller"							=> $THRILLER ,
152
	"film policier"							=> $THRILLER ,
153
	"série judiciaire"							=> $THRILLER ,
154
	"série policière"							=> $THRILLER ,
155
	"série politique"							=> $THRILLER ,
156
	"film d'espionnage"							=> $THRILLER ,
157
    "téléréalité"                		 => $VIP ,
158
    "Série de téléréalité"       		 => $VIP ,
159
    "Magazine du show-biz"      	     => $VIP ,
160
	"documentaire : téléréalité"      	     => $DOCUMENTARY ,
161
    "Série humoristique"         	     => $COMEDY ,
162
	"série à sketches"         	     => $COMEDY ,
163
    "Téléfilm humoristique"       		 => $COMEDY ,
164
    "Comédie satirique"                  => $COMEDY , 
165
    "Humour"                             => $COMEDY , 
166
	"Film à sketches"					 => $COMEDY , 
167
	"Comédie de moeurs"					=> $COMEDY , 
168
	"film : comédie"					=> $COMEDY , 
169
	"série burlesque"					=> $COMEDY , 
170
	"téléfilm humoristique"					=> $COMEDY ,
171
	"divertissement-humour"					=> $COMEDY ,
172
	"série humoristique"					=> $COMEDY ,
173
	"humour"					=> $COMEDY ,
174
    "Série policière"                	 => $THRILLER ,
175
    "Comédie policière"                	 => $THRILLER ,
176
	"téléfilm policier"                	 => $THRILLER ,
177
	"film : policier"                	 => $THRILLER ,
178
    "Magazine sportif"              	 => $SPORT_MAGAZINE ,
179
    "jt sport"                           => $SPORT_MAGAZINE ,
180
	"magazine sportif"                           => $SPORT_MAGAZINE ,
181
	"documentaire : sport"                           => $SPORT_MAGAZINE ,
182
    "Téléfilm dramatique"           	 => $MOVIE ,
183
	"film : drame"           	 => $MOVIE ,
184
    "Téléfilm humoristique"        		 => $COMEDY ,
185
    "Série à sketches"                   => $COMEDY ,
186
    "Téléfilm sentimental"       	     => $ROMANCE ,
187
    "Téléfilm romanesque"          		 => $ROMANCE ,
188
    "Comédie romantique"                 => $ROMANCE ,
189
	"série sentimentale"                 => $ROMANCE ,
190
	"film : comédie romantique"          => $ROMANCE ,
191
    "Feuilleton"                         => $SOAP ,
192
    "football"              		     => $FOOTBALL , 
193
	 "sport : football"              		     => $FOOTBALL , 
194
    "Tennis"                		     => $TENNIS ,
195
    "divertissement"       			     => $SHOW ,
196
	"Divertissement - humour"       	 => $SHOW ,
197
    "Divertissement-humour"              => $SHOW ,
198
    "Gala"                               => $SHOW ,
199
    "one man show"                       => $SHOW ,
200
    "Multisports"                        => $SPORT ,
201
	"Patinage artistique"				=> $SPORT ,
202
	"Ski"								=> $SPORT ,
203
	"Hockey sur glace"					=> $SPORT ,
204
	"Trial"								=> $SPORT ,
205
	"Danse sportive"					=> $SPORT ,
206
	"Sports de glisse"					=> $SPORT ,
207
    "Sport"                              => $SPORT ,
208
    "e-sport"                            => $SPORT ,
209
	"sport : e-sport"                            => $SPORT ,
210
    "Golf"                               => $SPORT ,
211
    "Basket-ball"                        => $SPORT ,
212
    "Equitation"                         => $SPORT ,
213
    "Boxe"                               => $SPORT ,
214
    "Hockey sur gazon"                   => $SPORT ,
215
    "Football américain"                 => $SPORT ,
216
    "Rugby à XIII"                       => $SPORT ,
217
    "Handball"                           => $SPORT ,
218
    "Baseball"                           => $SPORT ,
219
    "Gymnastique rythmique"              => $SPORT ,
220
    "Badminton"                          => $SPORT ,
221
    "Gymnastique artistique"             => $SPORT ,
222
    "BMX"                                => $SPORT ,
223
    "Skate-board"                        => $SPORT ,
224
    "VTT"                               => $SPORT ,
225
    "Voltige aérienne"                   => $SPORT ,
226
    "Sports extrêmes"                   => $SPORT ,
227
    "Roller"                            => $SPORT ,
228
    "Sports fun"                         => $SPORT ,
229
    "Escalade"                          => $SPORT ,
230
    "Kick-boxing"                       => $SPORT ,
231
    "Lutte"                              => $SPORT ,
232
    "Arts martiaux"                      => $SPORT ,
233
    "Boxe thaï"                         => $SPORT ,
234
    "Karaté"                            => $SPORT ,
235
    "MMA"                                => $SPORT ,
236
    "Ju jitsu"                          => $SPORT ,
237
    "Sports de combat"                  => $SPORT ,
238
    "Sumo"                              => $SPORT ,
239
	"Cyclisme"							=> $SPORT ,
240
	"Curling"							=> $SPORT ,
241
	"Taekwondo"							=> $SPORT ,
242
	"Gymnastique"						=> $SPORT ,
243
	"Snowboard"							=> $SPORT ,
244
	"Tennis de table"					=> $SPORT ,
245
	"Voile"								=> $SPORT ,
246
	"sport : tennis"								=> $SPORT ,
247
	"sport : hockey sur glace"								=> $SPORT ,
248
	"sport : golf"								=> $SPORT ,
249
	"magazine hippique"								=> $SPORT ,
250
	"sport : cyclisme"								=> $SPORT ,
251
	"trail"								=> $SPORT ,
252
	"pétanque"								=> $SPORT ,
253
	"sport : boxe"								=> $SPORT ,
254
	"multisports"								=> $SPORT ,
255
	"trail"								=> $SPORT ,
256
	"sport : rugby"								=> $SPORT ,
257
	"sports de glisse"								=> $SPORT ,
258
	"kick-boxing"								=> $SPORT ,
259
	"triathlon"								=> $SPORT ,
260
	"sport : futsal"								=> $SPORT ,
261
	"sport : snowboard"								=> $SPORT ,
262
	"sport : ski"								=> $SPORT ,
263
	"sport : volley-ball"								=> $SPORT ,
264
	"sport : pétanque"								=> $SPORT ,
265
	"sport : trail"								=> $SPORT ,
266
	"sport : judo"								=> $SPORT ,
267
	"cyclisme"								=> $SPORT ,
268
	"sport : multisports"								=> $SPORT ,
269
    "Surf"                               => $SPORT_WATER ,
270
    "Plongeon"                          => $SPORT_WATER ,
271
    "Canoë-kayak"                       => $SPORT_WATER ,
272
    "Wakeboard"                         => $SPORT_WATER ,
273
	"Natation"							=> $SPORT_WATER ,
274
	"sports nautiques"							=> $SPORT_WATER ,
275
    "sports mécaniques"      		     => $SPORT_MOTOR ,
276
    "Motocross"                          => $SPORT_MOTOR ,
277
    "Magazine de la moto"               => $SPORT_MOTOR ,
278
    "Enduro"                             => $SPORT_MOTOR ,
279
    "Motocross freestyle"                => $SPORT_MOTOR ,
280
    "Speedway"                           => $SPORT_MOTOR ,
281
	"Moto2"								=> $SPORT_MOTOR ,
282
	"Moto"								=> $SPORT_MOTOR ,
283
	"sport : rallye"								=> $SPORT_MOTOR ,
284
	"magazine de l'automobile"								=> $SPORT_MOTOR ,
285
	"Trail"								=> $SPORT ,
286
    "Comédie"                  			 => $COMEDY ,
287
    "classique"                		     => $CLASSICAL ,
288
	"Musique classique"					=> $CLASSICAL ,
289
    "Documentaire"     					 => $DOCUMENTARY ,
290
	"documentaire : géopolitique"     					 => $DOCUMENTARY ,
291
	"documentaire : justice"     					 => $DOCUMENTARY ,
292
	 "documentaire : musique"     					 => $DOCUMENTARY ,
293
	"film : documentaire"     					 => $DOCUMENTARY ,
294
    "magazine de la mode"  				 => $MAGAZINE ,
295
	"magazine du cinéma"  				 => $MAGAZINE ,
296
	"magazine historique"  				 => $MAGAZINE ,
297
	"magazine régional"  				 => $MAGAZINE ,
298
	"magazine de l'art de vivre"  				 => $MAGAZINE ,
299
	"magazine du show-biz"  				 => $MAGAZINE ,
300
	"magazine de la décoration"  				 => $MAGAZINE ,
301
	"magazine de découvertes"  				 => $MAGAZINE ,
302
	"MAGAZINE"							=> $MAGAZINE ,
303
	"magazine musical"                           => $MAGAZINE ,
304
	"Emission"                           => $MAGAZINE ,
305
	"magazine de reportages"                           => $MAGAZINE ,
306
	"magazine judiciaire"                           => $MAGAZINE ,
307
	"magazine du consommateur"                           => $MAGAZINE ,
308
	"magazine de services"                           => $MAGAZINE ,
309
	"Animalier"             			 => $NATURE ,
310
    "Nature"              			     => $NATURE ,
311
    "magazine animalier"  			     => $NATURE ,
312
	"documentaire : animalier"  			     => $NATURE ,
313
	"Chasse"							=> $NATURE ,
314
	"magazine de l'environnement"							=> $NATURE ,
315
    "Découvertes"          			     => $FOREIGN ,
316
    "Magazine du tourisme"               => $FOREIGN ,
317
    "magazine religieux"   			     => $RELIGION ,
318
	"Religions"							=> $RELIGION ,
319
	"documentaire : religions"							=> $RELIGION ,
320
    "Sports"          					 => $SPORT ,
321
    "Voyage"           				   	 => $FOREIGN ,
322
    "Culture"           				 => $CULTURE ,
323
    "Pièce de théâtre"                  => $CULTURE ,
324
	"documentaire : culture"                  => $CULTURE ,
325
    "magazine littéraire"		       	 => $LITERATURE ,
326
	"Lettres"							=> $LITERATURE ,
327
    "Magazine sportif"       		   	 => $SPORT_MAGAZINE ,
328
    "téléfilm policier"    		         => $THRILLER ,
329
	 "téléfilm de suspense"    		         => $THRILLER ,
330
    "Magazine politique"   			     => $SOCIAL ,
331
	"emission politique"   			     => $SOCIAL ,
332
	"Série Autre"						=> $MOVIE ,
333
	"Série politique"					=> $SOCIAL ,
334
    "Série dramatique"				  	=> $MOVIE ,
335
    "Drame psychologique"               => $MOVIE ,
336
	"Drame social"						=> $MOVIE ,
337
	"film : comédie dramatique"						=> $MOVIE ,
338
	"film : comédie dramatique"						=> $MOVIE ,
339
	"téléfilm dramatique"						=> $MOVIE ,
340
	"série dramatique"						=> $MOVIE ,
341
    "Environnement"         		    => $NATURE ,
342
    "opéra"             				=> $OPERA ,
343
	"Opéra comique"						=> $OPERA ,	
344
	"Opéra bouffe"						=> $OPERA ,
345
    "Magazine de géopolitique"   		=> $DOCUMENTARY ,
346
    "Film documentaire"                 => $DOCUMENTARY ,
347
    "Série documentaire"                => $DOCUMENTARY ,
348
    "Reportage"                          => $DOCUMENTARY ,
349
    "Making-of"                          => $DOCUMENTARY ,
350
	"fiction"							 => $DOCUMENTARY ,
351
	"DOC"								=> $DOCUMENTARY ,
352
	"documentaire : environnement"								=> $DOCUMENTARY ,
353
	"documentaire : justice"								=> $DOCUMENTARY ,
354
	"documentaire : aventures"								=> $DOCUMENTARY ,
355
	"film documentaire"								=> $DOCUMENTARY ,
356
	"documentaire : sciences et technique" => $DOCUMENTARY ,
357
	"documentaire : histoire" => $DOCUMENTARY ,
358
	"documentaire : civilisations" => $DOCUMENTARY ,
359
	"documentaire : cinéma" => $DOCUMENTARY ,
360
    "Série de suspense"          		=> $THRILLER ,
361
    "Economie"                			=> $SOCIAL ,
362
	"magazine de société"               => $SOCIAL ,
363
	"documentaire : société"            => $SOCIAL ,
364
	"documentaire : politique"            => $SOCIAL ,
365
	"magazine de géopolitique"            => $SOCIAL ,
366
	"magazine politique"            => $SOCIAL ,
367
    "Programme court"                   => $EXPERIMENTAL_FILM ,
368
	"Contemporain"						=> $EXPERIMENTAL_FILM ,
369
    "Court-métrage"                      => $EXPERIMENTAL_FILM ,
370
    "Court métrage"                      => $EXPERIMENTAL_FILM ,
371
    "Prog court"                         => $EXPERIMENTAL_FILM ,
372
    "Court métrage dramatique"          => $EXPERIMENTAL_FILM ,
373
	"magazine du court métrage"          => $EXPERIMENTAL_FILM ,
374
	"Film d'espionnage"                 => $FILM ,				
375
    "Moyen-métrage"                     => $FILM ,
376
    "Film"                      		=> $FILM ,
377
	"FILM"								=> $FILM ,
378
    "Films"                      		=> $FILM ,
379
	"film : autre"                      		=> $FILM ,
380
	"film : divers"                      		=> $FILM ,
381
    "film"                      		=> $FILM ,	
382
    "Téléfilm catastrophe"      	    => $FILM ,
383
	"Film catastrophe"					=> $FILM ,
384
    "Magazine du cinéma"                => $FILM ,
385
    "Magazine du court métrage"         => $FILM ,
386
    "Cinéma"                            => $FILM ,
387
    "Magazine pornographique"           => $XXX ,
388
    "magazine de charme"        	    => $XXX ,
389
    "Film pornographique"               => $XXX ,
390
    "Film érotique"                     => $XXX ,
391
    "Série érotique"                    => $XXX ,
392
    "Téléfilm pornographique"           => $XXX ,
393
    "téléfilm érotique"                 => $XXX ,
394
    "magazine culturel"          		=> $CULTURE ,
395
	"Beaux-arts"						=> $CULTURE ,
396
    "cérémonie"                   		=> $SPORT_SPECIAL ,
397
	"emission spéciale"                   		=> $SPORT_SPECIAL ,
398
    "Magazine de découvertes"     		=> $TRAVEL ,
399
	"Magazine de reportages"          	=> $TRAVEL ,
400
    "documentaire : découvertes"          	=> $TRAVEL ,
401
    "Magazine régional"                 => $TRAVEL ,
402
	"magazine du tourisme"                 => $TRAVEL ,
403
	"documentaire : voyage"                 => $TRAVEL ,
404
    "Magazine du multimédia"         	=> $EXPERIMENTAL_FILM ,
405
    "Magazine de services"            	=> $NEWS_MAGAZINE ,
406
	"magazine d'actualité"            	=> $NEWS_MAGAZINE ,
407
	"magazine d'information"            	=> $NEWS_MAGAZINE ,
408
    "Magazine du jeu vidéo"             => $HOBBIES ,
409
	"magazine des loisirs"             => $HOBBIES ,
410
    "magazine de la mer"   				=> $MAGAZINE ,
411
    "Magazine de l'armée"               => $MAGAZINE ,
412
    "Magazine"                          => $MAGAZINE ,
413
    "Magazine de société"  				=> $MAGAZINE ,
414
    "Magazine historique" 			    => $MAGAZINE ,
415
	"Magazine judiciaire"				=> $MAGAZINE ,
416
    "Magazine du consommateur"  	    => $ECONOMIC ,
417
	"magazine de l'économie"  	    => $ECONOMIC ,
418
	"documentaire : economie"  	    => $ECONOMIC ,
419
    "Dessin animé"                      => $CARTOON ,
420
    "Série jeunesse"            		=> $CARTOON ,
421
	"DESSIN ANIME"						=> $CARTOON ,
422
	"jeunesse : dessin animé d'animation"						=> $CARTOON ,
423
	"jeunesse : dessin animé jeunesse"						=> $CARTOON ,
424
	"jeunesse : dessin animé manga"						=> $CARTOON ,
425
	"téléfilm d'animation"						=> $CARTOON ,
426
	"film d'animation"						=> $CARTOON ,
427
    "Politique"                         => $SOCIAL ,
428
    "Magazine culinaire"                => $COOKING, 
429
    "Ballet"                         	=> $MUSIC ,
430
    "Magazine musical"                  => $MUSIC ,
431
	"Danse"								=> $MUSIC ,
432
	"JINGLE"							=> $MUSIC ,
433
	"clips"							=> $MUSIC ,
434
	"rap"							=> $MUSIC ,
435
    "Formule 1"                         => $SPORT_MOTOR ,
436
    "Comédie sentimentale"              => $SOAP ,
437
	"Comédie dramatique"                => $SOAP ,
438
    "Athlétisme"                        => $ATHLETICS ,
439
    "magazine du jardinage"             => $GARDENING ,
440
    "Interview"                         => $DEBATE ,
441
	"débat parlementaire"                         => $DEBATE ,
442
    "Rugby"                  			=> $SPORT_TEAM ,
443
    "Gastronomie"                       => $COOKING , 
444
	"Série culinaire"					=> $COOKING , 
445
    "Magazine de la décoration"    		=> $HOBBIES ,
446
    "Indycar"                           => $SPORT_MOTOR ,
447
    "Automobilisme"                     => $SPORT_MOTOR ,
448
    "magazine de la santé"              => $MEDECINE ,
449
    "Magazine médical"                  => $MEDECINE ,
450
    "Santé"                             => $MEDECINE ,
451
	"documentaire : santé"                  => $MEDECINE ,
452
    "débat"                             => $DEBATE ,
453
	"interview"                             => $DEBATE ,
454
    "Sciences et technique"             => $TECHNOLOGY ,
455
	"musical"							=> $MUSIC ,
456
	"world music"							=> $MUSIC ,
457
	"blues %26 soul"							=> $MUSIC ,
458
    "Clip"          					=> $MUSIC ,
459
    "Musique"          					=> $MUSIC ,
460
    "Clips"          					=> $MUSIC ,
461
    "Téléfilm musical"                  => $MUSIC ,
462
    "Série musicale"                    => $MUSIC ,
463
    "Téléfilm dramatique"               => $MOVIE ,
464
    "Concert"                           => $MUSIC ,
465
    "Emission musicale"                 => $MUSIC ,
466
    "Film musical"                      => $MUSIC ,
467
    "Comédie musicale"                  => $MUSIC ,
468
    "Pop & Rock"                    => $MUSIC ,
469
    "World Music"                       => $MUSIC ,
470
	"Rap"								=> $MUSIC ,
471
    "Emission sportive"                 => $SPORT_MAGAZINE ,
472
    "Théâtre"       					=> $CULTURE ,
473
    "Spectacle"                     	=> $SHOW ,
474
    "fitness"           				=> $FITNESS ,
475
	"emission du bien-être"           				=> $FITNESS ,
476
    "magazine jeunesse"     			=> $KIDS ,
477
    "Enfants"                           => $KIDS ,
478
    "Emission jeunesse"    				=> $KIDS ,
479
	"Jeunesse"    						=> $KIDS ,
480
    "film pour la jeunesse"             => $KIDS ,
481
    "téléfilm pour la jeunesse"         => $KIDS ,
482
	"téléfilm féerique"         => $KIDS ,
483
	"série jeunesse"         => $KIDS ,
484
    "série d'aventures"    				=> $ADVENTURE ,
485
    "Aventures"                         => $ADVENTURE ,
486
	"film : guerre"                         => $ADVENTURE ,
487
	"film : aventure"                         => $ADVENTURE ,
488
	"film d'aventures"                         => $ADVENTURE ,
489
	"téléfilm d'aventures"				 => $ADVENTURE ,
490
	"Série de guerre"					 => $ADVENTURE ,
491
	"série d'action"					 => $ADVENTURE ,
492
	"film d'action"					 => $ADVENTURE ,
493
	"film de kung-fu"					 => $ADVENTURE ,
494
	"téléfilm catastrophe"					 => $ADVENTURE ,
495
	"film catastrophe"					 => $ADVENTURE ,
496
	"téléfilm d'action"					 => $ADVENTURE ,
497
    "Péplum"                            => $HISTORICAL ,
498
	"Film historique"					=> $HISTORICAL ,
499
	"téléfilm historique"					=> $HISTORICAL ,
500
    "Magazine d'actualité"              => $NEWS_MAGAZINE ,
501
    "Magazine d'information"            => $NEWS_MAGAZINE ,
502
    "Magazine de l'automobile"          => $MOTORING , 
503
    "Magazine de l'économie"            => $ECONOMIC ,
504
    "série d'animation"                 => $CARTOON ,
505
    "Animation"                         => $CARTOON ,
506
	"jeunesse : dessin animé"           => $CARTOON ,
507
    "Téléfilm d'animation"              => $CARTOON ,
508
    "Court métrage d'animation"         => $CARTOON ,
509
    "Film d'animation"                  => $CARTOON ,
510
    "Dessin animé manga"                => $CARTOON ,
511
    "Dessin animé jeunesse"             => $CARTOON ,
512
    "Dessin animé Dessin animé"         => $CARTOON ,
513
    "Série d'action"         			=> $ADVENTURE ,
514
    "film de guerre"                    => $ADVENTURE ,
515
	"Guerre"							=> $ADVENTURE ,
516
    "Film d'aventures"                  => $ADVENTURE ,
517
	"Aventure"							 => $ADVENTURE ,
518
    "Film de suspense"                  => $THRILLER ,
519
    "Comédie noire"                     => $THRILLER ,
520
    "Thriller"                          => $THRILLER ,
521
    "Film policier"                     => $THRILLER ,
522
    "Thriller politique"                => $THRILLER ,
523
    "Magazine de l'art de vivre"        => $TRAVEL ,
524
    "Magazine de l'environnement"       => $NATURE ,
525
	"documentaire : nature"       => $NATURE ,
526
    "Téléfilm d'horreur"          		=> $SF ,
527
    "Série d'horreur"          			=> $SF ,
528
	"téléfilm de science-fiction"		=> $SF ,
529
    "Film de science-fiction"           => $SF ,
530
    "Film fantastique"                  => $SF ,
531
    "Film d'horreur"                    => $SF ,
532
	"Téléfilm fantastique"				=> $SF ,
533
	"Film d'épouvante"					=> $SF ,
534
	"série fantastique"					=> $SF ,
535
	"film de science-fiction"					=> $SF ,
536
	"Téléfilm d'action"					=> $ADVENTURE ,
537
    "Film d'action"					    => $ADVENTURE ,
538
    "Western"                           => $ADVENTURE ,
539
	"Téléfilm"							=> $MOVIE ,
540
	"SERIAL"							=> $MOVIE ,
541
	"Série de science-fiction"			=> $SF ,
542
	"Série historique"					=> $HISTORICAL ,
543
    "Biographie"                        => $HISTORICAL ,
544
    "Civilisations"                     => $HISTORICAL ,
545
    "Histoire"                          => $HISTORICAL ,
546
	"Téléfilm historique"				=> $HISTORICAL ,
547
	"Téléfilm biographique"				=> $HISTORICAL ,
548
	"film historique"				=> $HISTORICAL ,
549
    "Société"                           => $SOCIAL , 
550
    "Magazine de l'emploi"              => $SOCIAL , 
551
    "Justice"                           => $SOCIAL , 
552
    "Conférence"                        => $DEBATE ,
553
    "variétés"                          => $VARIETY ,
554
    "Emission du bien-être"             => $FITNESS ,
555
    "Magazine de la nature"             => $NATURE , 
556
    "Magazine de la pêche"              => $NATURE , 
557
	"Pêche"								=> $NATURE , 
558
    "Magazine des loisirs"              => $HOBBIES ,
559
    "Voyance"                           => $SPIRITUAL ,
560
    "Médias"                            => $BROADCASTING ,    
561
	"documentaire : beaux-arts"			=> $FINE_ARTS  ,
562
	"magazine des beaux-arts"			=> $FINE_ARTS  ,
563
	"jazz"								=> $JAZZ  ,
564
 ) ; 
565

    
566
my $PRE  = '<category lang=\"fr\">' ;
567
my $POST = '</category>'  ;
568

    
569
sub myfilter {
570
  my ($a) = @_;
571
  if ( exists $REPLACE{$a} ) {     
572
      return $REPLACE{$a} ;
573
  } else {
574
      print STDERR "Warning: Unmanaged category: '$a'\n" ;
575
      return $a ;
576
  }
577
}
578

    
579
while (<>) {
580
    my $line = $_ ;
581
    $line =~ s/($PRE)(.*)($POST)/"$1".myfilter("$2")."$3"/ge ;
582
    print $line;
583
} 
584

    
(1-1/2)