Code Monkey home page Code Monkey logo

phonenumbersprinter's Introduction

PhoneNumbersPrinter

======= Problem Statement (based on my understanding) =========== Given:-

We will be given a dictionary of words. Each line of dictionary containing one word. A word can have punctuation and white spaces in it.

We will be provided with phone numbers in an input file or on STDIN

Aim:-

For each phone number read, this program should output all possible word replacements from a dictionary. This program should try to replace every digit of the provided phone number with a letter from a dictionary word; however, if no match can be made, a single digit can be left as is at that point. No two consecutive digits can remain unchanged and the program should skip over a number (producing no output) if a match cannot be made.

How to run this program:-

Jdk 1.8 or above version is required.

For testing we need junit-4.10.jar, hamcrest-core-1.1.jar, mockito-core-1.10.19.jar & objenesis-2.1.jar

If you want to recompile the project then you will need Gradle 2.11

Go to root directory of project i.e. in PhoneNumbersMatcher folder

Option 1:-

Run the program with default dictionary availabe in project.  Phone number will be entered on STDIN

Command --> java -cp ./build/classes/main/ com.naiyarv.Main -d src/resources/dictionary.txt

Option 2:-

Run the program with use provided dictionary availabe in project.  Phone number will be entered on STDIN

Command --> java -cp ./build/classes/main/ com.naiyarv.Main -d ${PATH_OF_DICTIONARY}

Option 3:-

Run the program with default dictionary availabe in project.  Use default phone number files provided in project

Command --> java -cp ./build/classes/main/ com.naiyarv.Main -d src/resources/dictionary.txt src/resources/phoneNumbers.txt src/resources/phoneNumbers_1.txt

Option 4:-

Run the program with use provided dictionary availabe in project.  Phone number files will be provided as argument.

Command --> java -cp ./build/classes/main/ com.naiyarv.Main -d ${PATH_OF_DICTIONARY}  ${PATH_OF_PHONE_FILE_1} ${PATH_OF_PHONE_FILE_2}

phonenumbersprinter's People

Contributors

rickydeveloper avatar ricky22 avatar

Watchers

James Cloos 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.