All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.danieldk.nlp.conllx.Token Maven / Gradle / Ivy

The newest version!
// Copyright 2014 Daniel de Kok
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package eu.danieldk.nlp.conllx;

import com.google.common.base.Optional;

/**
 * A token, with its morphosyntactical information and dependency
 * relations.
 *
 * @author Daniël de Kok 
 */
public interface Token {
    /**
     * Get the position/ID of the token within the sentence, starting at 1.
     */
    int getID();

    /**
     * Get the form (actual token).
     */
    Optional getForm();

    /**
     * Get the lemma.
     */
    Optional getLemma();

    /**
     * Get the coarse-grained part of speech tag.
     */
    Optional getCoarsePOSTag();

    /**
     * Get the (fine-grained) part of speech tag.
     */
    Optional getPosTag();

    /**
     * Get the features.
     */
    Optional getFeatures();

    /**
     * Get the head of the token. This is either the position or 0
     * (for instance, when the token is the root).
     */
    Optional getHead();

    /**
     * Get the dependency relation to the head.
     */
    Optional getDepRel();

    /**
     * Get the projective head of the token. This is either the position or 0
     * (for instance, when the token is the root). If tokens in a sentence have a
     * projective head, then using all projective heads should result in a projective
     * structure.
     */
    Optional getPHead();

    /**
     * Get the dependency relation to the projective head.
     */
    Optional getPDepRel();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy