Class FuzzyLexiconAnnotator

  • All Implemented Interfaces:
    Serializable

    public class FuzzyLexiconAnnotator
    extends ViterbiAnnotator

    A lexicon annotator that allows gaps to occur in multi-word expressions. For example, "old red car" and "old broke car" would match the lexicon item "old car" with a distance of one.

    Author:
    David B. Bracewell
    See Also:
    Serialized Form
    • Constructor Detail

      • FuzzyLexiconAnnotator

        public FuzzyLexiconAnnotator​(@NonNull
                                     @NonNull AnnotationType annotationType,
                                     @NonNull
                                     @NonNull AttributeType<?> attributeType,
                                     @NonNull
                                     @NonNull Lexicon lexicon,
                                     @NonNull
                                     @NonNull Language lexiconLanguage,
                                     int maxDistance)
        Instantiates a new FuzzyLexiconAnnotator.
        Parameters:
        annotationType - the annotationType of annotation to create.
        attributeType - the attribute type
        lexicon - the lexicon to perform annotation based on
        lexiconLanguage - the language of the lexicon
        maxDistance - the maximum fuzzy distance allowed.
      • FuzzyLexiconAnnotator

        public FuzzyLexiconAnnotator​(@NonNull
                                     @NonNull AnnotationType annotationType,
                                     @NonNull
                                     @NonNull AttributeType<?> attributeType,
                                     @NonNull
                                     @NonNull String lexiconName,
                                     @NonNull
                                     @NonNull Language lexiconLanguage,
                                     int maxDistance)
        Instantiates a new FuzzyLexiconAnnotator.
        Parameters:
        annotationType - the annotationType of annotation to create.
        attributeType - the attribute type
        lexiconName - the name of the lexicon to perform annotation based on
        lexiconLanguage - the language of the lexicon
        maxDistance - the maximum fuzzy distance allowed.
    • Method Detail

      • createAndAttachAnnotation

        protected void createAndAttachAnnotation​(Document document,
                                                 LexiconMatch match)
        Description copied from class: ViterbiAnnotator
        Given an possible span determines if an annotation should be created and if so creates and attaches it.
        Specified by:
        createAndAttachAnnotation in class ViterbiAnnotator
        Parameters:
        document - the document
        match - The span to check
      • getProvider

        public String getProvider​(Language language)
        Description copied from class: Annotator
        Gets the provider information for this annotator.. The provider information should relate to a version number, model used, or something else to identify the settings of the annotator.
        Overrides:
        getProvider in class Annotator
        Returns:
        the provider
      • satisfies

        public Set<AnnotatableType> satisfies()
        Description copied from class: Annotator
        The set of annotation types that this annotator satisfies by this annotator
        Specified by:
        satisfies in class Annotator
        Returns:
        the set of satisfied annotation types