Coder Social home page Coder Social logo

natural-language-unit-converter's Introduction

Natural Language Unit Converter

Natural langage input, conversion output

A unit converter on the command line which uses plain English as input

Usage

.\NLUC.exe "12 m/s in cm/min"

.\NLUC.exe "12 Mb in GB"

.\NLUC.exe "5m/day in mi/yr"

.\NLUC.exe "5 pennies in pounds"

.\NLUC.exe "20 kg in pounds"

.\NLUC.exe "2m in ft and inches"

.\NLUC.exe "15.55 days in hours and mins"

or just run .\NLUC.exe for a REPL-like environement

You can also use it in pipes in powershell:

.\NLUC.exe 200lb in kg | foreach {Write-Output "$_ =" ;.\NLUC.exe "$_ in g"}

References

You can also see 'reference' values:

.\NLUC.exe "1200kg as elephants" .\NLUC.exe "3.4km as empire state buildings" .\NLUC.exe "44F ref chickens"

References can have multiple values, each related to a base SI unit, eg. Elephant has mass height.

For a list of all available units and references, pass ? as the query

TODO

Support queries like:

  • 15l/s in kg/min where 2 litres = 1.2 kilograms / 15l/s in kg/min where 2 litres is 1.2 kilograms
  • Volumes/areas
  • 2 cups of water in kg
  • 2km in steps where 1 step is 30cm - 'steps' may or may not be defined already
  • 1 oz as gold - output x moles
  • <measurement> - output a measure of <base measurement>, eg km -> a measure of metres
  • 15.55 days in hours, mins and seconds or 15.55 days in hours and mins and seconds or 15.55 days in hours mins seconds

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.