-
Notifications
You must be signed in to change notification settings - Fork 1
/
survey_parse_survey.net.nz.perl
executable file
·2180 lines (1957 loc) · 65.3 KB
/
survey_parse_survey.net.nz.perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl
# survey_parse - parse results of survey.net.nz survey in CSV format
#
# (C) 2007, Jakub Narebski
#
# This program is licensed under the GPLv2 or later
use strict;
use warnings;
use Text::CSV;
use Text::Wrap;
use Date::Manip;
use Getopt::Long;
use constant DEBUG => 0;
use Data::Dumper;
# ======================================================================
# ----------------------------------------------------------------------
sub normalize_country {
my $country = shift;
# cleanup
$country =~ s/^\s+//;
$country =~ s/\s+$//;
$country = ucfirst($country);
$country =~ s/^The //;
# corrections
$country =~ s/^U[Kk]$/United Kingdom/;
$country =~ s/^United States$/United States of America/;
$country =~ s/^United States of American$/United States of America/;
$country =~ s/^USA?$/United States of America/i;
$country =~ s/^USA! USA! USA!$/United States of America/;
# expand country code
# see: /usr/share/zoneinfo/iso3166.tab
$country =~ s/^NL$/Netherlands/i;
$country =~ s/^CZ$/Czech Republic/i;
$country =~ s/^CZE$/Czech Republic/i;
$country =~ s/^DE$/Germany/i;
$country =~ s/^AT$/Austria/i;
# correct and normalize
$country =~ s/\bSwitzerlang\b/Switzerland/;
$country =~ s/\bAFrica\b/Africa/;
$country =~ s/\bNederland\b/Netherlands/;
$country =~ s/\bNew zealand\b/New Zealand/;
$country =~ s/^German$/Germany/;
$country =~ s/^Deutschland$/Germany/;
$country =~ s/^Czech republic$/Czech Republic/;
$country =~ s/^Brazil$/Brazil/i;
$country =~ s/\bBrasil\b/Brazil/;
$country =~ s/\bAustira\b/Austria/;
$country =~ s/^German$/Germany/;
$country =~ s/^Russia$/Russian Federation/;
$country =~ s/^England$/United Kingdom/;
$country =~ s/^Scotland$/United Kingdom/;
return $country;
}
# returns ARRAY
sub normalize_language {
my $lang = shift;
# special case
if ($lang =~ /^LSF/) {
return ($lang, 'French');
}
# cleanup
$lang =~ s/^\s+//;
$lang =~ s/\s+$//;
$lang =~ s/\.$//;
$lang =~ s/[()]//g;
$lang =~ s!/! !g;
# remove "not understood"
if ($lang =~ /^(What|WTF|Huh\?|human language)/) {
return 'not understood';
}
# remove programming languages
if ($lang =~ /^(Python|Ruby|XML|Logo|JavaScript|OCaml|Perl|maths?|erlang|C|C\+\+|AWK|bash|Java|C\+\+ perl|C shell)$/i) {
return 'invalid (computer language)';
}
# remove extra qualifiers
$lang =~ s/USA\s+English/English/i;
$lang =~ s/(British|American|US)\s+English/English/i;
$lang =~ s/([a-z]{2})_[A-Z]{2}/$1/g;
# strip comments
$lang =~ s/Depends on who I'm talking to\.\.//;
$lang =~ s/on the internet//;
$lang =~ s/in everyday live though except for Movies where it's english again ;//;
$lang =~ s/for computer programs//;
$lang =~ s/I think you mean 'natural language'\?//;
$lang =~ s/when using computers|otherwise//;
$lang =~ s/is fine too//;
$lang =~ s/I'm fine with git talking english//;
$lang =~ s/my english is not very well but would be OK too//;
$lang =~ s/\[Actually none\]//;
$lang =~ s/All languages//;
$lang =~ s/would be nice not jeeded though//;
$lang =~ s/If not exist yet//;
$lang =~ s/I speak english\. All translations available should be done//;
$lang =~ s/personally I don't\. But I think the most needed would be//;
$lang =~ s/See answer to question 32//;
$lang =~ s/My language is//;
$lang =~ s/Does not apply//;
$lang =~ s/^n[\/ ]?a$//i;
$lang =~ s/^(no|none\??|no need|none l10n stinks)$//i;
$lang =~ s/not for me//;
$lang =~ s/^Sanity$//;
$lang =~ s/^You meant.*$//;
$lang =~ s/^tlhIngan Hol$//;
$lang =~ s/^ow$//; # ???
#$lang =~ s/(^|\W|\s)no(\s|\W|$)//; # ???
$lang =~ s/\b(and|but|equally|otherwise)\b//;
$lang =~ s/\bnative\b//;
$lang =~ s/\bequally\b//;
$lang =~ s/\bEnglish\?/English/;
$lang =~ s/:o//;
$lang =~ s/-+//;
$lang =~ s/\.+//;
# corrections
$lang =~ s/Englisch\b/English/;
$lang =~ s/Engligh/English/;
$lang =~ s/\bFrance\b/French/;
$lang =~ s/\bGermany\b/German/;
$lang =~ s/\bDeutsch\b/German/;
$lang =~ s/\bUkrainain\b/Ukrainian/;
$lang =~ s/\bJapan\b/Japanese/;
$lang =~ s/\bBrazilian Portuguese\b/Portuguese/;
# expand language codes
# see (incomplete): /usr/share/locale/locale.alias
$lang =~ s/(^|\W|\s)pt(\s|\W|$)/$1Portuguese$2/ig;
$lang =~ s/(^|\W|\s)en(\s|\W|$)/$1English$2/ig;
$lang =~ s/(^|\W|\s)de(\s|\W|$)/$1German$2/ig;
$lang =~ s/(^|\W|\s)fr(\s|\W|$)/$1French$2/ig;
$lang =~ s/(^|\W|\s)it(\s|\W|$)/$1Italian$2/ig;
$lang =~ s/(^|\W|\s)sv(\s|\W|$)/$1Swedish$2/ig;
$lang =~ s/(^|\W|\s)no(\s|\W|$)/$1Norwegian$2/ig; # ???
# remove leading and trailing spaces after stripping comments
$lang =~ s/^\s+//;
$lang =~ s/\s+$//;
# split multiple answers, normalize
my @languages = map(ucfirst, split(' ', $lang));
return @languages;
}
sub normalize_age {
my $age = shift;
# extract
$age =~ s/^[^0-9]*([0-9]+).*$/$1/;
#return $age;
# quantize
if ($age < 18) {
return ' < 18';
} elsif ($age < 22) {
return '18-21';
} elsif ($age < 26) {
return '22-25';
} elsif ($age < 31) {
return '26-30';
} elsif ($age < 41) {
return '31-40';
} elsif ($age < 51) {
return '41-50';
} elsif ($age < 76) {
return '51-75';
} else {
return ' > 75';
}
#return $age;
}
# returns ARRAY
sub normalize_heard {
my $source = shift;
my @result = ();
my $orig = $source;
# cleanup
$source =~ s/^\s+//;
$source =~ s/\s+$//;
# corrections
$source =~ s/\bmailling\b/mailing/;
$source =~ s/\bYou ?tube\b/YouTube/;
$source =~ s/\bLKLM\b/LKML/i;
$source =~ s/\binernet\b/Internet/;
$source =~ s/\binternets\b/Internet/;
$source =~ s/\bThorvalds\b/Torvalds/;
$source =~ s/\bTorvold\b/Torvalds/;
$source =~ s/\bco[ -]worker[s]?/coworker/i;
$source =~ s/\bKernel Trap\b/KernelTrap/i;
$source =~ s/\b(colligues|collegues)\b/colleagues/i;
$source =~ s/\bfus\b/fuss/;
$source =~ s/\brecomendation\b/recommendation/i;
$source =~ s/\busnig\b/using/i;
# remove comments
$source =~ s/^from( the)?\s+//i;
$source =~ s/^I read about (it )?//;
$source =~ s/^It was announced in //;
$source =~ s/^Because of //i;
$source =~ s/^In a //i;
$source =~ s/^Probably\s+//i;
$source =~ s/[(]?I think[)]?/ /;
$source =~ s/\s*(\?)\s*/ /;
# categorization
if ($source =~ s/\b(the )?BK( license withdrawal| fiasco)\b//i ||
$source =~ s/^.*\bdropping BK\b.*$//i ||
$source =~ s/^.*\bAfter the (BK|BitKeeper) 'breakup'.*$//i ||
$source =~ s/^.*\b(switch(ed)?|move) from (BK|BitKeeper) to git\b//i ||
$source =~ s/\b(During the |Follow(ing|ed) the .*)?BitKeeper(.*(aftermath|dispute|drama|fallout|fiasco|debacle|situation|media fuss|dropped|become paid|episode|thing|affair))\b//i) {
push @result, 'BitKeeper news';
}
if ($source =~ s/Linux Kernel Developer List//i ||
$source =~ s/Linux Developers List//i ||
$source =~ s/\b(Linus'? )?(announce(ment)? )?(on )?LKML(\.org)?( announce)?\b//i ||
$source =~ s/\b(Linux[- ])?kernel(\.org)? (mailing list|mailing|ml)( archive| FAQ)?\b//i ||
$source =~ s/\bLinux([- ]kernel)?(\.org)? (mailing list|mailing|ml)( archive| FAQ)?\b//i ||
$source =~ s/\b(the )?kernel mailinglist\b//i ||
$source =~ s/^Linux[- ]Kernel list$//i ||
$source =~ s/^LKML mailing list$//i ||
$source =~ s/^LKML( when.*| mailing list.*)?[?]?$//i) {
push @result, 'LKML';
}
if ($source =~ s/\bSlashdot(\.org)?( article)?\b//i ||
$source =~ s!^/\.$!!) {
push @result, 'Slashdot';
}
if ($source =~ s/\bKernelTrap(\.org| coverage)?\b//i) {
push @result, 'KernelTrap';
}
if ($source =~ s/\bKernelTraffic\b//i) {
push @result, 'KernelTraffic';
}
if ($source =~ s/(^.*on |^.*like )?\bLWN(\.net)?\b(\s+when.*$)?//i ||
$source =~ s/^Linux Weekly News$//i) {
push @result, 'LWN';
}
if ($source =~ s/\b(browsing )?kernel\.org( web)?\b//i ||
$source =~ s/\bLinux kernel website\b//i) {
push @result, 'kernel.org';
}
if ($source =~ s/^(\w*\.)?freedesktop(\.org)?$//i ||
$source =~ s/^Linux and (\w*\.)?freedesktop(\.org)?$//i) {
push @result, 'freedesktop.org';
}
if ($source =~ s/\bLinus'?s? Google (video talk|talk|presentation|video|speech|conference at Google Video|tech talk on youtube)\b//i ||
$source =~ s/\bLinus'?s? on (git|Google Talks via Google Video)\b//i ||
$source =~ s/\bLinus'?s? (Torvalds'?s? )?(tech )?talk[s]?\b.*$//i ||
$source =~ s/\bLinus Torvalds GIT webcast\b// ||
$source =~ s/\bLinu[xs]'?s? (Torvalds )?(git )?talk at Google\b//i ||
$source =~ s/presentation on YouTube\b//i ||
$source =~ s/^Google Video.*$//i ||
$source =~ s/^Google Tech Talk$// ||
$source =~ s/^Linus on git$//i ||
$source =~ s/^Google talk from Linus$// ||
$source =~ s!(Torvalds.*|Linus.*)?http://www\.youtube\.com/watch[ ?]v4XpnKHJAok8!! ||
$source =~ s/^.*video of Linus talking about it.*$// ||
$source =~ s/\bLinux on GIT [(]Google Conference[)] video\b// ||
$source =~ s/\bLinus told me I was stupid and ugly\b// ||
$source =~ s/^(.* on )?YouTube$//i) {
push @result, 'Linus presentation at Google';
}
if ($source =~ s/\b(I )?Can't (recall|remember)\b//i ||
$source =~ s/\b(I )?Don't remember\b//i ||
$source =~ s/\bdunno\b//) {
push @result, 'don\'t remember';
}
if ($source =~ s/\b(recommendation )?(from )?(a )?friend[s]?( linked.*| told me| of mine)?\b//i ||
$source =~ s/\b(a |my )?colleague[s]?\b//i) {
push @result, 'friend';
}
if ($source =~ s/\b(a )?co-?worker[s]?\b//i ||
$source =~ s/\b(a )?co-?developer[s]?\b//i ||
$source =~ s/\b(a )?fellow (worker|developer)[s]?\b//i ||
$source =~ s/\b(a )?project I work with\b//i ||
$source =~ s/\b(a )?project manager\b//i ||
$source =~ s/\b(through )?(my )?job\b//i ||
$source =~ s/\b(company|work)\b//i) {
push @result, 'work / coworker';
}
if ($source =~ s/\bcommunity buzz\b//i ||
$source =~ s/\bbuzz on.*$//i ||
$source =~ s/\bgeneral buzz\b//i ||
$source =~ s/\bword of mouth\b//i ||
$source =~ s/\bnetwork chatter\b//i ||
$source =~ s/\bthe hype\b//i ||
$source =~ s/\beveryone (knows|uses) (it|git)\b//i) {
push @result, 'word of mouth';
}
if ($source =~ s/\bIRC( channel)?\b//i ||
$source =~ s/^.*on #lisp.*$//i) {
push @result, 'IRC';
}
if ($source =~ s/\b(variuos )?blog[s]?( entry| post[s]?| really)?\b//i ||
$source =~ s/\bweblog\b//i) {
push @result, 'blog';
}
if ($source !~ m/XMMS2 developer/i &&
$source =~ s/\b(using )?(WINE|WineHQ|LilyPond|U-Boot|Arch Linux|Beryl|Compiz|Cairo|Elinks|OLPC|One Laptop Per Child|Rubinius|XMMS2|OpenTTD|Source Mage (GNU\/)?Linux|X\.?Org)( projects?| uses it| adopted it| started using it| devel)?\b//i ||
$source =~ s/\b(with )?freedesktop(\.org)? projects?\b//i ||
$source =~ s/\b(some )?Lisp projects?( were using it)?\b//i ||
$source =~ s/\b(FOSS|OSS|other) projects?( involvement)?\b//i ||
$source =~ s/\bUse in other projects\b//i ||
$source =~ s/\bprojects? using GIT( as SCM)?\b//i) {
push @result, 'some project uses git';
}
if ($source =~ s/^Linus( Torvalds)?$//i ||
$source =~ s/\bCarl Worth\b//i ||
$source =~ s/\bKeith Packard\b//i ||
$source =~ s/\bRalf Baechle\b//i ||
$source =~ s/\bRandal Schwartz\b//i ||
$source =~ s/\bRyan Anderson\b//i ||
$source =~ s/\bSam Vilain\b//i ||
$source =~ s/\b(pasky|Petr Baudis)\b//i ||
$source =~ s/\bMcVoy\b//i ||
$source =~ s/\bTommi Virtanen\b//i ||
$source =~ s/\bBart Trojanowski\b//i ||
$source =~ s/\bJulio Martinez\b//i) {
push @result, 'developer by name';
}
if ($source =~ s/\b(a |tech )?news.*websites?\b//i ||
$source =~ s/\blinux[- ](kernel )?(related )?news\b//i ||
$source =~ s/\b(online )?news (feed|site)s?\b//i ||
$source =~ s/\bnews about (the )?kernel\b//i ||
$source =~ s/\bnews from internet site\b//i ||
$source =~ s/\b^news$//i ||
$source =~ s/\b^RSS feeds?$//i ||
$source =~ s/\b(http:\/\/)?(www\.)?linuxfr\.org\b//i ||
$source =~ s/\bOSNews(\.com)?\b//i ||
$source =~ s/\bheise\.de\b//i ||
$source =~ s/\bLinux\.com\b//i ||
$source =~ s/\bNewsForge\b//i ||
$source =~ s/^Linux Magazine$//i ||
$source =~ s/\b(on (a|some) |from )?(IT |various )?news (site|page)s?\b//i ||
$source =~ s/^news$//i) {
push @result, 'news site';
}
if ($source =~ s/\b[\w.]*(Digg|Reddit)[\w.]*\b//i ||
$source =~ s/\b^planets?.*\b//i ||
$source =~ s/\bGNOME (bloggers|community)\b//i) {
push @result, 'community site';
}
if ($source =~ s/^Google$//i ||
$source =~ s/^internet search$//i ||
$source =~ s/^search engine$//i) {
push @result, 'searching Internet';
}
if ($source =~ s/\b(SCM|VCS|RCS) comparisons?( table)?\b//i ||
$source =~ s/\b(via )?(Arch|Monotone|Mercurial|bzr) mailing list\b//i ||
$source =~ s/\bSVK article\b//i ||
$source =~ s/\bvia SVN\b//i ||
$source =~ s/\balternative to tla\b//i ||
$source =~ s/\bresearching (SVN|CVS) alternatives\b//i ||
$source =~ s/\bsearch for version control\b//i ||
$source =~ s/^.*solve.*SCM problem.*$//i ||
$source =~ s/\b(was )?looking for (a )?(D?SCM|VCS|RCS)\b//i ||
$source =~ s/\bhg\b//i ||
$source =~ s/\b(I )?follow (the )?(VCS|RCS|SCM) field( closely)?\b//i ||
$source =~ s/\bDarcs (competitor|mailing list)\b//i ||
$source =~ s/\blooking for (SCM|distributed source control)\b//i) {
push @result, 'other SCM / SCM research';
}
if ($source =~ s/\bAs it became SCM.*for kernel\b//i ||
$source =~ s/\b(initial|Linus'?( first)?) announcement\b//i ||
$source =~ s/\bkernel moving.* announcement\b//i ||
$source =~ s/\bwatched initial development\b//i ||
$source =~ s/^at (the )?start$//i) {
push @result, 'initial GIT announcement';
}
if ($source =~ s/\b(?<!Articles about )Linux[- ]kernel (devel|compil)\w*\b//i ||
$source =~ s/\b(doing )?(Linux|kernel)( driver)? devel\w*\b//i ||
$source =~ s/\bfor (the )?Linux kernel//i ||
$source =~ s/\bLinux's VCS\b//i ||
$source =~ s/\bsome Linux project\b//i ||
$source =~ s/\bthe kernel.*it\b//i ||
$source =~ s/\blinux[- ]kernel 2\.6\.[0-9]*\b//i ||
$source =~ s/\b(Linux )?kernel (was|is) using it\b//i ||
$source =~ s/\b(Linux )?kernel use(s|d) it\b//i ||
$source =~ s/^(the )?Linux[- ]kernel( use[sd] it| sources)?$//i ||
$source =~ s/^(Linux|kernel)( development| compiling| uses it| (was|is) using it)?$//i ||
$source =~ s/\b(at )?Linux kernel project\b//i) {
push @result, 'Linux kernel uses it';
}
if (!@result &&
$source =~ s/^(the )?Internet$//i ||
$source =~ s/^(read.*)?online\.?$//i ||
$source =~ s/\bonline sites?\b//i ||
$source =~ s/\btech-related website\b//i ||
$source =~ s/\bOn the Internet somewhere\b//i ||
$source =~ s/^reading.*on the web.*$//i ||
$source =~ s/^(the )?(net|web|websites?)$//i) {
push @result, 'Internet';
}
unless (@result) {
push @result, 'other / uncategorized';
}
return @result;
}
sub normalize_version {
my $line = shift;
my $version;
# find version number
if ($line =~ /\bv?([0-1]\.[0-9]+[.a-z0-9X]*)\b/) {
$version = $1;
} elsif ($line =~ /(^|\b)v?([0-1]\.(:?[xX\?]|sth|something))(\b|$)/) {
$version = $1;
} else {
return '(no version string)';
}
# cleanup
$version =~ s/\.?(?:something|sth)/.x/;
$version =~ s/\.xx+\b/.x/;
$version =~ s/\.X\b/.x/;
$version =~ s/ish\b/.x/;
$version =~ s/^0\.9([^9]*)$/0.99$1/;
# divide into clusters
$version =~ s/^0\.[0-9]([^9]+|$)$/0.x/;
$version =~ s/^0\.99.*$/0.99x/;
$version =~ s/^(1\.[0-9]).*$/$1x/;
if ($version !~ /x$/) {
$version = '';
}
return $version;
}
# returns ARRAY
sub normalize_scm {
my $scm = shift;
# cleanup
$scm =~ s/^\s+//;
$scm =~ s/\s+$//;
$scm =~ s/[.]//g;
# N/A or mistakes
$scm =~ s/^-$//;
$scm =~ s/^1441$//;
# corrections
$scm =~ s/\bsubverion\b/subversion/ig;
$scm =~ s/\bMecurial\b/Mercurial/ig;
$scm =~ s/\bCleacase\b/ClearCase/ig;
# remove comments etc.
$scm =~ s/\b(and|or|of)\b//ig;
$scm =~ s/\ba (?:lot|bit|little)?\b//ig;
$scm =~ s/(?:[(]alas[)]|almost|primari?ly|[(]death[)]|occasionall?y|limited|some(:?times)|formerly|[(]briefly[)]|most)//ig;
$scm =~ s/\((:?admin|checkout(:?ing)? only)\)//ig;
$scm =~ s/\b(:?prior to git|check ?out only)\b//ig;
$scm =~ s/[(]ugg - when I'm forced[)]//ig;
$scm =~ s/[(]blegh![)]//ig;
$scm =~ s/[(]currently[)]//ig;
$scm =~ s/[(]both very seldom[)]//ig;
$scm =~ s/[(]but not anymore[)]//ig;
$scm =~ s/[(]?long time ago[)]?//ig;
$scm =~ s/\bfor (:?different|C programming) projects\b//ig;
$scm =~ s/\bwhen it existed\b//ig;
$scm =~ s/\btiny bit\b//ig;
$scm =~ s/[(]vss some time ago[)]/vss/ig;
$scm =~ s/\bI use git exclusively now\b//ig;
$scm =~ s/\bin the (:?distant )?past\b//ig;
$scm =~ s/\bbut I only use it for upstream commits now\b//ig;
$scm =~ s/\bI('ve)? used?( to use)?\b//ig;
$scm =~ s/\b(:?at work|limited|some|others)\b//ig;
$scm =~ s/\btiny bit of\b//ig;
$scm =~ s/\bwhen forced\b//ig;
$scm =~ s/\bswitched from (.*) to git\b/$1/ig;
$scm =~ s/\bI'm looking at\b//ig;
$scm =~ s/\bbefore Larry McVoy went insane\b//ig;
$scm =~ s/\bnow\b//ig;
$scm =~ s/\s+-\)//g;
# normalize SCM names
$scm =~ s/\bgit\b//ig;
$scm =~ s/\bstg\b//ig; # StGIT
$scm =~ s/\b(:?cg|Cogito)\b//ig; # Cogito
$scm =~ s/\bSCM\b/SCM/ig;
$scm =~ s/\bCVS\b/CVS/ig;
$scm =~ s/\bRCS\b/RCS/ig;
$scm =~ s/\b(:?MS )?VSS\b/VSS/ig;
$scm =~ s/\bSVK\b/SVK/ig;
$scm =~ s/\bSCCS\b/SCCS/ig;
$scm =~ s/\bCVCS\b/CVCS/ig;
$scm =~ s/\bPVCS(:? dimensions)?\b/PVCS/ig;
$scm =~ s/\b(?:SVN|Subversion)\b/Subversion/ig;
$scm =~ s/\bClear ?Case(:? ADE| UCM)?\b/ClearCase/ig;
$scm =~ s/\bStarTeam\b/StarTeam/ig;
$scm =~ s/\bAccuRev\b/AccuRev/ig;
$scm =~ s/\bOmniworks\b/Omniworks/ig;
$scm =~ s/\bthat awful M\$ one\b/VSS/ig;
$scm =~ s/\b(:?Visual )?SourceSafe\b/VSS/ig;
$scm =~ s/\b(?:BK|BitKeeper|B\*tk\*\*p\*r)\b/BitKeeper/ig;
$scm =~ s/\b(?:Perforce|p4)\b/Perforce/ig;
$scm =~ s/\bDarcs\b/Darcs/ig;
$scm =~ s/\bQuilt\b/Quilt/ig;
$scm =~ s/\b(?:hg|Mercurial)\b/Mercurial/ig;
$scm =~ s/\b(?:mnt|mtn|Monotone)\b/Monotone/ig;
$scm =~ s/Arch via Bazaar\(v1\)/Bazaar/ig;
$scm =~ s/Arch \((:?using )?Bazaar\)/Bazaar/ig;
$scm =~ s/Arch \((:?Bazaar|baz)\)/Bazaar/ig;
$scm =~ s/\b(:?baz|Bazaar)\b/Bazaar/ig;
$scm =~ s/\b(:?bzr|Bazaar[- ]NG)\b/Bazaar-NG/ig;
$scm =~ s/\btla \(gnu-arch\)/GNU_Arch/ig;
$scm =~ s/\b(:?GNU )?arch \(tla\)/GNU_Arch/ig;
$scm =~ s/\btla\s+arch\b/GNU_Arch/ig;
$scm =~ s/\barch\s+tla\b/GNU_Arch/ig;
$scm =~ s/\b(:?(:?GNU[\/ ])?Arch|tla)\b/GNU_Arch/ig;
$scm =~ s/\b(:?Sun )?TeamWare\b/Sun_TeamWare/ig;
$scm =~ s/\bSun'?s? NSS\b/Sun_NSS/ig;
$scm =~ s/\bSun'?s? NSE\b/Sun_NSE/ig;
$scm =~ s/CMS \(digital\)/CMS_(Digital)/ig;
$scm =~ s/CMS \(VMS\)/CMS_(VMS)/ig;
$scm =~ s/VAX CMS/CMS_(VAX)/ig;
$scm =~ s/\bSerena Version Manager\b/Serena_Version_Manager/ig;
$scm =~ s/\bSourcerer's Apprentice\b/Sourcerer's_Apprentice/ig;
$scm =~ s/diff[+ ]patch/diff_patch/ig;
$scm =~ s/patch[+ ]tarballs/diff_patch/ig;
$scm =~ s/'cp -a'/'cp_-a'/ig;
$scm =~ s/scripts for 'shadow trees'/scripts_for_'shadow_trees'/ig;
$scm =~ s/\bakpm patch scripts\b/akpm_patch_scripts/ig;
$scm =~ s/\bpossibly undisclosed ones\b/undisclosed/ig;
$scm =~ s/\breally horrible stuff\b/really_horrible_stuff/ig;
$scm =~ s/\bcustom in-house tools\b/custom_in-house_tools/ig;
$scm =~ s/\bnone\b/none/ig;
# convert separators to space
$scm =~ s![;/&,+]! !g;
# cleanup whitespace
$scm =~ s/^\s+//;
$scm =~ s/\s+$//;
$scm =~ s/\s+-[)]//g;
# split
#return $scm;
return map { s/_/ /g; $_ } split(' ', $scm);
}
# returns Yes/No
sub normalize_scm_imported {
my $scm = shift;
# strip spaces
$scm =~ s/^\s+//;
$scm =~ s/\s+$//;
return '' unless $scm;
return 'N/A' if ($scm =~ m!^(?:N/?A|-+)$!i);
if ($scm =~ /^No\.?$/i ||
$scm =~ /^No\s+I just put/i ||
$scm =~ /^No\s+I'm not/i ||
$scm =~ /^No\s+I did not/i ||
$scm =~ /^No\s+they don't/i ||
$scm =~ /^No\s+too much hassle/i ||
$scm =~ /^No\s+started from scratch/i ||
$scm =~ /^No\s+applied patches/i ||
$scm =~ /^No.\s+Convinced.*to switch/i ||
$scm =~ /^No\s+it's hard enough/i ||
$scm =~ /^(?:No\s+not yet|not now)/i ||
$scm =~ /^(?:none|nope)/i ||
$scm =~ /^Not at (?:the moment|this point)/i ||
$scm =~ /^Not any ?more/i ||
$scm =~ /^Not[- ]yet/i ||
$scm =~ /^Not currently/i ||
$scm =~ /^No\s+just the Lin[iu]x kernel/i ||
$scm =~ /^Haven\'t (?:done|tried)/i) {
return 'No';
}
return 'Yes';
}
# returns ARRAY
sub normalize_scm_importtool {
my $line = shift;
my @tools = ();
return '' unless (defined $line && $line ne '');
# corrections
$line =~ s/\bTaylor\b/Tailor/i;
$line =~ s/csvimport/cvsimport/;
# by hand
$line =~ /\b(?:by hand|just patch|untarred|manually|hand\.\.\.)\b/i ||
$line =~ /\bhandcrafted partial solution\b/i ||
$line =~ /\b(?:git[- ]checkout|git[- ]apply|git-format-patch|core[- ]git|bare git tools|command line tools|manual merging|git\/shell|vim\s+diff)\b/i ||
$line =~ /^tar$/i
and push @tools, 'by hand';
# script or fast-import script
$line !~ /\bgit-fast-?import\b/ &&
($line =~ /\b(?:shell|custom|own|naive) (?:script|tool)[s]?\.?\b/i ||
$line =~ /\b(?:custom[- ]written|self[- ]made)\b/i ||
$line =~ /\b(?:customized|own|self-written|wrote|hand(?: rolled|woven|crafted)|homemade).*scripts?\b/i ||
$line =~ /\b(?:cvsps\s+homegrown|home-?brew script)\b/i ||
$line =~ /custom (?:for others?|in[- ]?house)/ ||
$line =~ /(?:self-haxxored python|in[- ]?house) tool/ ||
$line =~ /script (?:I )?(?:made|wrote)/i ||
$line =~ /^the shell$/ ||
$line =~ /roll my own/ ||
$line =~ /some scripts?/i ||
$line =~ /custom python hack/i ||
$line =~ /Homegrown Perl monster/i)
and push @tools, 'custom script';
$line =~ /\bgit-fast-?import\b/
and push @tools, 'fast-import script';
# universal
$line =~ /\bTailor\b/i
and push @tools, 'Tailor';
$line =~ /\bconvert-repo\b/i
and push @tools, 'convert-repo';
# CVS
$line =~ /\b(?:git[- ])?cvs-?import\b/ ||
$line =~ /\bgit-cvs(?: \+ scripts)?$/ ||
$line =~ /^git-cvs[\/ ]/
and push @tools, 'git-cvsimport';
$line =~ /\bgit[- ]cvsexportcommit\b/
and push @tools, 'git-cvsexportcommit';
$line =~ /\bgit[- ]cvsserver\b/ ||
$line =~ /\bgitserver\b/
and push @tools, 'git-cvsserver';
$line =~ /\b(?:parsecvs|cvsparse|Keith Packard'?s?)(?! doesn't work)\b/
and push @tools, 'parsecvs';
$line =~ /\bcvstogit\b/
and push @tools, 'cvstogit';
$line =~ /^cvs2git$/
and push @tools, 'cvs2git';
$line =~ /\bfromcvs\b/
and push @tools, 'fromcvs';
# Subversion (svn)
$line !~ /git svn init.*git svn import/ &&
($line =~ /\b(?:git[- ])?svn[- ]?import\b/ ||
$line =~ /\bsvn import tool\b/)
and push @tools, 'git-svnimport';
$line =~ /\bgit[- ]svn(?:\.perl|\.pl)?(?!\*|[- ]import)\b/ ||
$line =~ /\bsvn-git\b/
and push @tools, 'git-svn';
$line =~ /\bgit-svn\*/
and push @tools, 'git-svn', 'git-svnimport';
# Arch (tla, baz, bzr)
$line =~ /\b(?:git[- ])?arch-?import\b/
and push @tools, 'git-archimport';
# Perforce (p4)
$line =~ /\bgit-p4-?import(?:\.bat)?\b/
and push @tools, 'git-p4import';
$line =~ /\bgit-?p4(?:[^-]| |$)/
and push @tools, 'git-p4';
# Mercurial (hg)
$line =~ /\bhgpullsvn\b/
and push @tools, 'hgpullsvn';
$line =~ /\bhgsvn\b/
and push @tools, 'hgsvn';
$line =~ /\bhg2git\b/
and push @tools, 'hg2git';
$line =~ /\bhg-to-git\b/
and push @tools, 'hg-to-git';
# Darcs
$line =~ /\bdarcs[2\/]git(?:\.py)?\b/
and push @tools, 'darcs2git';
# ClearCase UCM
$line =~ /\bgit-ucmimport(?:\.rb)?\b/
and push @tools, 'git-ucmimport';
# BitKeeper
$line =~ /custom.*bk2git/i
and push @tools, 'bk2git (customized)';
# Moin?
$line =~ /\bmoin2git\b/
and push @tools, 'moin2git';
# Eclipse?
$line =~ /\bEclipse\b/i
and push @tools, 'Eclipse';
# special cases
$line =~ /git-\{svs cvs\}import/
and push @tools, 'git-cvsimport', 'git-svnimport';
$line =~ /^(?:an )?importer$/i ||
$line =~ /\bgit-[*]?import\b/ ||
$line =~ /^(?:the )?included one$/i ||
$line =~ /\b(?:stock|default|standard) (?:git )?tools?\b/i ||
$line =~ /\bsomething from git\b/i ||
$line =~ /\bscripts included with git\b/i ||
$line =~ /\bdon't know\b/i ||
$line =~ /^can't remember/i ||
$line =~ /^git$/ ||
$line =~ /^SCCS->CVS->GIT$/i
and push @tools, 'unspecified';
$line =~ m!^(?:none(?: yet)?|no(?:thing)?|-+|N/?A|\.+|/|(?:I )?(?:did|have)n't|x|\?)\.?$!i ||
$line =~ /^None \(see previous answer\)/ ||
$line =~ /\bhave no time\b/i ||
$line =~ /\b(?:not applicable|nothing yet|does not apply)\.?\b/i ||
$line =~ /^(?:I didn't do (?:it|the import)|I said no|I haven't use)/
and push @tools, 'N/A';
return @tools;
}
# returns ARRAY
sub normalize_march {
my $line = shift;
my @arch = ();
my %known_arch =
('i386' => undef,
'i586' => undef,
'i686' => undef,
'AMD' => undef,
'amd64' => undef,
'x86' => undef,
'x86-64' => undef,
'IA-32' => undef,
'IA-64' => undef,
'PPC' => undef,
'ppc64' => undef,
'Intel' => undef,
'Athlon' => undef,
'Alpha' => undef,
'SPARC' => undef,
'sparc64' => undef,
'MIPS' => undef,
'mips64' => undef,
'mipsel' => undef,
'RS/600' => undef,
'RS/6000' => undef,
'PA-RISC' => undef,
'parisc64' => undef,
'Sun-Fire' => undef,
'SUNW' => undef,
'sun4u' => undef,
'sun4v' => undef,
'S360' => undef,
'k8' => undef,
'ARM' => undef,
'Apple' => undef,
'MacBook' => undef,
'PowerBook' => undef,
'iMac' => undef,
);
return '' unless (defined $line && $line ne '');
# normalize architecture names
$line =~ s/\b(?:PowerPC|PPC)\b/PPC/ig;
$line =~ s/\b(?:PowerPC|PPC)64\b/ppc64/ig;
$line =~ s/\bamd64\b/amd64/ig;
$line =~ s/\bx8[64][-_]32\b/x86/ig;
$line =~ s/\bx8[64][-_](?:64|86)\b/x86-64/ig;
$line =~ s/\b(?:Genuine)?Intel\b/Intel/ig;
$line =~ s/\b(?:Authentic)?AMD\b/AMD/ig;
$line =~ s/\bAlpha\b/Alpha/ig;
$line =~ s/\bSPARC\b/SPARC/ig;
$line =~ s/\bMIPS\b/MIPS/ig;
$line =~ s/\bPA-RISC\b/PA-RISC/ig;
$line =~ s!\bRS/600\b!RS/600!ig;
$line =~ s/\bARM\b/ARM/ig;
$line =~ s/\bIA[-_]?32\b/IA-32/ig;
$line =~ s/\bIA[-_]?64\b/IA-64/ig;
$line =~ s/\bMacBook[0-9]*\b/MacBook/ig;
$line =~ s/\bPowerBook[0-9]*\b/PowerBook/ig;
$line =~ s/\bSun-Fire[-v0-9]*\b/Sun-Fire/ig;
$line =~ s/\bPentium\b/i586/ig;
$line =~ s/\bCore Duo\?\b/Intel/ig;
$line =~ s/\bIntel x86\b/x86/ig;
$line =~ s/\bppc \(?32 & 64\b/PPC ppc64/ig;
$line =~ s/\bAMD 64\b/amd64/ig;
$line =~ s/\bi686 (AMD)\b/AMD/ig;
$line =~ s/\bAMD [0-9]* (x86)\b/x86/ig;
$line =~ s/\bamd64\s+i386\b/amd64/ig;
$line =~ s/\bix86\b/x86/ig;
$line =~ s/\bia86\b/IA-64/ig;
$line =~ s!\bx86-32/64\b!x86 x86_64!ig;
$line =~ s/\bStrongARM\b/ARM/ig;
$line =~ s/\barmv5tel\b/ARM/ig;
#$line =~ s/\bSUN\b/SUNW/g;
$line =~ s/\bintel32\b/i386/ig;
$line =~ s/\b([3-6])86\b/i${1}86/ig;
$line =~ s/\bPower MacIntosh\b/PowerBook/ig;
$line =~ s/\bIntel.*?x86/x86/ig;
$line =~ s/\bApple (iMac|PowerBook|MacBook)/$1/ig;
if ($line !~ /\b(?:(?:Mac|Power)Book|PPC)\b/i) {
$line =~ s/\bG4\b/PowerBook/ig;
}
if ($line !~ /\b(?:MacBook|PowerBook|Apple)\b/i) {
$line =~ s/\bDarwin\b/Apple/ig;
}
# replace separators with whitespace
$line =~ s![;/()]! !g;
# return only known architectures
foreach my $a (split ' ', $line) {
if (exists $known_arch{$a}) {
push @arch, $a;
}
}
push @arch, 'unknown' unless @arch;
return @arch;
}
# returns ARRAY
sub normalize_os {
my $line = shift;
my @os_list = ();
# corrections
$line =~ s/Max/Mac/i;
$line =~ s/Cygnus/Cygwin/i;
$line =~ s/\bWindow\b/Windows/i;
# Linux, sometimes only distribution name
if ($line =~ /Linux/i ||
$line =~ /(?:ubuntu|Debian|Gentoo|Fedora|Mandriva|
SuSE|RHEL|RedHat|CentOS|Slackware|RawHide|
SimplyMEPIS|FC[0-9]|2\.[46]\.[0-9]+)/ix) {
push @os_list, 'Linux';
}
# Windows, different flavours
if ($line =~ /Cygwin/i) {
push @os_list, 'MS Windows (Cygwin)';
} elsif ($line =~ /msys/i) {
push @os_list, 'MS Windows (msys)';
} elsif ($line =~ /(?:Windows|Win(?:XP|2k)|\bw2k\b)/i) {
push @os_list, 'MS Windows (unsp.)';
}
# MacOS X and Darwin
if ($line =~ /(?:Darwin|Mac[ ]?OS|OS[ ]?X)/i) {
push @os_list, 'MacOS X / Darwin';
}
# *BSD
if ($line =~ /FreeBSD/i) {
push @os_list, 'FreeBSD';
}
if ($line =~ /OpenBSD/i) {
push @os_list, 'OpenBSD';
}
# other
if ($line =~ /Solaris/i) {
push @os_list, 'Solaris';
}
if ($line =~ /HP-UX/i) {
push @os_list, 'HP-UX';
}
if ($line =~ /AIX/i) {
push @os_list, 'AIX';
}
if ($line =~ /SunOS/i) {
push @os_list, 'SunOS';
}
# generic
if ($line =~ /UNIX/i) {
push @os_list, 'UNIX (unsp.)';
}
push @os_list, $line unless @os_list;
return @os_list;
}
# returns ARRAY
sub normalize_project {
my $line = shift;
return '' unless (defined $line && $line ne '');
# expand xxx-{a b c} to xxx-a xxx-b xxx-c
if ($line =~ s/([-0-9a-zA-Z]+)\{([^}]*)\}//i) {
foreach (split(' ', $2)) {
$line .= " $1$_";
}
}
# by hand
$line =~ s/Everything at work \(50\+ repos\) along with some small projects of my own\./work own/i;
$line =~ s/my own private projects and documents \(school reports etc\) the ones from gnome\.org through git-svn and the ones from my work through git-svn too/own gnome_(git-svn) work_(git-svn)/i;
$line =~ s/my \{own school company\} projects/own work/i;
$line =~ s/\(curl and waf in own git mirrors\)/curl waf/i;
$line =~ s/5 \(mplayer wormux vlc git xmoto - I use git-svn for some projects\)\./mplayer wormux VLC git xmoto/i;
$line =~ s/All our projects at GPLHost/GPLHost/;
$line =~ s/homework assignments hobby projects everything else/own/i;
$line =~ s!Currently http://search\.cpan\.org/dist/Language-MuldisD /Muldis-DB!Language-MuldisD Muldis-DB!i;
$line =~ s/my home directory various SVN projects \(internal and external\) various personal repositories various wikis/own unspecified_(git-svn) wikis/i;
$line =~ s/own work project OSS projects/own unspecified/i;
$line =~ s!various projects at dev\.laptop\.org/git!OLPC!i;
$line =~ s/All of Xorg as well as our own packaging repositories for it/xorg own/i;
$line =~ s/Mostly things for work or personal use -- I haven't converted the rest of the world yet/own work/i;
$line =~ s/all source I write articles presentations diploma thesis \(Latex source\)/own/i;
$line =~ s/my homework//i;
$line =~ s!\(http://vle\.univ-littoral\.fr/gitweb\)!!i;
# corrections
$line =~ s/\bocasionaly\b/occasionally/ig;
$line =~ s/\bproejcts\b/projects/ig;
$line =~ s/\bitselg\b/itself/ig;
$line =~ s/\bonly mines\b/only mine/ig;
$line =~ s/^mines$/mine/i;
$line =~ s/\ba fw\b/a few/ig;
# projects given by URL
$line =~ s/\b(?:all )?(?:the )?projects at http:\/\/(\S*)/http:__$1/i;
$line =~ s/\b(?:sf|sourceforge)\.net projects\b/sf.net/i;
$line =~ s/\b(\w+(?:\.\w+)+)\/\*/http:__$1/ig;
$line =~ s!http://(\w+(?:\.\w+)+)[/\w.]*!http:__$1!ig;
# normalize
$line =~ s/\bOLPC project[s]?\b/OLPC/ig;
# multi-word projects
$line =~ s!Source Mage GNU/Linux!Source_Mage!i;
$line =~ s!Source Mage!Source_Mage!i;
$line =~ s/\bArch Linux\b/Arch_Linux/i;
$line =~ s!Thousand Parsec!Thousand_Parsec!i;
$line =~ s!thousandparsec!Thousand_Parsec!i;
$line =~ s/\bkernel-related\b/kernel_related/i;
$line =~ s/\bLinux wireless-dev\b/wireless-dev/i;
$line =~ s/\brt2x00 (?:linux|kernel|driver[s]?)/rt2x00/ig;
$line =~ s/\bdavinci kernel\b/davinci_kernel/i;
$line =~ s/\b(?:various )?kernel module(?: repos|repositories)?\b/kernel_module/i;
$line =~ s/linux (\d\.\d) kernel/linux-$1/i;
$line =~ s/\b(?<!Linux )kernel-tree[s]?\b/Linux_kernel/ig;
$line =~ s/\bLinux[ -]kernel?\b/Linux_kernel/i;
$line =~ s/\bLinux(?! kernel|-)\b/Linux_kernel/i;
$line =~ s/\b(?<!Linux[- ])kernel(?!\.)(?:-\d.\d+)?\b/Linux_kernel/i;
$line =~ s/linux-mips\.org kernel\b/linux-mips\.org Linux_kernel/i;
$line =~ s/\bLinus' branch\b/Linux_kernel/i;
$line =~ s/embedded distribution \(Slind\)/Slind_(embedded_distribution)/i;
$line =~ s/Apache Harmony/Apache_Harmony/i;
$line =~ s/PS3 kernel/PS3_kernel/i;
$line =~ s/kernel drivers/kernel_drivers/i;
$line =~ s/X(?:11)? drivers/X_drivers/i;
$line =~ s/xserver and drivers/xserver X_drivers/i;
$line =~ s/\bxorg (\w+) driver[s]?\b/xorg_${1}_drivers/i;
$line =~ s/\bsummer of code(?: project[s]?)?\b/GSoC_projects/i;
$line =~ s/\bGNOME applications\b/GNOME_applications/i;
$line =~ s/\bApache progs\b/Apache_programs/i;
$line =~ s/\bconfig(?:uration)? files\b/configuration_files/ig;
$line =~ s/\bRuby on Rails\b/Ruby_on_Rails/ig;
$line =~ s/\ba range of Lisp projects\b/Lisp_projects/ig;
$line =~ s/An online football manager game/online_game/i;
$line =~ s/ati tv drivers/ATI_TV_drivers/i;
$line =~ s/\bSpring RTS\b/Spring_RTS/ig;
$line =~ s/\belse[- ]project[s]?/else_projects/ig;
$line =~ s/\bplone packages\b/Plone_packages/ig;
# own/work/unspecified
$line =~ s/\b(:?my )?(?:own|personal)(?: project[s]?)?\b/own/ig;
$line =~ s/\bmy project[s]?\b/own/ig;
$line =~ s/\bpersonal(?: stuff)?\b/own/ig;
$line =~ s/\bmine\b/own/ig;
$line =~ s/\bour own\b/own/ig;
$line =~ s/\banything I (?:write|wrote)\b/own/ig;
$line =~ s/\bprivate(?: project[s]?| things)?\b/private/ig;
$line =~ s/\bcan not disclose\b/private/ig;
$line =~ s/\bnon-public\b/private/ig;
$line =~ s/\bprivate code\b/private/ig;
$line =~ s/\bno(?:thing)? public\b/private/ig;
$line =~ s/\b(?:my )?(?:own )?private work\b/private/ig;
$line =~ s/\b(?:various|several) other[s]?\b/unspecified/ig;
$line =~ s/\bvarious (?:smaller )?projects\b/unspecified/ig;
$line =~ s/\bvarious (?:minor )?stuff\b/unspecified/ig;
$line =~ s/\babout \d+ projects\b/unspecified/ig;
$line =~ s/\b\d+\+? repos(?:itories)?\b/unspecified/ig;
$line =~ s/^lots$/unspecified/ig;
$line =~ s/^all$/unspecified/ig;
$line =~ s/\bfriend's projects\b/private/ig;
$line =~ s/\bmany others\b/unspecified/ig;
$line =~ s/\bproprietary(?: code)?\b/proprietary/ig;
$line =~ s/\bMany projects from internet\b/unspecified/ig;
$line =~ s/\bMany at this point\b/unspecified/ig;