Class NameSample

  • All Implemented Interfaces:
    java.io.Serializable

    public class NameSample
    extends java.lang.Object
    implements java.io.Serializable
    Class for holding names for a single unit of text.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_TYPE
      The a default type value when there is no type in training data.
    • Constructor Summary

      Constructors 
      Constructor Description
      NameSample​(java.lang.String[] sentence, Span[] names, boolean clearAdaptiveData)  
      NameSample​(java.lang.String[] sentence, Span[] names, java.lang.String[][] additionalContext, boolean clearAdaptiveData)
      Initializes the current instance.
      NameSample​(java.lang.String id, java.lang.String[] sentence, Span[] names, java.lang.String[][] additionalContext, boolean clearAdaptiveData)  
    • Field Detail

      • DEFAULT_TYPE

        public static final java.lang.String DEFAULT_TYPE
        The a default type value when there is no type in training data.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NameSample

        public NameSample​(java.lang.String id,
                          java.lang.String[] sentence,
                          Span[] names,
                          java.lang.String[][] additionalContext,
                          boolean clearAdaptiveData)
      • NameSample

        public NameSample​(java.lang.String[] sentence,
                          Span[] names,
                          java.lang.String[][] additionalContext,
                          boolean clearAdaptiveData)
        Initializes the current instance.
        Parameters:
        sentence - training sentence
        names -
        additionalContext -
        clearAdaptiveData - if true the adaptive data of the feature generators is cleared
      • NameSample

        public NameSample​(java.lang.String[] sentence,
                          Span[] names,
                          boolean clearAdaptiveData)
    • Method Detail

      • getId

        public java.lang.String getId()
      • getSentence

        public java.lang.String[] getSentence()
      • getNames

        public Span[] getNames()
      • getAdditionalContext

        public java.lang.String[][] getAdditionalContext()
      • isClearAdaptiveDataSet

        public boolean isClearAdaptiveDataSet()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parse

        public static NameSample parse​(java.lang.String taggedTokens,
                                       boolean isClearAdaptiveData)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • parse

        public static NameSample parse​(java.lang.String taggedTokens,
                                       java.lang.String defaultType,
                                       boolean isClearAdaptiveData)
                                throws java.io.IOException
        Throws:
        java.io.IOException