edu.cmu.minorthird.text
Class EncapsulatingAnnotatorLoader
java.lang.Object
edu.cmu.minorthird.text.AnnotatorLoader
edu.cmu.minorthird.text.EncapsulatingAnnotatorLoader
- All Implemented Interfaces:
- java.io.Serializable
public class EncapsulatingAnnotatorLoader
- extends AnnotatorLoader
- implements java.io.Serializable
AnnotatorLoader which contains locally a list of Annotator
definitions, in the form of a list of class files, and/or mixup
files.
- See Also:
- Serialized Form
Method Summary |
java.lang.Class<?> |
findClassResource(java.lang.String className)
Find the named resource class - usually an annotator. |
java.io.InputStream |
findFileResource(java.lang.String fileName)
Find the named resource file - usually a dictionary or trie for mixup. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EncapsulatingAnnotatorLoader
public EncapsulatingAnnotatorLoader(java.lang.String path)
- Parameters:
path
- Filenames, separated by the current value of
File.pathSeparator, which should be "encapsulated". Encapsulated
files should be .mixup files or .class files, which will be read
in when the AnnotatorLoader is created. Their contents will
serialized along with it. When finding annotators (for a
TextLabels object, in a require call) an
EncapsulatingAnnotatorLoader will load these files in preference
to anything on the current classpath.
EncapsulatingAnnotatorLoader
public EncapsulatingAnnotatorLoader(boolean asFiles,
java.lang.String path)
- Parameters:
asFiles
- if true, elements of the path are file names. If
false, elements of the path should be resources that can be found
with getResourceAsStream(). The 'asFiles=false' option was
mostly provided so that file-system-independent unit tests
could be written.
findFileResource
public java.io.InputStream findFileResource(java.lang.String fileName)
- Find the named resource file - usually a dictionary or trie for mixup.
- Specified by:
findFileResource
in class AnnotatorLoader
findClassResource
public java.lang.Class<?> findClassResource(java.lang.String className)
- Find the named resource class - usually an annotator.
- Specified by:
findClassResource
in class AnnotatorLoader