public class ExternalDocument extends Document
| Constructor and Description |
|---|
ExternalDocument(String format,
String fileName)
creates a new external document associated with file 'fileName'.
|
ExternalDocument(String format,
String directory,
String fileName) |
| Modifier and Type | Method and Description |
|---|---|
String |
directory()
returns the directory associated with the document, or 'null'
if there is no directory (if the fileName contains the full path).
|
String |
fileName()
returns the file name associated with the document.
|
String |
format()
returns the format of the file holding this document: 'sgml' or 'pos'.
|
String |
fullFileName()
the full file name, including both the directory and the file name
within the directory
|
boolean |
isOpen()
returns 'true' if the file has been opened.
|
boolean |
open()
opens the externalDocument: reads the contents of the file, filling the
text and annotations of the document.
|
void |
save()
saves the Document to the directory/fileName used for opening the Document.
|
void |
saveAs(String directory,
String fileName)
saves the Document to file 'fileName' in directory 'directory'.
|
void |
saveIn(String directory)
saves the Document to the originally specified fileName in directory
'directory'.
|
void |
setAllTags(boolean allTags)
if allTags == true, specifies that all SGML tags are to be converted to
annotations when this document is opened.
|
void |
setEmptyTags(String[] tags)
specify a list of empty tags -- tags which do not have any corresponding
close tags and so should be converted to empty Annotations.
|
void |
setSGMLtags(String[] tags)
sets the list of SGML tags which are to be converted to annotations when
this document is opened.
|
static void |
writeWithSystemNewlines(BufferedWriter writer,
String string)
writes
string to writer, converting newline
characters to system-specific newlines. |
addAnnotation, annotate, annotateWithTag, annotateWithTag, annotationsAt, annotationsAt, annotationsAt, annotationsEndingAt, annotationsEndingAt, annotationsOfType, annotationsOfType, append, append, charAt, clear, clearAnnotations, fullSpan, getAnnotationTypes, getNextAnnotationId, length, normalizedText, normalizedText, removeAnnotation, removeAnnotationsOfType, setActiveHypotheses, setCharAt, setCurrentHypothesis, setSGMLindent, setSGMLwrapMargin, setText, shrink, shrink, shrinkAll, stretch, stretch, stretchAll, text, text, text, tokenAt, tokenEndingAt, writeSGML, writeSGML, writeSGMLpublic ExternalDocument(String format, String fileName)
public void setSGMLtags(String[] tags)
public void setAllTags(boolean allTags)
public void setEmptyTags(String[] tags)
public boolean open()
public void save()
public static void writeWithSystemNewlines(BufferedWriter writer, String string) throws IOException
string to writer, converting newline
characters to system-specific newlines.IOExceptionpublic void saveIn(String directory)
public void saveAs(String directory, String fileName)
public boolean isOpen()
public String format()
public String directory()
public String fileName()
public String fullFileName()
Copyright © 2016 New York University. All rights reserved.