Here's a Perl script to split target-side alternatives. Note, however, that the order of the lines with target terms matches matches the order of the individual target terms in the combined variant. To re-import the lines, you'll need the reverse version (I'll work on that).
#!/usr/bin/perl while (<>){ chomp; ($lhs, $rhs) = split /\t/; foreach $s (split /;/, $rhs){ print "$lhs\t$s\n"; } }
Tadaa!
Here's the Perl script that splits the target but keeps the correct (reversed) order, so that the glossary can be merged again (Glossary > Merge alternative translations):
#!/usr/bin/perl while (<>){ chomp; ($lhs, $rhs) = split /\t/; @targets = split /;/, $rhs; @targets = reverse @targets; foreach $s (@targets){ print "$lhs\t$s\n"; } }
Now you can decompose your advanced glossaries, either from the source side or from the target side, or from both sides. After this, you can rearrange or modify the term pairs in any other way you like. And once you're satisfied, you can merge. The target side, that is. Currently there's no way to merge the source side (apart from swapping the source-side and target-side columns, of course).
alwayslockyourbike
(Created by a kind person in the KM forum.)
Split source-side alternatives in glossary:
Augen-Arzt;Augenarzt\toogarts
Will be split to:
Augen-Arzt\toogarts
Augenarzt\toogarts
The Perl script:
1. Put a copy of the glossary.txt file on your Desktop.
2. Use a plain text editor to create a file called splitterms.pl. Copy the Perl script above into it and save it to your Desktop.
3. Open Terminal and execute the following two lines:
The file newglossary.txt will appear on your Desktop in the format you want.