Haskell-Data-Analysis-Cookbook/Ch03
2014-06-12 22:19:26 -04:00
..
Code01_base1 Added Chapter 3 2014-06-12 22:19:26 -04:00
Code02_base2 Added Chapter 3 2014-06-12 22:19:26 -04:00
Code03_substring Added Chapter 3 2014-06-12 22:19:26 -04:00
Code04_bm Added Chapter 3 2014-06-12 22:19:26 -04:00
Code05_rk Added Chapter 3 2014-06-12 22:19:26 -04:00
Code06_split Added Chapter 3 2014-06-12 22:19:26 -04:00
Code07_lcs Added Chapter 3 2014-06-12 22:19:26 -04:00
Code08_phon Added Chapter 3 2014-06-12 22:19:26 -04:00
Code09_edit Added Chapter 3 2014-06-12 22:19:26 -04:00
Code10_jw Added Chapter 3 2014-06-12 22:19:26 -04:00
Code11_edit1 Added Chapter 3 2014-06-12 22:19:26 -04:00
Code12_spell Added Chapter 3 2014-06-12 22:19:26 -04:00
LICENSE Added Chapter 3 2014-06-12 22:19:26 -04:00
README.md Added Chapter 3 2014-06-12 22:19:26 -04:00

Chapter 3

Chapter 3, The Science of Words, introduces common string manipulation algorithms including base conversions, substring matching, and computing the edit distance.

This is the accompanying source code for Haskell Data Analysis Cookbook. Refer to the book for step-by-step explanations.

Recipes

  • Code01: Displaying a number in another base
  • Code02: Reading a number from another base
  • Code03: Searching for a substring using Data.ByteString
  • Code04: Searching a string using the BoyerMooreHorspool algorithm
  • Code05: Searching a string using the Rabin-Karp algorithm
  • Code06: Splitting a string on lines, words, or arbitrary tokens
  • Code07: Finding the longest common subsequence
  • Code08: Computing a phonetic code
  • Code09: Calculating the edit distance between two strings
  • Code10: Computing the JaroWinkler distance between two strings
  • Code11: Finding strings within one-edit distance
  • Code12: Fixing spelling mistakes using edit distance

How to use

Setting up the environment

Install the Haskell Platform.

$ sudo apt-get install haskell-platform

Alternatively, install GHC 7.6 (or above) and Cabal.

$ sudo apt-get install ghc cabal-install

Running the code

A Makefile is provided in each recipe. Compile the corresponding executable by running make.

$ make

Run the resulting code. For example,

$ ./Code01

To clean up the directory:

$ make clean