GithubHelp home page GithubHelp logo

cloudogu / spotter Goto Github PK

View Code? Open in Web Editor NEW
4.0 11.0 2.0 252 KB

Content-Type and language recognition library

License: MIT License

Java 92.65% Ruby 1.45% Python 0.06% Handlebars 5.83%
content-type mime-type java maven tika detection recognition language

spotter's Introduction

Spotter

Build Status Maven Central Quality Gates Coverage

Spotter is a library which is able to detect the content type of a file. It is also able to detect the programming language of source files. Spotter uses Apache Tika for the content type recognition and uses the language.yml from the Linguist project.

Usage

Add the latest stable version of to the dependency management tool of your choice.

E.g. for maven:

<dependency>
    <groupId>com.cloudogu.spotter</groupId>
    <artifactId>spotter-core</artifactId>
    <version>x.y.z</version>
</dependency>

Use the latest version from maven central: Maven Central

For versions before 4.0.0 use the following coordinates:

<dependency>
    <groupId>com.github.sdorra</groupId>
    <artifactId>spotter-core</artifactId>
    <version>x.y.z</version>
</dependency>

Examples

Detect the content type and the programming language of a file:

ContentType contentType = ContentTypes.detect("com/cloudogu/spotter/Language.java");
System.out.println("Content-Type: " + contentType);

Optional<Language> language = contentType.getLanguage();
if (language.isPresent()) {
    System.out.println("Language    : " + language.get().getName());
}

License

This project is licensed under the MIT License - see the LICENSE file for details

spotter's People

Contributors

cesmarvin avatar dependabot[bot] avatar eheimbuch avatar matthiasthieroff avatar pfeuffer avatar sdorra avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.