-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrigrams_to_bar_diagram
executable file
·57 lines (46 loc) · 1.3 KB
/
trigrams_to_bar_diagram
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
#!/usr/bin/perl
# -w
# use strict;
# open(my $pipe,"ls trigrams/*.text | sort -k 1.10 -n |");
open(my $pipe,"ls bigrams/*.extract | sort -k 1.9 -n |");
# print ".nr PL 59.4c\n";
# print ".nr LL 38.0c\n";
# print ".nr PL 29.4c\n";
# print ".nr LL 16.0c\n";
# print ".nr HM 2c\n";
# print ".nr FM 2c\n";
# print ".nr PO 1c\n";
my $prev_lab = 'Week0';
my $counter = 0;
while(my $file_name = <$pipe>) {
chomp $file_name;
my $week = $file_name;
$week =~ s/^.*\///;
$week =~ s/.extract//;
next if $week < 385;
last if $week >= 435;
my $cur_lab = "Week$week";
if($counter == 0) {
print ".PS\n";
print "scale=2.54\n";
print ".po 1.0c\n";
print ".ps 5\n";
print ".vs 10\n";
print 'Y: arrow up 23' . "\n";
print 'box invis "Bigrammes" rjust with .sw at Y.n' . "\n";
print 'X: arrow right 16 from Y.s' . "\n";
print 'box invis "Weeks" with .ne at X.e' . "\n";
print 'Week0:box invis " " with .n at X.sw'."\n";
$prev_lab = "Week0";
}
$counter++;
chomp $file_name;
print $cur_lab . ':box invis "'.$week.'" wid 1.8 with .sw at ' . $prev_lab . ".se\n";
print "\tcopy \"" . $file_name . '" thru { box invis "$1 $2 $3" ht 0.45 with .s at last box .n}' ."\n";
$prev_lab = $cur_lab;
if($counter == 8) {
print ".PE\n";
$counter=0;
}
}
print ".PE\n";