Modifier and Type | Method and Description |
---|---|
static JCas |
createJCas()
Creates a new
JCas . |
static JCas |
createJCas(String... typeSystemDescriptorNames)
Creates a new JCas from type system descriptor files found by name.
|
static JCas |
createJCas(String fileName,
TypeSystemDescription typeSystemDescription)
This method creates a new JCas and loads the contents of an XMI or XCAS file into it.
|
static JCas |
createJCas(TypeSystemDescription typeSystemDescription)
Create a new JCas for the given type system description.
|
static JCas |
createJCasFromPath(String... typeSystemDescriptorPaths)
Creates a new JCas from type system descriptor files.
|
static JCas |
createText(String aText)
Creates a new JCas with the given text.
|
static JCas |
createText(String aText,
String aLanguage)
Creates a new JCas with the given text and language.
|
public static JCas createText(String aText) throws ResourceInitializationException, CASException
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.aText
- the document text to be set in the new JCas.ResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createText(String aText, String aLanguage) throws ResourceInitializationException, CASException
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.aText
- the document text to be set in the new JCas.aLanguage
- the document language to be set in the new JCas.ResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createJCas() throws ResourceInitializationException, CASException
JCas
. The type system is detected automatically using
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.ResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createJCas(String... typeSystemDescriptorNames) throws ResourceInitializationException, CASException
typeSystemDescriptorNames
- names of the type system descriptors on the classpath used to initialize the JCas (in
Java notation, e.g. "my.package.TypeSystem" without the ".xml" extension)ResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createJCasFromPath(String... typeSystemDescriptorPaths) throws ResourceInitializationException, CASException
typeSystemDescriptorPaths
- paths to type system descriptor filesResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createJCas(TypeSystemDescription typeSystemDescription) throws ResourceInitializationException, CASException
typeSystemDescription
- a type system description to initialize the JCasResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedpublic static JCas createJCas(String fileName, TypeSystemDescription typeSystemDescription) throws ResourceInitializationException, CASException, IOException
fileName
- a file name for the serialized CAS datatypeSystemDescription
- a type system description to initialize the JCasResourceInitializationException
- if the CAS could not be initializedCASException
- if the JCas could not be initializedIOException
- if there is a problem reading the fileCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.