Guest User

Untitled

a guest
May 24th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. -- this will be the complicated case
  2. insertNode contextNode@TrieNode{children=childNodes,nodeType=oldNodeType}
  3. SharedPrefixDatum { shared = sharedPrefix ,
  4. suffixS = sourceSuffix@(s:ss),
  5. suffixT = targetSuffix@(t:ts)}
  6. = newForkNode {children = ourTwoNewNodes }
  7. where newForkNode = nonWordNode sharedPrefix
  8. ourTwoNewNodes = Map.fromList [(s,newSourceSuffixNode),(t,newTargetSuffixNode) ]
  9. newSourceSuffixNode = wordNode sourceSuffix
  10. newTargetSuffixNode = contextNode{ wordFragment = targetSuffix}
Add Comment
Please, Sign In to add comment