edu.stanford.nlp.dbm
Class Contexts
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--edu.stanford.nlp.dbm.AbstractDataCollection
|
+--edu.stanford.nlp.dbm.FileDataCollection
|
+--edu.stanford.nlp.dbm.Contexts
- All Implemented Interfaces:
- Collection, DataCollection, List
- public class Contexts
- extends FileDataCollection
Contains methods dealing with populating a DBM given a file containing one Context per line, where the word to be disambiguated is at the top of the file
Constructor Summary |
Contexts(List db,
String filename)
|
Contexts(String filename)
Creates a collection of Contexts given a filename which contains a collection of Contexts, one per line, where the first word is the content word, and the remaining words are context words. |
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
Contexts
public Contexts(String filename)
throws IOException
- Creates a collection of Contexts given a filename which contains a collection of Contexts, one per line, where the first word is the content word, and the remaining words are context words. Stores data, features, and their respective indices in memory. Uses standard Bag-of-Features Matrix, and uses Lowercaser.
Contexts
public Contexts(List db,
String filename)
throws IOException
fileIterator
public Iterator fileIterator()
- Returns an iterator over contexts in context collection
- Specified by:
fileIterator
in class FileDataCollection
Stanford NLP Group