{"action":"created","comment":{"url":"https://api.github.com/repos/clulab/processors/pulls/comments/123649605","pull_request_review_id":45875303,"id":123649605,"diff_hunk":"@@ -146,20 +174,44 @@ class ArgumentPattern(\n     val label: String,\n     val pattern: DependencyPatternNode,\n     val required: Boolean,\n-    val size: Option[Int]\n+    val quantifier: Quantifier\n ) {\n   // extracts mentions and groups them according to `size`\n   def extract(tok: Int, sent: Int, doc: Document, state: State): Seq[Seq[(Mention, SynPath)]] = {\n     val matches = for {\n       (tok, path) <- pattern.findAllIn(tok, sent, doc, state)\n       m <- state.mentionsFor(sent, tok, label)\n     } yield (m, path.reverse) // paths were collected in reverse\n-    if (matches.isEmpty) Nil\n-    else if (size.isDefined) matches.combinations(size.get).toList\n-    else Seq(matches)\n+    (matches, quantifier) match {\n+      // no matches\n+      case (Nil, _) => Nil\n+      // no quantifier w/ some matches\n+      case (_, NullQuantifier) => matches.combinations(1).toList\n+      case (_, OptionalQuantifier) => Seq(matches)","path":"odin/src/main/scala/org/clulab/odin/impl/DependencyPatternCompiler.scala","position":87,"original_position":87,"commit_id":"ebd376fd6a2362c19fabb8190fb0a88dacc04d0e","original_commit_id":"ebd376fd6a2362c19fabb8190fb0a88dacc04d0e","user":{"login":"marcovzla","id":792775,"avatar_url":"https://avatars1.githubusercontent.com/u/792775?v=3","gravatar_id":"","url":"https://api.github.com/users/marcovzla","html_url":"https://github.com/marcovzla","followers_url":"https://api.github.com/users/marcovzla/followers","following_url":"https://api.github.com/users/marcovzla/following{/other_user}","gists_url":"https://api.github.com/users/marcovzla/gists{/gist_id}","starred_url":"https://api.github.com/users/marcovzla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcovzla/subscriptions","organizations_url":"https://api.github.com/users/marcovzla/orgs","repos_url":"https://api.github.com/users/marcovzla/repos","events_url":"https://api.github.com/users/marcovzla/events{/privacy}","received_events_url":"https://api.github.com/users/marcovzla/received_events","type":"User","site_admin":false},"body":"shouldn't this be `matches.combinations(1).toList`?","created_at":"2017-06-23T00:11:32Z","updated_at":"2017-06-23T00:18:20Z","html_url":"https://github.com/clulab/processors/pull/154#discussion_r123649605","pull_request_url":"https://api.github.com/repos/clulab/processors/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/clulab/processors/pulls/comments/123649605"},"html":{"href":"https://github.com/clulab/processors/pull/154#discussion_r123649605"},"pull_request":{"href":"https://api.github.com/repos/clulab/processors/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/clulab/processors/pulls/154","id":127102398,"html_url":"https://github.com/clulab/processors/pull/154","diff_url":"https://github.com/clulab/processors/pull/154.diff","patch_url":"https://github.com/clulab/processors/pull/154.patch","issue_url":"https://api.github.com/repos/clulab/processors/issues/154","number":154,"state":"open","locked":false,"title":"Ranged quantifiers for graph (dependency) pattern arguments","user":{"login":"myedibleenso","id":1137472,"avatar_url":"https://avatars1.githubusercontent.com/u/1137472?v=3","gravatar_id":"","url":"https://api.github.com/users/myedibleenso","html_url":"https://github.com/myedibleenso","followers_url":"https://api.github.com/users/myedibleenso/followers","following_url":"https://api.github.com/users/myedibleenso/following{/other_user}","gists_url":"https://api.github.com/users/myedibleenso/gists{/gist_id}","starred_url":"https://api.github.com/users/myedibleenso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myedibleenso/subscriptions","organizations_url":"https://api.github.com/users/myedibleenso/orgs","repos_url":"https://api.github.com/users/myedibleenso/repos","events_url":"https://api.github.com/users/myedibleenso/events{/privacy}","received_events_url":"https://api.github.com/users/myedibleenso/received_events","type":"User","site_admin":false},"body":"These changes resolve #148 and add support for `{s,e}`, `{,e}`, and `{s,}` ranged quantifiers to arguments in graph (dependency) patterns.  Tests are included.\r\n\r\n### `{s,e}`\r\n- The argument must be matched a minimum of `s` times and a maximum of `e` times.  If more than `e` Mentions are found to match the argument pattern, a mention for each combination of matches of size `e` will be produced.  \r\n   - `argName: ArgType{1,3} =` with **2** matches will produces **1** (event/relation) mention with **2** mentions for the argument key,`argName`.\r\n   - `argName: ArgType{1,3} =` with **1** match will produces **1** (event/relation) mention with **1** mention for the argument key,`argName`.\r\n   - `argName: ArgType{1,3} =` with **4** matches will produces **4** (event/relation) mentions each with **3** mentions for the argument key,`argName`.\r\n\r\n## `{,e}`\r\n- The argument must be matched **0** to `e` times (effectively optional).  If there are more than `e` matches for the argument pattern, a mention for each combination of matches of size `e` will be produced.\r\n\r\n## `{s,}`\r\n- The argument must be matched `s` or more times.  If there are fewer than `s` matches for the argument pattern, no mention will be produced.\r\n\r\n","created_at":"2017-06-22T22:38:10Z","updated_at":"2017-06-23T00:18:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44ca1fd02a1dc75f82fa8bb6c90d44c2355026a8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/clulab/processors/pulls/154/commits","review_comments_url":"https://api.github.com/repos/clulab/processors/pulls/154/comments","review_comment_url":"https://api.github.com/repos/clulab/processors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clulab/processors/issues/154/comments","statuses_url":"https://api.github.com/repos/clulab/processors/statuses/ebd376fd6a2362c19fabb8190fb0a88dacc04d0e","head":{"label":"clulab:odin-dep-arg-ranged-quant","ref":"odin-dep-arg-ranged-quant","sha":"ebd376fd6a2362c19fabb8190fb0a88dacc04d0e","user":{"login":"clulab","id":3707526,"avatar_url":"https://avatars1.githubusercontent.com/u/3707526?v=3","gravatar_id":"","url":"https://api.github.com/users/clulab","html_url":"https://github.com/clulab","followers_url":"https://api.github.com/users/clulab/followers","following_url":"https://api.github.com/users/clulab/following{/other_user}","gists_url":"https://api.github.com/users/clulab/gists{/gist_id}","starred_url":"https://api.github.com/users/clulab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clulab/subscriptions","organizations_url":"https://api.github.com/users/clulab/orgs","repos_url":"https://api.github.com/users/clulab/repos","events_url":"https://api.github.com/users/clulab/events{/privacy}","received_events_url":"https://api.github.com/users/clulab/received_events","type":"Organization","site_admin":false},"repo":{"id":9088826,"name":"processors","full_name":"clulab/processors","owner":{"login":"clulab","id":3707526,"avatar_url":"https://avatars1.githubusercontent.com/u/3707526?v=3","gravatar_id":"","url":"https://api.github.com/users/clulab","html_url":"https://github.com/clulab","followers_url":"https://api.github.com/users/clulab/followers","following_url":"https://api.github.com/users/clulab/following{/other_user}","gists_url":"https://api.github.com/users/clulab/gists{/gist_id}","starred_url":"https://api.github.com/users/clulab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clulab/subscriptions","organizations_url":"https://api.github.com/users/clulab/orgs","repos_url":"https://api.github.com/users/clulab/repos","events_url":"https://api.github.com/users/clulab/events{/privacy}","received_events_url":"https://api.github.com/users/clulab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clulab/processors","description":"Natural Language Processors","fork":false,"url":"https://api.github.com/repos/clulab/processors","forks_url":"https://api.github.com/repos/clulab/processors/forks","keys_url":"https://api.github.com/repos/clulab/processors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clulab/processors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clulab/processors/teams","hooks_url":"https://api.github.com/repos/clulab/processors/hooks","issue_events_url":"https://api.github.com/repos/clulab/processors/issues/events{/number}","events_url":"https://api.github.com/repos/clulab/processors/events","assignees_url":"https://api.github.com/repos/clulab/processors/assignees{/user}","branches_url":"https://api.github.com/repos/clulab/processors/branches{/branch}","tags_url":"https://api.github.com/repos/clulab/processors/tags","blobs_url":"https://api.github.com/repos/clulab/processors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clulab/processors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clulab/processors/git/refs{/sha}","trees_url":"https://api.github.com/repos/clulab/processors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clulab/processors/statuses/{sha}","languages_url":"https://api.github.com/repos/clulab/processors/languages","stargazers_url":"https://api.github.com/repos/clulab/processors/stargazers","contributors_url":"https://api.github.com/repos/clulab/processors/contributors","subscribers_url":"https://api.github.com/repos/clulab/processors/subscribers","subscription_url":"https://api.github.com/repos/clulab/processors/subscription","commits_url":"https://api.github.com/repos/clulab/processors/commits{/sha}","git_commits_url":"https://api.github.com/repos/clulab/processors/git/commits{/sha}","comments_url":"https://api.github.com/repos/clulab/processors/comments{/number}","issue_comment_url":"https://api.github.com/repos/clulab/processors/issues/comments{/number}","contents_url":"https://api.github.com/repos/clulab/processors/contents/{+path}","compare_url":"https://api.github.com/repos/clulab/processors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clulab/processors/merges","archive_url":"https://api.github.com/repos/clulab/processors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clulab/processors/downloads","issues_url":"https://api.github.com/repos/clulab/processors/issues{/number}","pulls_url":"https://api.github.com/repos/clulab/processors/pulls{/number}","milestones_url":"https://api.github.com/repos/clulab/processors/milestones{/number}","notifications_url":"https://api.github.com/repos/clulab/processors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clulab/processors/labels{/name}","releases_url":"https://api.github.com/repos/clulab/processors/releases{/id}","deployments_url":"https://api.github.com/repos/clulab/processors/deployments","created_at":"2013-03-28T23:48:12Z","updated_at":"2017-06-10T12:02:49Z","pushed_at":"2017-06-22T22:38:10Z","git_url":"git://github.com/clulab/processors.git","ssh_url":"git@github.com:clulab/processors.git","clone_url":"https://github.com/clulab/processors.git","svn_url":"https://github.com/clulab/processors","homepage":null,"size":955634,"stargazers_count":251,"watchers_count":251,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":16,"forks":63,"open_issues":16,"watchers":251,"default_branch":"master"}},"base":{"label":"clulab:master","ref":"master","sha":"93f4e18bd899272aa9f65402241bcbc09292debe","user":{"login":"clulab","id":3707526,"avatar_url":"https://avatars1.githubusercontent.com/u/3707526?v=3","gravatar_id":"","url":"https://api.github.com/users/clulab","html_url":"https://github.com/clulab","followers_url":"https://api.github.com/users/clulab/followers","following_url":"https://api.github.com/users/clulab/following{/other_user}","gists_url":"https://api.github.com/users/clulab/gists{/gist_id}","starred_url":"https://api.github.com/users/clulab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clulab/subscriptions","organizations_url":"https://api.github.com/users/clulab/orgs","repos_url":"https://api.github.com/users/clulab/repos","events_url":"https://api.github.com/users/clulab/events{/privacy}","received_events_url":"https://api.github.com/users/clulab/received_events","type":"Organization","site_admin":false},"repo":{"id":9088826,"name":"processors","full_name":"clulab/processors","owner":{"login":"clulab","id":3707526,"avatar_url":"https://avatars1.githubusercontent.com/u/3707526?v=3","gravatar_id":"","url":"https://api.github.com/users/clulab","html_url":"https://github.com/clulab","followers_url":"https://api.github.com/users/clulab/followers","following_url":"https://api.github.com/users/clulab/following{/other_user}","gists_url":"https://api.github.com/users/clulab/gists{/gist_id}","starred_url":"https://api.github.com/users/clulab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clulab/subscriptions","organizations_url":"https://api.github.com/users/clulab/orgs","repos_url":"https://api.github.com/users/clulab/repos","events_url":"https://api.github.com/users/clulab/events{/privacy}","received_events_url":"https://api.github.com/users/clulab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clulab/processors","description":"Natural Language Processors","fork":false,"url":"https://api.github.com/repos/clulab/processors","forks_url":"https://api.github.com/repos/clulab/processors/forks","keys_url":"https://api.github.com/repos/clulab/processors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clulab/processors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clulab/processors/teams","hooks_url":"https://api.github.com/repos/clulab/processors/hooks","issue_events_url":"https://api.github.com/repos/clulab/processors/issues/events{/number}","events_url":"https://api.github.com/repos/clulab/processors/events","assignees_url":"https://api.github.com/repos/clulab/processors/assignees{/user}","branches_url":"https://api.github.com/repos/clulab/processors/branches{/branch}","tags_url":"https://api.github.com/repos/clulab/processors/tags","blobs_url":"https://api.github.com/repos/clulab/processors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clulab/processors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clulab/processors/git/refs{/sha}","trees_url":"https://api.github.com/repos/clulab/processors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clulab/processors/statuses/{sha}","languages_url":"https://api.github.com/repos/clulab/processors/languages","stargazers_url":"https://api.github.com/repos/clulab/processors/stargazers","contributors_url":"https://api.github.com/repos/clulab/processors/contributors","subscribers_url":"https://api.github.com/repos/clulab/processors/subscribers","subscription_url":"https://api.github.com/repos/clulab/processors/subscription","commits_url":"https://api.github.com/repos/clulab/processors/commits{/sha}","git_commits_url":"https://api.github.com/repos/clulab/processors/git/commits{/sha}","comments_url":"https://api.github.com/repos/clulab/processors/comments{/number}","issue_comment_url":"https://api.github.com/repos/clulab/processors/issues/comments{/number}","contents_url":"https://api.github.com/repos/clulab/processors/contents/{+path}","compare_url":"https://api.github.com/repos/clulab/processors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clulab/processors/merges","archive_url":"https://api.github.com/repos/clulab/processors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clulab/processors/downloads","issues_url":"https://api.github.com/repos/clulab/processors/issues{/number}","pulls_url":"https://api.github.com/repos/clulab/processors/pulls{/number}","milestones_url":"https://api.github.com/repos/clulab/processors/milestones{/number}","notifications_url":"https://api.github.com/repos/clulab/processors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clulab/processors/labels{/name}","releases_url":"https://api.github.com/repos/clulab/processors/releases{/id}","deployments_url":"https://api.github.com/repos/clulab/processors/deployments","created_at":"2013-03-28T23:48:12Z","updated_at":"2017-06-10T12:02:49Z","pushed_at":"2017-06-22T22:38:10Z","git_url":"git://github.com/clulab/processors.git","ssh_url":"git@github.com:clulab/processors.git","clone_url":"https://github.com/clulab/processors.git","svn_url":"https://github.com/clulab/processors","homepage":null,"size":955634,"stargazers_count":251,"watchers_count":251,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":16,"forks":63,"open_issues":16,"watchers":251,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clulab/processors/pulls/154"},"html":{"href":"https://github.com/clulab/processors/pull/154"},"issue":{"href":"https://api.github.com/repos/clulab/processors/issues/154"},"comments":{"href":"https://api.github.com/repos/clulab/processors/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/clulab/processors/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/clulab/processors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clulab/processors/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/clulab/processors/statuses/ebd376fd6a2362c19fabb8190fb0a88dacc04d0e"}}}}
{"actor":{"display_login":"marcovzla"}}