Copyright | (c) Sean Gillespie 2015 |
---|---|

License | OtherLicense |

Maintainer | Sean Gillespie <sean@mistersg.net> |

Stability | Experimental |

Safe Haskell | Safe |

Language | Haskell2010 |

Generate a letter frequency trigraph, based on a dictionary

## Synopsis

- findWeights :: String -> Maybe [(Char, Rational)]
- findFrequency :: String -> Maybe [Rational]
- defaultFrequencies :: [Rational] -> [Rational]
- frequencies :: [(String, [Rational])]

# Documentation

Search for the character frequencies and return a weighted list

findFrequency :: String -> Maybe [Rational] Source #

Search for the character frequencies based on the first a two-letter string

defaultFrequencies :: [Rational] -> [Rational] Source #

Fix frequencies if they are all 0, since MonadRandom prohibits this. In this case, use all 1s to give every item an equal weight

frequencies :: [(String, [Rational])] Source #

A map of character frequencies, based on a dictionary. The key is a two-letter string, and the value is a list of probabilities (a-z). It's form is:

[("aa", [2,0,3,0,0,0,1,0,0,0,0,1,1,1,0,0,0,3,2,0,0,0,0,0,0,0]), ... ("zz", [7,0,0,0,1,0,0,0,7,0,0,17,0,0,2,0,0,0,0,0,0,0,1,0,5,0])]