Skip to content

Instantly share code, notes, and snippets.

@jrjames83
Created March 20, 2018 12:43
Show Gist options
  • Save jrjames83/6b959a335232d830f9ce51c80dc8a4ae to your computer and use it in GitHub Desktop.
Save jrjames83/6b959a335232d830f9ce51c80dc8a4ae to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrjames83
Copy link
Author

you could also group by a lexical sort: if you had a bunch of phrases, for each phrase, split to list, sort alpha wise, add the key to a defaultdict(list) then append the unaffected term which was used for the split and sort operation, to get a lexical ordered grouping.

@jrjames83
Copy link
Author

@jsma ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment