This library offers all annotation related classes and functions used by Octra. It uses AnnotJSON file format as base model. Here you can also find all Annotation converters used by Octra.
npm install --save @octra/annotation
You have two options to install this package und use it as UMD:
a) Install via NPM and reference local files (no internet connection needed om production).
<script type="application/javascript" src="node_modules/@octra/annotation/index.umd.js"></script>
b) Reference remote file (internet connection needed on production).
<script type="application/javascript" src="https://unpkg.com/@octra/annotation/index.umd.js"></script>
Import the classes and functions from @octra/annotation
. For example
import { Level } from "@octra/annotation";
const annotation = new OctraAnnotation();
const level = annotation.addLevel(new OctraAnnotation.createSegmentLevel("OCTRA_1"));
annotation.addItemToCurrentLevel(new SampleUnit(123456, 22050), [
new OLabel(
"OCTRA_1",
"hello world"
)
]);
All functions and classes are available via global scope OctraAnnotation
. For example:
/*
make sure that you have injected the umd bundle as described before.
*/
const annotation = new OctraAnnotation.OctraAnnotation();
const level = annotation.addLevel(new OctraAnnotation.OctraAnnotation.createSegmentLevel("OCTRA_1"));
annotation.addItemToCurrentLevel(new OctraAnnotation.SampleUnit(123456, 22050), [
new OctraAnnotation.OLabel(
"OCTRA_1",
"hello world"
)
]);
You can find more information about classes and functions of @octra/annotation
here.