in reply to Re^2: Copy html tag and replace umlauts with alternate spellings
in thread Copy html tag and replace umlauts with alternate spellings
Now, if you really are so severely unfamiliar with Perl that you don't see the easy solution, you really should consider looking things up... find a copy of "Learning Perl", look through online tutorials (here at perlmonks and elsewhere), etc.
The easy solution involves adding one line to the "if(...)" block in the "fix_umlaut" subroutine:
If the tag does not contain an "infl" attribute, the added line does nothing; if the "infl" is present, it will be deleted (along with its full value) before appending the tag to the output.if ( $tagname eq 'idx:orth' and $$attr{value} =~ /[$um]/ ) { $text =~ s/\s+infl="[^"]+"//; #<-- add this line $text =~ s/([$um])/$replace{$1}/g; $output .= $text; # repeat the tag with modified umlauts }
If you run into more problems, try working them out yourself first -- then if you still need help, show us what you tried. (And sign up for a user account.)
|
|---|