Created
December 23, 2016 22:15
-
-
Save Jamil/14123984c07c7a1866c0593ab6a39b00 to your computer and use it in GitHub Desktop.
Create a map of successors, indexed by the predecessor token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bigrammap :: [(String, String)] -> [(String, [String])] | |
| bigrammap bgs = zip leaders followers | |
| where followers = map (\l -> successors l bgs) leaders | |
| leaders = nub $ map fst bgs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment