GitHub PullRequestEvent at 2014-05-06 21:58:25
Repository: citation
Actor: konklone
Payload: {"action":"closed","number":70,"pull_request":{"url":"https://api.github.com/repos/unitedstates/citation/pulls/70","id":15567848,"html_url":"https://github.com/unitedstates/citation/pull/70","diff_url":"https://github.com/unitedstates/citation/pull/70.diff","patch_url":"https://github.com/unitedstates/citation/pull/70.patch","issue_url":"https://api.github.com/repos/unitedstates/citation/issues/70","number":70,"state":"closed","title":"Refactor of citation extraction","user":{"login":"konklone","id":4592,"avatar_url":"https://avatars.githubusercontent.com/u/4592?","gravatar_id":"ac3399caecce27cb19d381f61124539e","url":"https://api.github.com/users/konklone","html_url":"https://github.com/konklone","followers_url":"https://api.github.com/users/konklone/followers","following_url":"https://api.github.com/users/konklone/following{/other_user}","gists_url":"https://api.github.com/users/konklone/gists{/gist_id}","starred_url":"https://api.github.com/users/konklone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konklone/subscriptions","organizations_url":"https://api.github.com/users/konklone/orgs","repos_url":"https://api.github.com/users/konklone/repos","events_url":"https://api.github.com/users/konklone/events{/privacy}","received_events_url":"https://api.github.com/users/konklone/received_events","type":"User","site_admin":false},"body":"This removes [XRegExp](http://xregexp.com/) from Citation entirely, and refactors the main extraction/replacement work to use a combined regex that knows which matches came from which citator.\r\n\r\nSome ramifications:\r\n\r\n* This removes named captures from all citator regexes. This makes the regexes sort of both more and less readable at the same time.\r\n* All citation patterns now have an associated `fields` array that gives a name to every capture, *in the order they appear in the regex*. This array is used for two things:\r\n  * To know how many captures a given regex expects, so that indexes of each pattern can be ascertained before combining each active pattern into a master regex. This is required for bookkeeping these indexes.\r\n  * To do a quick transformation on captured data before passing them onto a pattern's `processor`, which can keep the same method signature it used to when we were using named captures. From the `processor`'s point of view, it's getting the same object of named captures it used to before this PR.\r\n* Find and replace continues to function as normal, and it's still not obvious how we'd handle replacement for judicial cites from walverine. I opened https://github.com/adelevie/walverine/issues/10 to discuss that.\r\n\r\nAnd pleasingly:\r\n\r\n* The library is now much smaller when browserified! The min/gz'd version went from 52K to 30K, and the min'd version went from 200K to 144K. Most of the remaining bulk is now walverine, so the next step is have `gulp` produce a walverine-less version for those who don't need it, tracked in https://github.com/unitedstates/citation/issues/69.\r\n* The library is now much faster! The tests are operating at something like double speed. Terrific-o.\r\n\r\nThe next step is to start making replacement work better when filters and other options are added, to add  replacement where possible for the CLI and the HTTP version, and to resolve the other issues tracked in #26.","created_at":"2014-05-06T21:57:11Z","updated_at":"2014-05-06T21:58:25Z","closed_at":"2014-05-06T21:58:25Z","merged_at":"2014-05-06T21:58:25Z","merge_commit_sha":"5f0ebd7b5ff7e1f54f3b9560686a3546408cac2d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unitedstates/citation/pulls/70/commits","review_comments_url":"https://api.github.com/repos/unitedstates/citation/pulls/70/comments","review_comment_url":"https://api.github.com/repos/unitedstates/citation/pulls/comments/{number}","comments_url":"https://api.github.com/repos/unitedstates/citation/issues/70/comments","statuses_url":"https://api.github.com/repos/unitedstates/citation/statuses/a72239731f0a817ec7b10fc57a2bd48daf5be2f9","head":{"label":"unitedstates:replacement","ref":"replacement","sha":"a72239731f0a817ec7b10fc57a2bd48daf5be2f9","user":{"login":"unitedstates","id":2200203,"avatar_url":"https://avatars.githubusercontent.com/u/2200203?","gravatar_id":"13407a4bedf3a760924bb0dd57d776d0","url":"https://api.github.com/users/unitedstates","html_url":"https://github.com/unitedstates","followers_url":"https://api.github.com/users/unitedstates/followers","following_url":"https://api.github.com/users/unitedstates/following{/other_user}","gists_url":"https://api.github.com/users/unitedstates/gists{/gist_id}","starred_url":"https://api.github.com/users/unitedstates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unitedstates/subscriptions","organizations_url":"https://api.github.com/users/unitedstates/orgs","repos_url":"https://api.github.com/users/unitedstates/repos","events_url":"https://api.github.com/users/unitedstates/events{/privacy}","received_events_url":"https://api.github.com/users/unitedstates/received_events","type":"Organization","site_admin":false},"repo":{"id":4245245,"name":"citation","full_name":"unitedstates/citation","owner":{"login":"unitedstates","id":2200203,"avatar_url":"https://avatars.githubusercontent.com/u/2200203?","gravatar_id":"13407a4bedf3a760924bb0dd57d776d0","url":"https://api.github.com/users/unitedstates","html_url":"https://github.com/unitedstates","followers_url":"https://api.github.com/users/unitedstates/followers","following_url":"https://api.github.com/users/unitedstates/following{/other_user}","gists_url":"https://api.github.com/users/unitedstates/gists{/gist_id}","starred_url":"https://api.github.com/users/unitedstates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unitedstates/subscriptions","organizations_url":"https://api.github.com/users/unitedstates/orgs","repos_url":"https://api.github.com/users/unitedstates/repos","events_url":"https://api.github.com/users/unitedstates/events{/privacy}","received_events_url":"https://api.github.com/users/unitedstates/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unitedstates/citation","description":"Legal citation extractor, via command line, JavaScript, or HTTP.","fork":false,"url":"https://api.github.com/repos/unitedstates/citation","forks_url":"https://api.github.com/repos/unitedstates/citation/forks","keys_url":"https://api.github.com/repos/unitedstates/citation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unitedstates/citation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unitedstates/citation/teams","hooks_url":"https://api.github.com/repos/unitedstates/citation/hooks","issue_events_url":"https://api.github.com/repos/unitedstates/citation/issues/events{/number}","events_url":"https://api.github.com/repos/unitedstates/citation/events","assignees_url":"https://api.github.com/repos/unitedstates/citation/assignees{/user}","branches_url":"https://api.github.com/repos/unitedstates/citation/branches{/branch}","tags_url":"https://api.github.com/repos/unitedstates/citation/tags","blobs_url":"https://api.github.com/repos/unitedstates/citation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unitedstates/citation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unitedstates/citation/git/refs{/sha}","trees_url":"https://api.github.com/repos/unitedstates/citation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unitedstates/citation/statuses/{sha}","languages_url":"https://api.github.com/repos/unitedstates/citation/languages","stargazers_url":"https://api.github.com/repos/unitedstates/citation/stargazers","contributors_url":"https://api.github.com/repos/unitedstates/citation/contributors","subscribers_url":"https://api.github.com/repos/unitedstates/citation/subscribers","subscription_url":"https://api.github.com/repos/unitedstates/citation/subscription","commits_url":"https://api.github.com/repos/unitedstates/citation/commits{/sha}","git_commits_url":"https://api.github.com/repos/unitedstates/citation/git/commits{/sha}","comments_url":"https://api.github.com/repos/unitedstates/citation/comments{/number}","issue_comment_url":"https://api.github.com/repos/unitedstates/citation/issues/comments/{number}","contents_url":"https://api.github.com/repos/unitedstates/citation/contents/{+path}","compare_url":"https://api.github.com/repos/unitedstates/citation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unitedstates/citation/merges","archive_url":"https://api.github.com/repos/unitedstates/citation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unitedstates/citation/downloads","issues_url":"https://api.github.com/repos/unitedstates/citation/issues{/number}","pulls_url":"https://api.github.com/repos/unitedstates/citation/pulls{/number}","milestones_url":"https://api.github.com/repos/unitedstates/citation/milestones{/number}","notifications_url":"https://api.github.com/repos/unitedstates/citation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unitedstates/citation/labels{/name}","releases_url":"https://api.github.com/repos/unitedstates/citation/releases{/id}","created_at":"2012-05-07T00:54:49Z","updated_at":"2014-05-06T21:58:25Z","pushed_at":"2014-05-06T21:58:25Z","git_url":"git://github.com/unitedstates/citation.git","ssh_url":"git@github.com:unitedstates/citation.git","clone_url":"https://github.com/unitedstates/citation.git","svn_url":"https://github.com/unitedstates/citation","homepage":"","size":1575,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":8,"mirror_url":null,"open_issues_count":22,"forks":8,"open_issues":22,"watchers":57,"default_branch":"master"}},"base":{"label":"unitedstates:master","ref":"master","sha":"dd9cb280b11588ef176b90f1c63632c0c8b516df","user":{"login":"unitedstates","id":2200203,"avatar_url":"https://avatars.githubusercontent.com/u/2200203?","gravatar_id":"13407a4bedf3a760924bb0dd57d776d0","url":"https://api.github.com/users/unitedstates","html_url":"https://github.com/unitedstates","followers_url":"https://api.github.com/users/unitedstates/followers","following_url":"https://api.github.com/users/unitedstates/following{/other_user}","gists_url":"https://api.github.com/users/unitedstates/gists{/gist_id}","starred_url":"https://api.github.com/users/unitedstates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unitedstates/subscriptions","organizations_url":"https://api.github.com/users/unitedstates/orgs","repos_url":"https://api.github.com/users/unitedstates/repos","events_url":"https://api.github.com/users/unitedstates/events{/privacy}","received_events_url":"https://api.github.com/users/unitedstates/received_events","type":"Organization","site_admin":false},"repo":{"id":4245245,"name":"citation","full_name":"unitedstates/citation","owner":{"login":"unitedstates","id":2200203,"avatar_url":"https://avatars.githubusercontent.com/u/2200203?","gravatar_id":"13407a4bedf3a760924bb0dd57d776d0","url":"https://api.github.com/users/unitedstates","html_url":"https://github.com/unitedstates","followers_url":"https://api.github.com/users/unitedstates/followers","following_url":"https://api.github.com/users/unitedstates/following{/other_user}","gists_url":"https://api.github.com/users/unitedstates/gists{/gist_id}","starred_url":"https://api.github.com/users/unitedstates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unitedstates/subscriptions","organizations_url":"https://api.github.com/users/unitedstates/orgs","repos_url":"https://api.github.com/users/unitedstates/repos","events_url":"https://api.github.com/users/unitedstates/events{/privacy}","received_events_url":"https://api.github.com/users/unitedstates/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unitedstates/citation","description":"Legal citation extractor, via command line, JavaScript, or HTTP.","fork":false,"url":"https://api.github.com/repos/unitedstates/citation","forks_url":"https://api.github.com/repos/unitedstates/citation/forks","keys_url":"https://api.github.com/repos/unitedstates/citation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unitedstates/citation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unitedstates/citation/teams","hooks_url":"https://api.github.com/repos/unitedstates/citation/hooks","issue_events_url":"https://api.github.com/repos/unitedstates/citation/issues/events{/number}","events_url":"https://api.github.com/repos/unitedstates/citation/events","assignees_url":"https://api.github.com/repos/unitedstates/citation/assignees{/user}","branches_url":"https://api.github.com/repos/unitedstates/citation/branches{/branch}","tags_url":"https://api.github.com/repos/unitedstates/citation/tags","blobs_url":"https://api.github.com/repos/unitedstates/citation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unitedstates/citation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unitedstates/citation/git/refs{/sha}","trees_url":"https://api.github.com/repos/unitedstates/citation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unitedstates/citation/statuses/{sha}","languages_url":"https://api.github.com/repos/unitedstates/citation/languages","stargazers_url":"https://api.github.com/repos/unitedstates/citation/stargazers","contributors_url":"https://api.github.com/repos/unitedstates/citation/contributors","subscribers_url":"https://api.github.com/repos/unitedstates/citation/subscribers","subscription_url":"https://api.github.com/repos/unitedstates/citation/subscription","commits_url":"https://api.github.com/repos/unitedstates/citation/commits{/sha}","git_commits_url":"https://api.github.com/repos/unitedstates/citation/git/commits{/sha}","comments_url":"https://api.github.com/repos/unitedstates/citation/comments{/number}","issue_comment_url":"https://api.github.com/repos/unitedstates/citation/issues/comments/{number}","contents_url":"https://api.github.com/repos/unitedstates/citation/contents/{+path}","compare_url":"https://api.github.com/repos/unitedstates/citation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unitedstates/citation/merges","archive_url":"https://api.github.com/repos/unitedstates/citation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unitedstates/citation/downloads","issues_url":"https://api.github.com/repos/unitedstates/citation/issues{/number}","pulls_url":"https://api.github.com/repos/unitedstates/citation/pulls{/number}","milestones_url":"https://api.github.com/repos/unitedstates/citation/milestones{/number}","notifications_url":"https://api.github.com/repos/unitedstates/citation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unitedstates/citation/labels{/name}","releases_url":"https://api.github.com/repos/unitedstates/citation/releases{/id}","created_at":"2012-05-07T00:54:49Z","updated_at":"2014-05-06T21:58:25Z","pushed_at":"2014-05-06T21:58:25Z","git_url":"git://github.com/unitedstates/citation.git","ssh_url":"git@github.com:unitedstates/citation.git","clone_url":"https://github.com/unitedstates/citation.git","svn_url":"https://github.com/unitedstates/citation","homepage":"","size":1575,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":8,"mirror_url":null,"open_issues_count":22,"forks":8,"open_issues":22,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unitedstates/citation/pulls/70"},"html":{"href":"https://github.com/unitedstates/citation/pull/70"},"issue":{"href":"https://api.github.com/repos/unitedstates/citation/issues/70"},"comments":{"href":"https://api.github.com/repos/unitedstates/citation/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/unitedstates/citation/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/unitedstates/citation/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/unitedstates/citation/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/unitedstates/citation/statuses/a72239731f0a817ec7b10fc57a2bd48daf5be2f9"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"konklone","id":4592,"avatar_url":"https://avatars.githubusercontent.com/u/4592?","gravatar_id":"ac3399caecce27cb19d381f61124539e","url":"https://api.github.com/users/konklone","html_url":"https://github.com/konklone","followers_url":"https://api.github.com/users/konklone/followers","following_url":"https://api.github.com/users/konklone/following{/other_user}","gists_url":"https://api.github.com/users/konklone/gists{/gist_id}","starred_url":"https://api.github.com/users/konklone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konklone/subscriptions","organizations_url":"https://api.github.com/users/konklone/orgs","repos_url":"https://api.github.com/users/konklone/repos","events_url":"https://api.github.com/users/konklone/events{/privacy}","received_events_url":"https://api.github.com/users/konklone/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":6,"additions":303,"deletions":2573,"changed_files":23}}