Skip to content

Instantly share code, notes, and snippets.

@brhoades
Created June 13, 2014 23:13
Show Gist options
  • Save brhoades/b705433f6708326012cb to your computer and use it in GitHub Desktop.
Save brhoades/b705433f6708326012cb to your computer and use it in GitHub Desktop.
Source chain smashing w/ linkage
# Now get our other source ids (text ids). Assume these text id's are in order.
tids.uniq.each do |tid|
sent = exec "SELECT wordid,nextwordid FROM chains WHERE textid=$1", tid[1]
sent.flatten!.uniq!.map! { |c| c = c.to_i }
sent.delete sent[-1]
frags << sent
end
Retrieve sour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment