| 1 | package Alvis::NLPPlatform::XMLEntities; | ||
| 2 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | our $VERSION=$Alvis::NLPPlatform::VERSION; | |
| 7 | |||
| 8 | sub encode | ||
| 9 | 0 | ▶ | { |
|
Subroutine
encode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 10 | 0 | $_[0]=~s/&/&/g; | |
| 11 | 0 | $_[0]=~s/\"/"/g; | |
| 12 | 0 | $_[0]=~s/\'/'/g; | |
| 13 | 0 | $_[0]=~s/</</g; | |
| 14 | 0 | $_[0]=~s/>/>/g; | |
| 15 | } | ||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | sub decode | ||
| 21 | 0 | ▶ | { |
|
Subroutine
decode: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 22 | 0 | my $shift_offset = 0; | |
| 23 | |||
| 24 | 0 | $shift_offset += ($_[0]=~s/"/\"/g) * 5; | |
| 25 | 0 | $shift_offset += ($_[0]=~s/'/\'/g) * 5; | |
| 26 | 0 | $shift_offset += ($_[0]=~s/&/&/g) * 4; | |
| 27 | 0 | $shift_offset += ($_[0]=~s/</</g) * 3; | |
| 28 | 0 | $shift_offset += ($_[0]=~s/>/>/g) * 3; | |
| 29 | 0 | return($shift_offset); | |
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | 4 | 1; | |
| 34 | |||
| 35 | __END__ | ||