Comment 9 for bug 1313920

Revision history for this message
Bill Poser (billposer) wrote :

For those who have trouble installing or building a patched version, a simple workaround is to unify duplicate entries by tacking all of the glosses together. Here's an AWK script that does the job. Run this on your tab separated file and it will transform, e.g.:

'at wife
'at over there

into

'at wife, over there

----------

BEGIN {
    FS="\t";
    PreviousHeadword="";
}
{
    if($NF < 2) next;
    Headword=$1;
    Gloss=$2;
    if(Headword == PreviousHeadword) {
 Accum = Accum ", " Gloss;
    } else {
 if(NR > 1) printf("%s\t%s\n",PreviousHeadword,Accum);
 Accum=Gloss;
    }
    PreviousHeadword=Headword;
}