AnitomyJ

AnitomyForJava is a Java port of Anitomy, a library for parsing anime video filenames. It's accurate, fast, and simple to use.

View the Project on GitHub Vorror/anitomyJ

TravisCI Maven Central Javadocs License: MPL 2.0

AnitomyForJava

AnitomyForJava is a Java port of Anitomy, a library for parsing anime video filenames. It's accurate, fast, and simple to use. All credit goes to @erengy. I simply ported it.

Examples

The following filename...

[BM&T] Toradora! (2008) - 07v2 - Pool Opening [720p Hi10p FLAC] [BD] [8F59F2BA].mkv

...would be resolved into these elements:

Here's an example code snippet...

import com.dgtlrepublic.anitomyj.AnitomyJ;
import com.dgtlrepublic.anitomyj.Element;

public class Main {
    public static void main(String[] args) {
        List<Element> elements = AnitomyJ.parse(
                "[BM&T] Toradora! (2008) - 07v2 - Pool Opening [720p Hi10p FLAC] [BD] [8F59F2BA].mkv");
        System.out.println(elements.stream()
                                   .map(e -> e.getCategory().name() + "=" + e.getValue())
                                   .collect(Collectors.joining("\n")));
    }
}

...which will output:

kElementFileExtension=mkv
kElementFileName=[BM&T] Toradora! (2008) - 07v2 - Pool Opening [720p Hi10p FLAC] [BD] [8F59F2BA]
kElementVideoResolution=720p
kElementAnimeType=Opening
kElementVideoTerm=Hi10p
kElementAudioTerm=FLAC
kElementSource=BD
kElementFileChecksum=8F59F2BA
kElementAnimeYear=2008
kElementEpisodeNumber=07
kElementReleaseVersion=2
kElementAnimeTitle=Toradora!
kElementReleaseGroup=BM&T

Installation

Requirements

Java 8+

Maven Release

Add the following to your pom.xml:

<dependency>
    <groupId>com.dgtlrepublic</groupId>
    <artifactId>anitomyJ</artifactId>
</dependency>

Binary Release

Binary releases can be found here. Apache Commons(v3.4+) and Apache Commons Collections(v3.2+) are required. For convenience anitomyJ-<version>-with-dependencies.jar is provided, but installing the dependencies manually is recommended.

Issues & Pull Requests

For the most part, AnitomyJ aims to be an exact Java replica of the original Anitomy. To make porting upstream changes easier most of the logic + file structure remain similar to their c++ counterparts. So, for the time being, I won't be accepting pull requests/issues that change the core parsing logic. I suggest opening an issue with the original Anitomy project and when it's fixed I'll merge it downstream.

That being said if the output of AnitomyJ and Anitomy differ in any way please open an issue.

FAQ

License

AnitomyForJava is licensed under Mozilla Public License 2.0.