Annotation PRO Format Library

Library to read and write Annotation Pro files

Лицензия

Лицензия

Категории

Категории

ORM Данные
Группа

Группа

org.annotationpro
Идентификатор

Идентификатор

annotationpro-format
Последняя версия

Последняя версия

1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Annotation PRO Format Library
Library to read and write Annotation Pro files
Ссылка на сайт

Ссылка на сайт

http://annotationpro.org
Система контроля версий

Система контроля версий

https://github.com/annotationpro/annotationpro-format-java

Скачать annotationpro-format

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.annotationpro/annotationpro-format/ -->
<dependency>
    <groupId>org.annotationpro</groupId>
    <artifactId>annotationpro-format</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.annotationpro/annotationpro-format/
implementation 'org.annotationpro:annotationpro-format:1.2'
// https://jarcasting.com/artifacts/org.annotationpro/annotationpro-format/
implementation ("org.annotationpro:annotationpro-format:1.2")
'org.annotationpro:annotationpro-format:jar:1.2'
<dependency org="org.annotationpro" name="annotationpro-format" rev="1.2">
  <artifact name="annotationpro-format" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.annotationpro', module='annotationpro-format', version='1.2')
)
libraryDependencies += "org.annotationpro" % "annotationpro-format" % "1.2"
[org.annotationpro/annotationpro-format "1.2"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

annotationpro-format-java

Java library to save annotation in Annotation Pro format.

Import using Maven

<dependencies>
    <dependency>
        <groupId>org.annotationpro</groupId>
        <artifactId>annotationpro-format</artifactId>
        <version>1.2</version>
    </dependency>
</dependencies>

Write annotation example

        // annotation model
        Annotation annotation = new Annotation(44100);

        // new layer
        Layer layer = new Layer("Example layer");
        layer.setFontSize(12);
        annotation.getLayers().add(layer);

        // new segments
        Segment segment = new Segment("word", 100, 44100);
        layer.getSegments().add(segment);

        Segment segment2 = new Segment("phrase", 52000, 44100);
        layer.getSegments().add(segment2);

        // serialization
        AnnotationSerializer annotationSerializer = new AnnotationSerializer();
        String antxContent = annotationSerializer.serializeAnnotation(annotation);

        // save to file
        try {
            Path file = Paths.get("c:\\annotation new.antx");
            Files.write(file, antxContent.getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }

Read annotation example

try {
    // read from file
    Path file = Paths.get("c:\\annotation new.antx");
    String xmlContent = new String(Files.readAllBytes(file));

    // deserialize annotation
    AnnotationDeserializer annotationDeserializer = new AnnotationDeserializer();
    Annotation annotation = annotationDeserializer.deserializeAnnotation(xmlContent);

    // get first layer and first segment on this layer
    Layer layer = annotation.getLayers().get(0);
    Segment segment = layer.getSegments().get(0);

} catch (Exception e) {
    e.printStackTrace();
}
org.annotationpro

Annotation Pro Devs

Annotation Pro Developers Group

Версии библиотеки

Версия
1.2
1.1
1.0