Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this will be the complicated case
- insertNode contextNode@TrieNode{children=childNodes,nodeType=oldNodeType}
- SharedPrefixDatum { shared = sharedPrefix ,
- suffixS = sourceSuffix@(s:ss),
- suffixT = targetSuffix@(t:ts)}
- = newForkNode {children = ourTwoNewNodes }
- where newForkNode = nonWordNode sharedPrefix
- ourTwoNewNodes = Map.fromList [(s,newSourceSuffixNode),(t,newTargetSuffixNode) ]
- newSourceSuffixNode = wordNode sourceSuffix
- newTargetSuffixNode = contextNode{ wordFragment = targetSuffix}
Add Comment
Please, Sign In to add comment