Skip to content

Commit

Permalink
Parsing changes to summary text.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 22, 2016
1 parent 88460ff commit ffd5657
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions IcculusFinger_archiveplans.pl
Expand Up @@ -319,14 +319,20 @@ sub update_planfile {
$str =~ s/\s+\Z//;

$summary = $str;
$summary =~ s/\A(.{1,80})\b.*\Z/$1/;
$summary =~ s/\A(.{15,}?[.?!]).*\Z/$1/; # gross.
}

1 while ($summary =~ s/\r\n/ /s);
1 while ($summary =~ s/\r/ /s);
1 while ($summary =~ s/\n/ /s);
if (length($summary) > 80) {
$summary =~ s/\A(.{15,}?[.?!])(.*?)\Z/$1/; # gross.
}

if (length($summary) > 80) {
$summary =~ s/\A(.{1,80})\b.*\Z/$1/;
$summary =~ s/\A(.{15,}?[.?!]).*\Z/$1/; # gross.
}

#print("SUMMARY: $summary\n"); exit(0);

$summary = $link->quote($summary);

Expand Down
7 changes: 6 additions & 1 deletion IcculusFinger_daemon.pl
Expand Up @@ -1404,14 +1404,19 @@ sub do_fingering {
$str =~ s/\A(.*?)[\r\n].*\Z/$1/s;
$str =~ s/\A\s+//;
$str =~ s/\s+\Z//;

$metadata{'summary'} = $str;
$metadata{'summary'} =~ s/\A(.{1,80})\b.*\Z/$1/;
$metadata{'summary'} =~ s/\A(.{15,}?[.?!]).*\Z/$1/; # gross.
}

1 while ($metadata{'summary'} =~ s/\r\n/ /s);
1 while ($metadata{'summary'} =~ s/\r/ /s);
1 while ($metadata{'summary'} =~ s/\n/ /s);

if (length($metadata{'summary'}) > 80) {
$metadata{'summary'} =~ s/\A(.{15,}?[.?!])(.*?)\Z/$1/; # gross.
$metadata{'summary'} =~ s/\A(.{1,80})\b.*\Z/$1/;
$metadata{'summary'} =~ s/\A(.{15,}?[.?!]).*\Z/$1/; # gross.
}

if ($debug) {
Expand Down

0 comments on commit ffd5657

Please sign in to comment.