# ABSTRACT: Driver for the German tagset of the CoNLL 2009 Shared Task.
# Unlike CoNLL 2006, this year's tagset contains also morphological features.
# Copyright © 2009, 2014 Dan Zeman <zeman@ufal.mff.cuni.cz>

package Lingua::Interset::Tagset::DE::Conll2009;
use strict;
use warnings;
our $VERSION = '2.040';

use utf8;
use open ':utf8';
use namespace::autoclean;
use Moose;
extends 'Lingua::Interset::Tagset::DE::Stts';



has 'atoms' => ( isa => 'HashRef', is => 'ro', builder => '_create_atoms', lazy => 1 );



#------------------------------------------------------------------------------
# Returns the tagset id that should be set as the value of the 'tagset' feature
# during decoding. Every derived class must (re)define this method! The result
# should correspond to the last two parts in package name, lowercased.
# Specifically, it should be the ISO 639-2 language code, followed by '::' and
# a language-specific tagset id. Example: 'cs::multext'.
#------------------------------------------------------------------------------
sub get_tagset_id
{
    return 'de::conll2009';
}



#------------------------------------------------------------------------------
# Creates atomic drivers for surface features.
#------------------------------------------------------------------------------
sub _create_atoms
{
    my $self = shift;
    my %atoms;
    # GENUS / GENDER ####################
    $atoms{gender} = $self->create_simple_atom
    (
        'intfeature' => 'gender',
        'simple_decode_map' =>
        {
            'Masc' => 'masc',
            'Fem'  => 'fem',
            'Neut' => 'neut'
        },
        'encode_default' => '*'
    );
    # NUMERUS / NUMBER ####################
    $atoms{number} = $self->create_simple_atom
    (
        'intfeature' => 'number',
        'simple_decode_map' =>
        {
            'Sg' => 'sing',
            'Pl' => 'plur'
        },
        'encode_default' => '*'
    );
    # KASUS / CASE ####################
    $atoms{case} = $self->create_simple_atom
    (
        'intfeature' => 'case',
        'simple_decode_map' =>
        {
            'Nom' => 'nom',
            'Gen' => 'gen',
            'Dat' => 'dat',
            'Acc' => 'acc'
        },
        'encode_default' => '*'
    );
    # GRAD / DEGREE ####################
    $atoms{degree} = $self->create_simple_atom
    (
        'intfeature' => 'degree',
        'simple_decode_map' =>
        {
            'Pos'  => 'pos',
            'Comp' => 'comp',
            'Sup'  => 'sup'
        },
        'encode_default' => '*'
    );
    # PERSON ####################
    $atoms{person} = $self->create_simple_atom
    (
        'intfeature' => 'person',
        'simple_decode_map' =>
        {
            '1' => '1',
            '2' => '2',
            '3' => '3'
        },
        'encode_default' => '*'
    );
    # TENSE ####################
    $atoms{tense} = $self->create_simple_atom
    (
        'intfeature' => 'tense',
        'simple_decode_map' =>
        {
            'Past' => 'past',
            'Pres' => 'pres'
        },
        'encode_default' => '*'
    );
    # TENSE OF PARTICIPLE ####################
    $atoms{partense} = $self->create_atom
    (
        'surfeature' => 'tense',
        'decode_map' =>
        {
            # past participle ("aufgeschreckt", "überzeugt", "getan", ...)
            'Psp' => ['verbform' => 'part', 'tense' => 'past', 'aspect' => 'perf'],
            # present participle ("eingehend", "sprühend")
            'Prp' => ['verbform' => 'part', 'tense' => 'pres', 'aspect' => 'imp']
        },
        'encode_map' =>
        {
            'tense' => { 'past' => 'Psp',
                         'pres' => 'Prp',
                         '@'    => '*' }
        }
    );
    # VERB FORM ####################
    $atoms{verbform} = $self->create_atom
    (
        'tagset' => 'de::conll2009',
        'surfeature' => 'verbform',
        'decode_map' =>
        {
            # Inf (infinitive) always comes with VVINF, so it already is set.
            # Infzu always comes with VVIZU, so it already is set.
            # infinitive: "abkommen"
            'Inf'   => ['verbform' => 'inf'],
            # infinitive with the incorporated "zu" marker: "abzukommen"
            'Infzu' => ['verbform' => 'inf', 'other' => {'verbform' => 'infzu'}]
        },
        'encode_map' =>

            { 'verbform' => { 'inf' => { 'other/verbform' => { 'infzu' => 'Infzu',
                                                               '@'     => 'Inf' }}}}
    );
    # MODUS / MOOD ####################
    $atoms{mood} = $self->create_atom
    (
        'surfeature' => 'mood',
        'decode_map' =>
        {
            # Ind (indicative) may also come with VVIMP (as in "schauen Sie mal") but it should not replace the imperative set from POS!
            # Imp (imperative) always comes with VVIMP.
            #'Ind'  => ['verbform' => 'fin', 'mood' => 'ind'],
            'Subj' => ['verbform' => 'fin', 'mood' => 'sub']
        },
        'encode_map' =>
        {
            'mood' => { 'ind' => 'Ind',
                        'sub' => 'Subj' }
        }
    );
    # MERGED ATOM TO DECODE ANY FEATURE VALUE ####################
    my @fatoms = map {$atoms{$_}} (qw(gender number case degree person tense partense verbform mood));
    $atoms{feature} = $self->create_merged_atom
    (
        'surfeature' => 'feature',
        'tagset'     => 'de::conll2009',
        'atoms'      => \@fatoms
    );
    return \%atoms;
}



#------------------------------------------------------------------------------
# Decodes a physical tag (string) and returns the corresponding feature
# structure.
#------------------------------------------------------------------------------
sub decode
{
    my $self = shift;
    my $tag = shift;
    # two components: part-of-speech tag, features
    # example: NN\tNom|Sg|Masc
    my ($pos, $features) = split(/\s+/, $tag);
    # The CoNLL tagset is derived from the STTS tagset.
    # Part of speech is the STTS tag.
    if($pos eq 'PROAV')
    {
        $pos = 'PAV';
    }
    my $fs = $self->SUPER::decode($pos);
    # Unlike in DE::Conll, we do set our own tagset identifier because we have the features and thus the difference between us and the base DE::Stts is substantial.
    $fs->set_tagset('de::conll2009');
    my @features = split(/\|/, $features);
    my $atoms = $self->atoms();
    foreach my $feature (@features)
    {
        $atoms->{feature}->decode_and_merge_hard($feature, $fs);
    }
    # Estimate part of speech of TRUNCated words.
    # de::stts cannot do that without the morphological features.
    ###!!! It breaks encode(decode(x))!
    if(0 && $pos eq 'TRUNC' && $fs->pos() eq '')
    {
        if($fs->degree())
        {
            $fs->set_pos('adj');
        }
        elsif($fs->verbform() eq 'part')
        {
            $fs->set_pos('verb');
        }
        elsif($fs->verbform() eq 'inf')
        {
            $fs->set_pos('verb');
        }
        elsif($fs->person() =~ m/^[123]$/)
        {
            $fs->set_pos('verb');
        }
        else
        {
            $fs->set_pos('noun');
        }
    }
    return $fs;
}



#------------------------------------------------------------------------------
# Takes feature structure and returns the corresponding physical tag (string).
#------------------------------------------------------------------------------
sub encode
{
    my $self = shift;
    my $fs = shift; # Lingua::Interset::FeatureStructure
    # The CoNLL tagset is derived from the STTS tagset.
    # Part of speech is the STTS tag.
    my $old_tagset = $fs->tagset();
    $fs->set_tagset('de::stts') if($old_tagset eq 'de::conll2009');
    my $tag = $self->SUPER::encode($fs);
    $fs->set_tagset($old_tagset);
    if($tag eq 'PAV')
    {
        $tag = 'PROAV';
    }
    # Encode the features.
    my @feature_names = ();
    my $keytag = $tag;
    if($tag =~ m/^((APPR)?ART|FM|N[NE]|P(D|I|POS|REL|W)(AT|S)|XY)$/)
    {
        @feature_names = ('case', 'number', 'gender');
    }
    else
    {
        my %feature_names =
        (
            'NN'   => ['case', 'number', 'gender'],
            'ADJA' => ['degree', 'case', 'number', 'gender'],
            'ADJD' => ['degree'],
            'ADV'  => ['degree'],
            'APPO' => ['case'],
            'PPER' => ['person', 'case', 'number', 'gender'],
            'PRF'  => ['person', 'case', 'number'],
            'VINF' => ['verbform'],
            'VIZU' => ['verbform'],
            'VFIN' => ['person', 'number', 'tense', 'mood'],
            # The imperative of the 1st and 3rd persons (plural) are expressed using the word order (verb precedes pronoun).
            # The finite verb is tagged VVIMP, however its morphological features speak about indicative.
            'VIMP' => ['person', 'number'], ###!!! person [13] => Pres|Ind; otherwise, just Imp
            'VPP'  => ['partense'],
        );
        if($tag =~ m/^V([VMA])(FIN|IMP|IZU|INF|PP)$/)
        {
            my $verbtype = $1;
            my $verbform = $2;
            $keytag = 'V'.$verbform;
        }
        elsif($tag eq 'TRUNC')
        {
            if($fs->is_infinitive())
            {
                $keytag = 'VINF';
            }
            elsif($fs->is_participle())
            {
                $keytag = 'VPP';
            }
            elsif($fs->is_verb())
            {
                $keytag = 'VIND';
            }
            elsif($fs->degree())
            {
                $keytag = 'ADJA';
            }
            else
            {
                $keytag = 'NN';
            }
        }
        if(defined($feature_names{$keytag}))
        {
            @feature_names = @{$feature_names{$keytag}};
        }
    }
    my @features;
    my $atoms = $self->atoms();
    foreach my $name (@feature_names)
    {
        push(@features, $atoms->{$name}->encode($fs));
    }
    if($keytag eq 'VIMP')
    {
        # The imperative of the 1st and 3rd persons (plural) are expressed using the word order (verb precedes pronoun).
        # The finite verb is tagged VVIMP, however its morphological features speak about indicative.
        if($fs->person() ne '2')
        {
            push(@features, 'Pres', 'Ind');
        }
        else
        {
            push(@features, 'Imp');
        }
    }
    my $features = @features ? join('|', @features) : '_';
    if($tag eq 'TRUNC' && $features =~ m/^\*\|(Sg|Pl)\|\*$/)
    {
        $features = "3|$1|Pres|Ind";
    }
    # *|*|* should be changed to _
    $features = '_' if($features =~ m/^\*(\|\*)*$/);
    return "$tag\t$features";
}



#------------------------------------------------------------------------------
# Returns reference to list of known tags.
# The tag occurrences in the CoNLL 2009 corpus have been collected.
# 835 tags have been observed.
#------------------------------------------------------------------------------
sub list
{
    my $self = shift;
    my $list = <<end_of_list
\$(	_
\$,	_
\$.	_
ADJA	_
ADJA	*|Acc|Sg|Masc
ADJA	Comp|*|*|*
ADJA	Comp|Acc|Pl|*
ADJA	Comp|Acc|Pl|Fem
ADJA	Comp|Acc|Pl|Masc
ADJA	Comp|Acc|Pl|Neut
ADJA    Comp|Acc|Sg|*
ADJA	Comp|Acc|Sg|Fem
ADJA	Comp|Acc|Sg|Masc
ADJA	Comp|Acc|Sg|Neut
ADJA	Comp|Dat|Pl|*
ADJA	Comp|Dat|Pl|Fem
ADJA	Comp|Dat|Pl|Masc
ADJA	Comp|Dat|Pl|Neut
ADJA	Comp|Dat|Sg|*
ADJA	Comp|Dat|Sg|Fem
ADJA	Comp|Dat|Sg|Masc
ADJA	Comp|Dat|Sg|Neut
ADJA	Comp|Gen|Pl|*
ADJA	Comp|Gen|Pl|Fem
ADJA	Comp|Gen|Pl|Masc
ADJA	Comp|Gen|Pl|Neut
ADJA    Comp|Gen|Sg|*
ADJA	Comp|Gen|Sg|Fem
ADJA	Comp|Gen|Sg|Masc
ADJA	Comp|Gen|Sg|Neut
ADJA	Comp|Nom|Pl|*
ADJA	Comp|Nom|Pl|Fem
ADJA	Comp|Nom|Pl|Masc
ADJA	Comp|Nom|Pl|Neut
ADJA    Comp|Nom|Sg|*
ADJA	Comp|Nom|Sg|Fem
ADJA	Comp|Nom|Sg|Masc
ADJA	Com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|Sg|Pres|Subj
VMINF	Inf
VMPP	Psp
VVFIN	1|Pl|Past|Ind
VVFIN	1|Pl|Past|Subj
VVFIN	1|Pl|Pres|Ind
VVFIN   1|Pl|Pres|Subj
VVFIN	1|Sg|Past|Ind
VVFIN	1|Sg|Past|Subj
VVFIN	1|Sg|Pres|Ind
VVFIN	1|Sg|Pres|Subj
VVFIN	2|Pl|Past|Ind
VVFIN   2|Pl|Past|Subj
VVFIN	2|Pl|Pres|Ind
VVFIN   2|Pl|Pres|Subj
VVFIN	2|Sg|Past|Ind
VVFIN	2|Sg|Past|Subj
VVFIN	2|Sg|Pres|Ind
VVFIN   2|Sg|Pres|Subj
VVFIN	3|Pl|Past|Ind
VVFIN	3|Pl|Past|Subj
VVFIN	3|Pl|Pres|Ind
VVFIN	3|Pl|Pres|Subj
VVFIN	3|Sg|Past|Ind
VVFIN	3|Sg|Past|Subj
VVFIN	3|Sg|Pres|Ind
VVFIN	3|Sg|Pres|Subj
VVIMP	1|Pl|Pres|Ind
VVIMP	2|Pl|Imp
VVIMP	2|Sg|Imp
VVIMP	3|Pl|Pres|Ind
VVINF	Inf
VVIZU	Infzu
VVPP	Prp
VVPP	Psp
XY	_
XY	Nom|Sg|*
XY	Nom|Sg|Fem
XY	Nom|Sg|Masc
end_of_list
    ;
    # Protect from editors that replace tabs by spaces.
    $list =~ s/[ \t]+/\t/g;
    my @list = split(/\r?\n/, $list);
    return \@list;
}



1;

__END__

=pod

=encoding UTF-8

=head1 NAME

Lingua::Interset::Tagset::DE::Conll2009 - Driver for the German tagset of the CoNLL 2009 Shared Task.

=head1 VERSION

version 2.040

=head1 SYNOPSIS

  use Lingua::Interset::Tagset::DE::Conll2009;
  my $driver = Lingua::Interset::Tagset::DE::Conll2009->new();
  my $fs = $driver->decode("NN\tNom|Sg|Masc");

or

  use Lingua::Interset qw(decode);
  my $fs = decode('de::conll2009', "NN\tNom|Sg|Masc");

=head1 DESCRIPTION

Interset driver for the German tagset of the CoNLL 2009 Shared Task.
Unlike in 2006, the CoNLL 2009 tagset also includes morphological features.
CoNLL 2009 tagsets in Interset are traditionally two values separated by tab.
The values come from the CoNLL columns POS and FEAT. For German,
these values are trivially derived from the Stuttgart-Tübingen Tagset.
Thus this driver is only a translation layer above the C<de::stts> driver.

=head1 SEE ALSO

L<Lingua::Interset>,
L<Lingua::Interset::Tagset>,
L<Lingua::Interset::Tagset::DE::Stts>,
L<Lingua::Interset::Tagset::DE::Conll>,
L<Lingua::Interset::FeatureStructure>

=head1 AUTHOR

Dan Zeman <zeman@ufal.mff.cuni.cz>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Univerzita Karlova v Praze (Charles University in Prague).

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
