Modifier and Type | Method and Description |
---|---|
static CAS |
createCas()
Creates a new
CAS . |
static CAS |
createCas(String... typeSystemDescriptorNames)
Creates a new
CAS from type system descriptor files found by name. |
static CAS |
createCas(String fileName,
TypeSystemDescription typeSystemDescription)
This method creates a new CAS and loads the contents of an XMI or XCAS file into it.
|
static CAS |
createCas(TypeSystemDescription typeSystemDescription)
Create a new CAS for the given type system description.
|
static CAS |
createCasFromPath(String... typeSystemDescriptorPaths)
Creates a new CAS from type system descriptor files.
|
static CAS |
createText(String aText)
Creates a new CAS with the given text.
|
static CAS |
createText(String aText,
String aLanguage)
Creates a new CAS with the given text and language.
|
public static CAS createText(String aText) throws ResourceInitializationException
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 CAS.ResourceInitializationException
- if the CAS could not be initializedpublic static CAS createText(String aText, String aLanguage) throws ResourceInitializationException
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 CAS.aLanguage
- the document language to be set in the new CAS.ResourceInitializationException
- if the CAS could not be initializedpublic static CAS createCas() throws ResourceInitializationException
CAS
. 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 initializedpublic static CAS createCas(String... typeSystemDescriptorNames) throws ResourceInitializationException
CAS
from type system descriptor files found by name. No auto-detection
for type priorities, or indexes is performed.typeSystemDescriptorNames
- names of the type system descriptors on the classpath used to initialize the CAS (in
Java notation, e.g. "my.package.TypeSystem" without the ".xml" extension)ResourceInitializationException
- if the CAS could not be initializedpublic static CAS createCasFromPath(String... typeSystemDescriptorPaths) throws ResourceInitializationException
typeSystemDescriptorPaths
- paths to type system descriptor filesResourceInitializationException
- if the CAS could not be initializedpublic static CAS createCas(TypeSystemDescription typeSystemDescription) throws ResourceInitializationException
typeSystemDescription
- a type system description to initialize the CASResourceInitializationException
- if the CAS could not be initializedpublic static CAS createCas(String fileName, TypeSystemDescription typeSystemDescription) throws ResourceInitializationException, IOException
fileName
- a file name for the serialized CAS datatypeSystemDescription
- a type system description to initialize the CASResourceInitializationException
- if the CAS could not be initializedIOException
- if there is a problem reading the fileCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.