Created
December 23, 2016 22:14
-
-
Save Jamil/ec2b20923a475b62a2d20d5271b42f77 to your computer and use it in GitHub Desktop.
Generate a list of potential successor tokens given a word, from a bigram model
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
| successors :: String -> [(String, String)] -> [String] | |
| successors predecessor bigrams = map snd matches | |
| where matches = filter (\p -> fst p == predecessor) bigrams |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment