Giter Club home page Giter Club logo

challenge_01_email_substring's Introduction

#Email filter

We need to create a plugin to help filter e-mails by a specific keywords to help identify important e-mails.

Your program will be passed a data file with the specific string to search for and a list of e-mail subjects. Your program should return the single e-mail subject that has the most occurences of the provided search string.

Search should be not be case-sensitive and the string doesn't have to be full words. For example, a search for in would count in, input, and picking as occurences of in.

All of your code should be in the js file in the lib directory.

##Testing

The data folder is full of test input files. You can load a single test into the program which will allow you to see the output of your program directly.

There is also a test.js file which will call your function against each of the test cases and check if they are getting the expected output.

In Terminal

#run single input file
node index.js < ./data/test00.txt

#run tests
node test.js

##Examples

Example Input

dividends
first e-mail subject
It pays dividends
So good your dividends will have dividends
one more subject

Example Output

So good your dividends will have dividends

Your program outputs the e-mail subject where dividends appears twice because it is the most frequent occurence.

Example Input

book
what is your favorite book?
book and Books too
This one also says book.

Example Output

book and Books too

Your program outputs the e-mail subject where book appears the most. Notice that it doesn't care about capitilization or the 's' on books.

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.