Klasse DefaultPOSContextGenerator

java.lang.Object
opennlp.tools.postag.DefaultPOSContextGenerator
Alle implementierten Schnittstellen:
POSContextGenerator, BeamSearchContextGenerator<String>

public class DefaultPOSContextGenerator extends Object implements POSContextGenerator
A default context generator for a POSTagger.
Siehe auch:
  • Konstruktordetails

    • DefaultPOSContextGenerator

      public DefaultPOSContextGenerator(Dictionary dict)
      Initializes a DefaultPOSContextGenerator instance. A cache size of 0 will be used as default.
      Parameter:
      dict - The Dictionary to be used.
    • DefaultPOSContextGenerator

      public DefaultPOSContextGenerator(int cacheSize, Dictionary dict)
      Initializes a DefaultPOSContextGenerator instance.
      Parameter:
      cacheSize - The size of the Cache to set. Must be greater than 0 to have an effect.
      dict - The Dictionary to be used.
  • Methodendetails

    • getContext

      public String[] getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext)
      Returns the context for making a postag decision at the specified token index given the specified tokens and previous tags.
      Angegeben von:
      getContext in Schnittstelle BeamSearchContextGenerator<String>
      Angegeben von:
      getContext in Schnittstelle POSContextGenerator
      Parameter:
      index - The index of the token for which the context is provided.
      sequence - The token sequence representing a sentence.
      priorDecisions - The tags assigned to the previous words in the sentence.
      additionalContext - The context for additional information.
      Gibt zurück:
      The context for making a postag decision at the specified token index given the specified tokens and previous tags.
    • getContext

      public String[] getContext(int index, Object[] tokens, String[] tags)
      Returns the context for making a postag decision at the specified token index given the specified tokens and previous tags.
      Parameter:
      index - The index of the token for which the context is provided.
      tokens - The tokens representing a sentence.
      tags - The tags assigned to the previous words in the sentence.
      Gibt zurück:
      The context for making a postag decision at the specified token index given the specified tokens and previous tags.