Class DefaultNameContextGenerator

    • Constructor Detail

      • DefaultNameContextGenerator

        @Deprecated
        public DefaultNameContextGenerator()
        Deprecated.
        use the other constructor and always provide the feature generators
        Creates a name context generator.
      • DefaultNameContextGenerator

        public DefaultNameContextGenerator​(AdaptiveFeatureGenerator... featureGenerators)
        Creates a name context generator with the specified cache size.
    • Method Detail

      • updateAdaptiveData

        public void updateAdaptiveData​(String[] tokens,
                                       String[] outcomes)
        Description copied from interface: NameContextGenerator
        Informs all the feature generators for a name finder that the specified tokens have been classified with the coorisponds set of specified outcomes.
        Specified by:
        updateAdaptiveData in interface NameContextGenerator
        Parameters:
        tokens - The tokens of the sentence or other text unit which has been processed.
        outcomes - The outcomes associated with the specified tokens.
      • clearAdaptiveData

        public void clearAdaptiveData()
        Description copied from interface: NameContextGenerator
        Informs all the feature generators for a name finder that the context of the adaptive data (typically a document) is no longer valid.
        Specified by:
        clearAdaptiveData in interface NameContextGenerator
      • getContext

        public String[] getContext​(int index,
                                   String[] tokens,
                                   String[] preds,
                                   Object[] additionalContext)
        Return the context for finding names at the specified index.
        Specified by:
        getContext in interface BeamSearchContextGenerator<String>
        Parameters:
        index - The index of the token in the specified toks array for which the context should be constructed.
        tokens - The tokens of the sentence. The toString methods of these objects should return the token text.
        preds - The previous decisions made in the tagging of this sequence. Only indices less than i will be examined.
        additionalContext - Addition features which may be based on a context outside of the sentence.
        Returns:
        the context for finding names at the specified index.