#!/usr/bin/perl -w # # Parse text from BrowserUk's home node. use strict; use warnings; { my ( %directionAbbreviation3, %directionAbbreviation2, %directionAbbreviation1 ); for my $dir1 (qw/north south east west/) { DIR2: for my $dir2 (qw/north south east west/) { next DIR2 if ( $dir1 eq $dir2 ); next DIR2 if ( $dir1 eq 'north' && $dir2 eq 'south' ); next DIR2 if ( $dir2 eq 'north' && $dir1 eq 'south' ); next DIR2 if ( $dir1 eq 'west' && $dir2 eq 'east' ); next DIR2 if ( $dir2 eq 'west' && $dir1 eq 'east' ); my $dir = "$dir1-$dir2-$dir1"; my $abbreviation = uc( substr( $dir1, 0, 1 ) . substr( $dir2, 0, 1 ) . substr( $dir1, 0, 1 ) ); $directionAbbreviation3{$dir} = $abbreviation; $directionAbbreviation3{ $dir . "erly" } = $abbreviation . "erly"; $dir = "$dir1-$dir2"; $abbreviation = uc( substr( $dir1, 0, 1 ) . substr( $dir2, 0, 1 ) ); $directionAbbreviation2{$dir} = $abbreviation; $directionAbbreviation2{ $dir . "erly" } = $abbreviation . "erly"; } $directionAbbreviation1{"$dir1"} = uc( substr( $dir1, 0, 1 ) ); $directionAbbreviation1{"${dir1}erly"} = uc( substr( $dir1, 0, 1 ) ) . "erly"; } while () { # Do double line breaks before 'from a point' and 'to a point'; s/((from|to) a point)/\n\n$1/g; # single line breaks after 'and', 'proceeding' and 'on the'; s/(and)\s/$1\n/g; s/(proceeding)/\n$1/g; s/(on the)\s/$1\n/g; # double line break before the 'be, since that separates the first # clause from the second; s/\s(be\s)/\n\n$1/g; # do some basic abbreviations; s/Unit (\d) Foundry Industrial Estate, Victoria Street/Unit $1/g; s/ metres?/m/g; # Shorten the compass directions that were set up previously; foreach my $direction ( keys %directionAbbreviation3 ) { s/$direction\s/$directionAbbreviation3{$direction}." "/ge; } foreach my $direction ( keys %directionAbbreviation2 ) { s/$direction\s/$directionAbbreviation2{$direction}." "/ge; } foreach my $direction ( keys %directionAbbreviation1 ) { s/$direction\s/$directionAbbreviation1{$direction}." "/ge; } # Replace the shortened compass directions 'N W' with 'NW', and # eliminate any leading spaces on lines that aren't empty (thus # preserving blank lines). s/([NEWS])\s([NEWS])/$1$2/g; s/^\s+(\w)/$1/g; print; } } __DATA__ A path from a point approximately 330 metres east of the most south-westerly corner of 17 Batherton Close, Widnes and approximately 208 metres east-south-east of the most southerly corner of Unit 3 Foundry Industrial Estate, Victoria Street, Widnes, proceeding in a generally east-north-easterly direction for approximately 28 metres to a point approximately 202 metres east-south-east of the most south-easterly corner of Unit 4 Foundry Industrial Estate, Victoria Street, and approximately 347 metres east of the most south-easterly corner of 17 Batherton Close, then proceeding in a generally northerly direction for approximately 21 metres to a point approximately 210 metres east of the most south-easterly corner of Unit 5 Foundry Industrial Estate, Victoria Street, and approximately 202 metres east-south-east of the most north-easterly corner of Unit 4 Foundry Industrial Estate, Victoria Street, then proceeding in a generally east-north-east direction for approximately 64 metres to a point approximately 282 metres east-south-east of the most easterly corner of Unit 2 Foundry Industrial Estate, Victoria Street, Widnes and approximately 259 metres east of the most southerly corner of Unit 4 Foundry Industrial Estate, Victoria Street, then proceeding in a generally east-north-east direction for approximately 350 metres to a point approximately 3 metres west-north-west of the most north westerly corner of the boundary fence of the scrap metal yard on the south side of Cornubia Road, Widnes, and approximately 47 metres west-south-west of the stub end of Cornubia Road be diverted to a 3 metre wide path from a point approximately 183 metres east-south-east of the most easterly corner of Unit 5 Foundry Industrial Estate, Victoria Street and approximately 272 metres east of the most north-easterly corner of 26 Ann Street West, Widnes, then proceeding in a generally north easterly direction for approximately 58 metres to a point approximately 216 metres east-south-east of the most easterly corner of Unit 4 Foundry Industrial Estate, Victoria Street and approximately 221 metres east of the most southerly corner of Unit 5 Foundry Industrial Estate, Victoria Street, then proceeding in a generally easterly direction for approximately 45 metres to a point approximately 265 metres east-south-east of the most north-easterly corner of Unit 3 Foundry Industrial Estate, Victoria Street and approximately 265 metres east of the most southerly corner of Unit 5 Foundry Industrial Estate, Victoria Street, then proceeding in a generally east-south-east direction for approximately 102 metres to a point approximately 366 metres east-south-east of the most easterly corner of Unit 3 Foundry Industrial Estate, Victoria Street and approximately 463 metres east of the most north easterly corner of 22 Ann Street West, Widnes, then proceeding in a generally north-north-easterly direction for approximately 19 metres to a point approximately 368 metres east-south-east of the most easterly corner of Unit 3 Foundry Industrial Estate, Victoria Street and approximately 512 metres east of the most south easterly corner of 17 Batherton Close, Widnes then proceeding in a generally east-south, easterly direction for approximately 16 metres to a point approximately 420 metres east-south-east of the most southerly corner of Unit 2 Foundry Industrial Estate, Victoria Street and approximately 533 metres east of the most south-easterly corner of 17 Batherton Close, then proceeding in a generally east-north-easterly direction for approximately 240 metres to a point approximately 606 metres east of the most northerly corner of Unit 4 Foundry Industrial Estate, Victoria Street and approximately 23 metres south of the most south westerly corner of the boundary fencing of the scrap metal yard on the south side of Cornubia Road, Widnes, then proceeding in a generally northern direction for approximately 44 metres to a point approximately 3 metres west-north-west of the most north westerly corner of the boundary fence of the scrap metal yard on the south side of Cornubia Road and approximately 47 metres west-south-west of the stub end of Cornubia Road. #### A path from a point approximately 330m E of the most SWerly corner of 17 Batherton Close, Widnes and approximately 208m ESE of the most Serly corner of Unit 3, Widnes, proceeding in a generally ENEerly direction for approximately 28m to a point approximately 202m ESE of the most SEerly corner of Unit 4, and approximately 347m E of the most SEerly corner of 17 Batherton Close, then proceeding in a generally Nerly direction for approximately 21m to a point approximately 210m E of the most SEerly corner of Unit 5, and approximately 202m ESE of the most NEerly corner of Unit 4, then proceeding in a generally ENE direction for approximately 64m to a point approximately 282m ESE of the most Eerly corner of Unit 2, Widnes and approximately 259m E of the most Serly corner of Unit 4, then proceeding in a generally ENE direction for approximately 350m to a point approximately 3m WNW of the most NWerly corner of the boundary fence of the scrap metal yard on the S side of Cornubia Road, Widnes, and approximately 47m WSW of the stub end of Cornubia Road be diverted to a 3m wide path from a point approximately 183m ESE of the most Eerly corner of Unit 5 and approximately 272m E of the most NEerly corner of 26 Ann Street West, Widnes, then proceeding in a generally NEerly direction for approximately 58m to a point approximately 216m ESE of the most Eerly corner of Unit 4 and approximately 221m E of the most Serly corner of Unit 5, then proceeding in a generally Eerly direction for approximately 45m to a point approximately 265m ESE of the most NEerly corner of Unit 3 and approximately 265m E of the most Serly corner of Unit 5, then proceeding in a generally ESE direction for approximately 102m to a point approximately 366m ESE of the most Eerly corner of Unit 3 and approximately 463m E of the most NEerly corner of 22 Ann Street West, Widnes, then proceeding in a generally north-NEerly direction for approximately 19m to a point approximately 368m ESE of the most Eerly corner of Unit 3 and approximately 512m E of the most SEerly corner of 17 Batherton Close, Widnes then proceeding in a generally east-south, Eerly direction for approximately 16m to a point approximately 420m ESE of the most Serly corner of Unit 2 and approximately 533m E of the most SEerly corner of 17 Batherton Close, then proceeding in a generally ENEerly direction for approximately 240m to a point approximately 606m E of the most Nerly corner of Unit 4 and approximately 23m S of the most SWerly corner of the boundary fencing of the scrap metal yard on the S side of Cornubia Road, Widnes, then proceeding in a generally northern direction for approximately 44m to a point approximately 3m WNW of the most NWerly corner of the boundary fence of the scrap metal yard on the S side of Cornubia Road and approximately 47m WSW of the stub end of Cornubia Road.