Skip to content

Parses bigrams from the command line or in your project

Notifications You must be signed in to change notification settings

tylerswett/bigram-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bigram Node App

This simple app allows you to parse and count bigrams in any given input string

Command line usage

  • npm run start [file] ... When running in this method, the text content of the file path will automatically be lowercased, punctuation removed, and results will be output to the console
  • npm run test ... Executes unit test cases

Functions and usage

formatInput - Input: String, Output: String[] - Converts an input string to lowercase, removes punctuation, and converts it into an array of separate strings

countBigrams - Input: String[], Output: Map() - Recursively goes through each bigram in your string array and counts the amount of times each bigram appears into a Map. Provide formatted input to this, or if you want your bigrams to be case sensitive or to include punctuation, then pass in your own array of input strings

formatHistogramString - Input: Map(), Output: String - Takes in your histogram map and creates a human readable string showing the amount of times each bigram occured

About

Parses bigrams from the command line or in your project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published