Klasse DocumentSample

java.lang.Object
opennlp.tools.doccat.DocumentSample
Alle implementierten Schnittstellen:
Serializable, Sample

public class DocumentSample extends Object implements Sample
Class which holds a classified document and its category.
Siehe auch:
  • Konstruktordetails

    • DocumentSample

      public DocumentSample(String category, String[] text)
      Initializes a instance.
      Parameter:
      category - The category to be used. Must not be null.
      text - The plain text in a tokenized form. Must not be null.
    • DocumentSample

      public DocumentSample(String category, String[] text, Map<String,Object> extraInformation)
      Initializes a instance.
      Parameter:
      category - The category to be used.Must not be null.
      text - The plain text in a tokenized form. Must not be null.
      extraInformation - Additional information for context.
  • Methodendetails

    • getCategory

      public String getCategory()
      Gibt zurück:
      Retrieves the category.
    • getText

      public String[] getText()
      Gibt zurück:
      Retrieves the text in a tokenized form.
    • getExtraInformation

      public Map<String,Object> getExtraInformation()
      Gibt zurück:
      Retrieves contextual extra information.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object