edu.stanford.nlp.dbm
Class Context
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.ArrayList
|
+--edu.stanford.nlp.dbm.BasicDocument
|
+--edu.stanford.nlp.dbm.Context
- All Implemented Interfaces:
- Cloneable, Collection, Datum, Document, Featurizable, Labeled, List, RandomAccess, Serializable
- public class Context
- extends BasicDocument
One line, with word as the first element, and it's context following it on the same line.
- See Also:
- Serialized Form
Constructor Summary |
Context(String context)
Constructs a Context given only the context of a word (for testing contexts) |
Context(String context,
String label)
Constructs a Context given the context of a word and its label (for training contexts) |
Method Summary |
Label |
label()
Returns the first label for this Document, or null if none have been
set. |
Collection |
labels()
Returns the complete List of labels for this Document. |
String |
text()
Returns text of document |
String |
title()
returns first word on line |
Methods inherited from class edu.stanford.nlp.dbm.BasicDocument |
addLabel, asFeatures, init, init, init, init, init, init, init, init, init, init, init, init, init, init, init, init, init, init, init, main, originalText, parse, presentableText, setLabel, setLabels, setTitle |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Context
public Context(String context,
String label)
- Constructs a Context given the context of a word and its label (for training contexts)
Context
public Context(String context)
- Constructs a Context given only the context of a word (for testing contexts)
title
public String title()
- returns first word on line
- Specified by:
title
in interface Document
- Overrides:
title
in class BasicDocument
text
public String text()
- Returns text of document
label
public Label label()
- Description copied from class:
BasicDocument
- Returns the first label for this Document, or null if none have been
set.
- Specified by:
label
in interface Labeled
- Overrides:
label
in class BasicDocument
- Returns:
- One of the labels of the object (if there are multiple labels,
preferably the primary label, if it exists).
Returns null if there is no label.
labels
public Collection labels()
- Description copied from class:
BasicDocument
- Returns the complete List of labels for this Document.
This is an empty collection if none have been set.
- Specified by:
labels
in interface Labeled
- Overrides:
labels
in class BasicDocument
- Returns:
- A Collection of the Object's labels. Returns an empty
Collection if there are no labels.
Stanford NLP Group