Skip to content

Commit

Permalink
Merge pull request #15 from psibre/documentation
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
psibre authored Jun 20, 2018
2 parents d772e83 + c76e76d commit 0cbd814
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ JTGT
[Unreleased]
------------

### Added

- publish Javadoc artifact
- link to hosted Javadoc

### Fixed

- incompatibility with TextGrids written by Praat
Expand Down
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
[![Build Status](https://travis-ci.org/m2ci-msp/jtgt.svg?branch=master)](https://travis-ci.org/m2ci-msp/jtgt)
[![Download](https://api.bintray.com/packages/m2ci-msp/maven/jtgt/images/download.svg)](https://bintray.com/m2ci-msp/maven/jtgt/_latestVersion)
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](http://www.gnu.org/licenses/lgpl-3.0)
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)

# JTGT

JTGT is a porting of the TextGrid Tools python library into java. Original TextGridTools can be find here: https://github.com/hbuschme/TextGridTools
JTGT is a Java library for loading, manipulating, and writing [Praat] TextGrid files, and similar annotation files, such as XWaves lab.
It's inspired by the [TextGridTools] module for Python.

## Adding JTGT to your dependencies
## Dependency Information

To declare a depency on JTGT you can do it:
Release versions are [hosted on Bintray] and indexed in [JCenter].
Snapshot builds are [hosted on OJO].

- in the `pom.xml` for Maven:
```xml
<repositories>
<repository>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
## Examples

<dependencies>
<dependency>
<groupId>org.m2ci.msp</groupId>
<artifactId>jtgt</artifactId>
<version>0.5.3</version>
</dependency>
</dependencies>
### Loading a TextGrid file

```java
String tgStr = new File("path/to/my.TextGrid").getText();
TextGrid tg = new TextGridSerializer().fromString(tgStr);
```
- in the `build.gradle` for Gradle
```groovy
repositories {
jcenter()
}

dependencies {
compile group: 'org.m2ci.msp', name:'jtgt', version: '0.5.3'
### Iterating over intervals

```java
for (Annotation annot : tg.getTiers().get(0).getAnnotations()) {
System.out.println(annot.getText());
}
```

### [Javadoc]

[Praat]: http://praat.org/
[TextGridTools]: https://github.com/hbuschme/TextGridTools
[hosted on Bintray]: https://bintray.com/m2ci-msp/maven/jtgt/_latestVersion
[JCenter]: https://bintray.com/bintray/jcenter
[hosted on OJO]: https://oss.jfrog.org/artifactory/webapp/#/artifacts/browse/tree/General/oss-snapshot-local/org/m2ci/msp/jtgt
[Javadoc]: https://m2ci-msp.github.io/jtgt/docs/javadoc/
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

version '0.6-SNAPSHOT'
group "org.m2ci.msp"
description "Java TextGrid Tools porting"
description "Java TextGridTools"

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand Down Expand Up @@ -48,15 +48,20 @@ task autoFormatCode {

task sourceJar(type: Jar) {
from sourceSets.main.allJava
classifier 'sources'
}

task javadocJar(type: Jar) {
from javadoc
classifier 'javadoc'
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier 'sources'
}
artifact sourceJar
artifact javadocJar
}
}
repositories {
Expand Down

0 comments on commit 0cbd814

Please sign in to comment.