edu.stanford.nlp.sequences
Class TrueCasingForNISTDocumentReaderAndWriter
java.lang.Object
edu.stanford.nlp.sequences.TrueCasingForNISTDocumentReaderAndWriter
- All Implemented Interfaces:
- IteratorFromReaderFactory<java.util.List<CoreLabel>>, DocumentReaderAndWriter<CoreLabel>, java.io.Serializable
public class TrueCasingForNISTDocumentReaderAndWriter
- extends java.lang.Object
- implements DocumentReaderAndWriter<CoreLabel>
adapt from Jenny's TrueCasingDocumentReaderAndWriter.java
- Author:
- Pi-Chuan Chang
- See Also:
- Serialized Form
|
Method Summary |
java.util.Iterator<java.util.List<CoreLabel>> |
getIterator(java.io.Reader r)
Return an iterator over the contents read from r. |
void |
init(SeqClassifierFlags flags)
This will be called immediately after construction. |
static boolean |
known(java.lang.String s)
|
static void |
main(java.lang.String[] args)
for test only |
void |
printAnswers(java.util.List<CoreLabel> doc,
java.io.PrintWriter out)
This method prints the output of the classifier to a
PrintWriter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
THREE_CLASSES_PROPERTY
public static final java.lang.String THREE_CLASSES_PROPERTY
- See Also:
- Constant Field Values
THREE_CLASSES
public static final boolean THREE_CLASSES
knownWords
public static java.util.Set knownWords
TrueCasingForNISTDocumentReaderAndWriter
public TrueCasingForNISTDocumentReaderAndWriter()
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- for test only
- Throws:
java.io.IOException
init
public void init(SeqClassifierFlags flags)
- Description copied from interface:
DocumentReaderAndWriter
- This will be called immediately after construction. It's easier having
an init() method because DocumentReaderAndWriter objects are usually
created using reflection.
- Specified by:
init in interface DocumentReaderAndWriter<CoreLabel>
- Parameters:
flags - Flags specifying behavior
known
public static boolean known(java.lang.String s)
getIterator
public java.util.Iterator<java.util.List<CoreLabel>> getIterator(java.io.Reader r)
- Description copied from interface:
IteratorFromReaderFactory
- Return an iterator over the contents read from r.
- Specified by:
getIterator in interface IteratorFromReaderFactory<java.util.List<CoreLabel>>
- Parameters:
r - Where to read objects from
- Returns:
- An Iterator over the objects
printAnswers
public void printAnswers(java.util.List<CoreLabel> doc,
java.io.PrintWriter out)
- Description copied from interface:
DocumentReaderAndWriter
- This method prints the output of the classifier to a
PrintWriter.
- Specified by:
printAnswers in interface DocumentReaderAndWriter<CoreLabel>
- Parameters:
doc - The document which has answers (it has been classified)out - Where to send the output
Stanford NLP Group