nlpwp/book — Issue #3: Typos: chapter 3 N-grams
Author: hmf
Created: 2011-10-20 08:56:58+00:00
State: open

Section 3.7

*Main> binarySearch (V.fromList [1,2,3,5,7,9]) 9
Just 1
*Main> binarySearch (V.fromList [1,2,3,5,7,9]) 10
Just 5 <---- wrong
*Main> binarySearch (V.fromList [1,2,3,5,7,9]) 10 <---- extra?

*Main> let corpus = ["to","be","or","not","to","be"]
*Main> let sa = fromList corpus
*Main> containsWithFreq sa $ Data.Vector.fromList ["not"] <----- "be" ?
Just 2
*Main> containsWithFreq sa $ Data.Vector.fromList ["not"]
Just 1

Exercise 3.7.1

This function extracts the most frequent n-gram from a suffix array, where the suffix array
and n are given as arguments. The function should continue a pair of the n-gram and
--------------- continue -> contain
the frequency as a typle wrapped in Maybe.
--------- typle -> tuple