Giter Club home page Giter Club logo

metric's Introduction

Metric: Unit Conversion for Java

Metric is a Java library that processes unit conversion queries written in natural language. It currently understands only English, but it aims at supporting other languages in the future. Among the major highlights, it supports currency conversion and unit prefixes, both SI prefixes and binary prefixes.

The library loads unit definitions from a universe definition file, where properties and their units are declared and defined. Refer to the sample file included in the project to get an idea of the syntax and features supported.

Downloading and building the project

First of all, clone the repo or download the zipball and extract it. Then, open a terminal and go to the root folder of the project, and build it with Maven.

$ mvn assembly:assembly

This generates a couple of jar packages inside the target/ subdirectory within the project root, one with dependencies included, and the other one without dependencies, just the library. You can use it as a library in your own project, or you can run the jar file itself to try a small command-line application included.

Trying out the command-line app

Standing in the project root folder, after building the project as instructed above, you can run unit conversion queries by invoking the jar file as an application, and passing the query as command-line arguments.

$ java -jar target/metric-0.01-jar-with-dependencies.jar 100 miles per hour in meters per second
100 mi / h = 44.704 m / s

It'll print out the answer to standard output, as shown above.

What's next

Feel free to contribute. This project is just starting and any suggestions of new features, improvements and bug fixes are welcome.

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.