Class MultiPhaseExtractor.MultiPhaseExtractorBuilder<T extends MultiPhaseExtractor,​V extends MultiPhaseExtractor.MultiPhaseExtractorBuilder<T,​V>>

    • Constructor Detail

      • MultiPhaseExtractorBuilder

        protected MultiPhaseExtractorBuilder()
    • Method Detail

      • annotations

        public V annotations​(List<AnnotationType> types)
        The annotations to base the extraction on
        Parameters:
        types - the annotation types
        Returns:
        this builder
      • annotations

        public V annotations​(AnnotationType... types)
        The annotations to base the extraction on
        Parameters:
        types - the annotation types
        Returns:
        this builder
      • build

        public abstract T build()
        Returns:
        the constructed Extractor from this builder
      • filter

        public V filter​(LyreExpression expression)
        Sets the filter to use to eliminate annotations from the extraction
        Parameters:
        expression - the Lyre expression to use as the filter.
        Returns:
        this builder
      • filter

        public V filter​(String expression)
        Sets the filter to use to eliminate annotations from the extraction
        Parameters:
        expression - the Lyre expression to use as the filter.
        Returns:
        this builder
      • fromExtractor

        public V fromExtractor​(@NonNull
                               @NonNull MultiPhaseExtractor extractor)
        Copies the values from the given extractor to this builder
        Parameters:
        extractor - the extractor to copy from
        Returns:
        this extractor
      • ignoreStopwords

        public V ignoreStopwords()
        Set the filter to ignore stopwords.
        Returns:
        this builder
      • prefix

        public V prefix​(String prefix)
        Sets the prefix to use when building features.
        Parameters:
        prefix - the feature prefix
        Returns:
        this builder
      • toLemma

        public V toLemma()
        Set the toString method to use the lemma form of the annotation.
        Returns:
        this builder
      • toLowerCase

        public V toLowerCase()
        Set the toString method to use the lowercase form of the annotation.
        Returns:
        this builder
      • toString

        public V toString​(String expression)
        Sets the method for mapping annotations to Strings.
        Parameters:
        expression - the Lyre expression to use for mapping.
        Returns:
        this builder
      • toString

        public V toString​(LyreExpression expression)
        Sets the method for mapping annotations to Strings.
        Parameters:
        expression - the Lyre expression to use for mapping.
        Returns:
        this builder
      • trim

        public V trim​(String expression)
        Sets the method for trimming annotations.
        Parameters:
        expression - the Lyre expression to use for trimming.
        Returns:
        this builder
      • trim

        public V trim​(LyreExpression expression)
        Sets the method for trimming annotations.
        Parameters:
        expression - the Lyre expression to use for trimming.
        Returns:
        this builder
      • valueCalculator

        public V valueCalculator​(ValueCalculator valueCalculator)
        Sets the method for calculating the final values in counter-based extraction
        Parameters:
        valueCalculator - the value calculator
        Returns:
        this builder