Giter Site home page Giter Site logo

xp-timetotext's Introduction

Time-2-Text TDD Challenge

Goal

The goal is to develop a time-2-text converter function (time2text) that converts time strings (formatted as 'HH:MM') to human readable text so that a virtual assistants such as Siri can read the text to our blind users.

Constraints

The input will always be a valid time between '00:00' and '23:59'.

Requirements

  • '08:54' should be converted to 'eight fifty-four in the morning'.
  • Before 12:00 'in the morning' should be used. And before 6pm 'in the afternoon'.
  • After 6pm the time should say 'in the evening'.
  • Midnight and noon should result in 'midnight' and 'noon' respectively ('in the morning' etc. is not necessary in these cases).
  • Consider half past, quarter to and quarter past (e.g. 13:30 results in 'half past one in the afternoon'). The same applies to 5, 10 and 20 past/to.
  • Leading zeros should result in 'oh' (e.g. 23:03 results in 'eleven oh three in the evening').
  • Consider combinations of the above rules (e.g. '11:55' should result in 'five to noon').
  • The full hour should say "o'clock" (e.g. 16:00 should result in 'four o'clock in the afternoon').

How to run verification tests

> npm run test:time

How to run unit tests every time a file is changed

> npm run test:watch

How to run verification tests every time a file is changed

> npm run start:watch

OPTIONAL: Pass the tests for the money 2 text converter

Goal

The goal is to develop a money-2-text converter function (money2text) that converts money (USD) (formatted as '10000.00') to human readable text so that a virtual assistants such as Siri can read the text to our blind users.

How to run verification tests

> npm run test:money

xp-timetotext's People

Contributors

dalelotts avatar lahendrix 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.