{"action":"created","comment":{"url":"https://api.github.com/repos/TextDB/textdb/pulls/comments/63267894","id":63267894,"diff_hunk":"@@ -0,0 +1,172 @@\n+package edu.uci.ics.textdb.dataflow.regexmatch;\n+\n+import java.util.ArrayList;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Set;\n+import java.util.StringJoiner;\n+\n+import edu.uci.ics.textdb.common.constants.DataConstants;\n+\n+/**\n+ * \n+ * Trigram Query of OR and AND\n+ * \n+ * {@code operandList} is a list of literals (strings) in this query.\n+ * {@code subQueryList} is a list of parenthesized RegexTrigramQuery.\n+ * {@code operator} is the operator connecting each literals in {@code operandList} and each subqueries in {@code subqueryList};\n+ * For example, RegexTrigramQuery for regex \"data(abc|bcd)\" is \"dat AND ata AND (abc OR bcd)\"\n+ * The operand of this query is AND\n+ * operands = [\"dat\", \"ata\"]\n+ * subQueries = [\"abc OR bcd\"]\n+ * \n+ * The trigram query of a regex has two high-level layers:\n+ * First, conjunction of TrigramBooleanQuery of prefix, suffix, and exact.\n+ * Second, disjunction of TrigramBooleanQuery of each element respectively in prefix, suffix, and exact.\n+ * \n+ * @Author Zuozhi Wang\n+ * @Author Shuying Lai\n+ * \n+ */\n+public class TrigramBooleanQuery {\n+\tpublic static final int NONE = 0;\n+\tpublic static final int ANY  = 1;\n+\tpublic static final int AND  = 2;\n+\tpublic static final int OR   = 3;\n+\t\n+\t/**\n+\t * operator is NONE/ALL/AND/OR\n+\t */\n+\tint operator;\n+\tList<String> operandList;","path":"textdb/textdb-dataflow/src/main/java/edu/uci/ics/textdb/dataflow/regexmatch/TrigramBooleanQuery.java","position":41,"original_position":41,"commit_id":"d1117dacac05aec0fae323bd1cac5824d84b6706","original_commit_id":"d1117dacac05aec0fae323bd1cac5824d84b6706","user":{"login":"zuozhi","id":12578068,"avatar_url":"https://avatars.githubusercontent.com/u/12578068?v=3","gravatar_id":"","url":"https://api.github.com/users/zuozhi","html_url":"https://github.com/zuozhi","followers_url":"https://api.github.com/users/zuozhi/followers","following_url":"https://api.github.com/users/zuozhi/following{/other_user}","gists_url":"https://api.github.com/users/zuozhi/gists{/gist_id}","starred_url":"https://api.github.com/users/zuozhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuozhi/subscriptions","organizations_url":"https://api.github.com/users/zuozhi/orgs","repos_url":"https://api.github.com/users/zuozhi/repos","events_url":"https://api.github.com/users/zuozhi/events{/privacy}","received_events_url":"https://api.github.com/users/zuozhi/received_events","type":"User","site_admin":false},"body":"Shuying and I also discussed a lot about it. I have to admit that I wrote it this way in the first place because the original code is written this way. \r\nIn a expression tree like this, a node can either be a \"leaf\" or a \"parent\". In a \"leaf\", only the trigram string matters. In a \"parent\" operator and sub-expressions matter. So there some sort of distinction. One advantage of the current representation is that it explicitly says that trigrams can only be found at the \"operands\" list. In the representation you said, we have to addtionally check if the current node is a \"leaf\" or not. But I think either way is fine.","created_at":"2016-05-14T00:45:57Z","updated_at":"2016-05-14T00:45:57Z","html_url":"https://github.com/TextDB/textdb/pull/100#discussion_r63267894","pull_request_url":"https://api.github.com/repos/TextDB/textdb/pulls/100","_links":{"self":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/comments/63267894"},"html":{"href":"https://github.com/TextDB/textdb/pull/100#discussion_r63267894"},"pull_request":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/TextDB/textdb/pulls/100","id":70069778,"html_url":"https://github.com/TextDB/textdb/pull/100","diff_url":"https://github.com/TextDB/textdb/pull/100.diff","patch_url":"https://github.com/TextDB/textdb/pull/100.patch","issue_url":"https://api.github.com/repos/TextDB/textdb/issues/100","number":100,"state":"open","locked":false,"title":"[Issue #30 #99] Team3 regex trigram","user":{"login":"zuozhi","id":12578068,"avatar_url":"https://avatars.githubusercontent.com/u/12578068?v=3","gravatar_id":"","url":"https://api.github.com/users/zuozhi","html_url":"https://github.com/zuozhi","followers_url":"https://api.github.com/users/zuozhi/followers","following_url":"https://api.github.com/users/zuozhi/following{/other_user}","gists_url":"https://api.github.com/users/zuozhi/gists{/gist_id}","starred_url":"https://api.github.com/users/zuozhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuozhi/subscriptions","organizations_url":"https://api.github.com/users/zuozhi/orgs","repos_url":"https://api.github.com/users/zuozhi/repos","events_url":"https://api.github.com/users/zuozhi/events{/privacy}","received_events_url":"https://api.github.com/users/zuozhi/received_events","type":"User","site_admin":false},"body":"An initial skeleton of our translator, including:\r\nRegexToTrigram.java, the main translator program\r\nRegexInfo.java, a class containing info about emptyable, prefix, suffix, exact and match\r\nTrigramBooleanQuery.java, which represents the boolean query tree \r\nand a few initial test cases.\r\n\r\n@chenlica ","created_at":"2016-05-13T22:58:11Z","updated_at":"2016-05-14T00:45:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d6c7e7dd170c468551a00459dacbd544aa8ff18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TextDB/textdb/pulls/100/commits","review_comments_url":"https://api.github.com/repos/TextDB/textdb/pulls/100/comments","review_comment_url":"https://api.github.com/repos/TextDB/textdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TextDB/textdb/issues/100/comments","statuses_url":"https://api.github.com/repos/TextDB/textdb/statuses/d1117dacac05aec0fae323bd1cac5824d84b6706","head":{"label":"TextDB:team3-regex-trigram","ref":"team3-regex-trigram","sha":"d1117dacac05aec0fae323bd1cac5824d84b6706","user":{"login":"TextDB","id":18126950,"avatar_url":"https://avatars.githubusercontent.com/u/18126950?v=3","gravatar_id":"","url":"https://api.github.com/users/TextDB","html_url":"https://github.com/TextDB","followers_url":"https://api.github.com/users/TextDB/followers","following_url":"https://api.github.com/users/TextDB/following{/other_user}","gists_url":"https://api.github.com/users/TextDB/gists{/gist_id}","starred_url":"https://api.github.com/users/TextDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TextDB/subscriptions","organizations_url":"https://api.github.com/users/TextDB/orgs","repos_url":"https://api.github.com/users/TextDB/repos","events_url":"https://api.github.com/users/TextDB/events{/privacy}","received_events_url":"https://api.github.com/users/TextDB/received_events","type":"Organization","site_admin":false},"repo":{"id":53976910,"name":"textdb","full_name":"TextDB/textdb","owner":{"login":"TextDB","id":18126950,"avatar_url":"https://avatars.githubusercontent.com/u/18126950?v=3","gravatar_id":"","url":"https://api.github.com/users/TextDB","html_url":"https://github.com/TextDB","followers_url":"https://api.github.com/users/TextDB/followers","following_url":"https://api.github.com/users/TextDB/following{/other_user}","gists_url":"https://api.github.com/users/TextDB/gists{/gist_id}","starred_url":"https://api.github.com/users/TextDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TextDB/subscriptions","organizations_url":"https://api.github.com/users/TextDB/orgs","repos_url":"https://api.github.com/users/TextDB/repos","events_url":"https://api.github.com/users/TextDB/events{/privacy}","received_events_url":"https://api.github.com/users/TextDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TextDB/textdb","description":"Text-centric data management system","fork":false,"url":"https://api.github.com/repos/TextDB/textdb","forks_url":"https://api.github.com/repos/TextDB/textdb/forks","keys_url":"https://api.github.com/repos/TextDB/textdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TextDB/textdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TextDB/textdb/teams","hooks_url":"https://api.github.com/repos/TextDB/textdb/hooks","issue_events_url":"https://api.github.com/repos/TextDB/textdb/issues/events{/number}","events_url":"https://api.github.com/repos/TextDB/textdb/events","assignees_url":"https://api.github.com/repos/TextDB/textdb/assignees{/user}","branches_url":"https://api.github.com/repos/TextDB/textdb/branches{/branch}","tags_url":"https://api.github.com/repos/TextDB/textdb/tags","blobs_url":"https://api.github.com/repos/TextDB/textdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TextDB/textdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TextDB/textdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/TextDB/textdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TextDB/textdb/statuses/{sha}","languages_url":"https://api.github.com/repos/TextDB/textdb/languages","stargazers_url":"https://api.github.com/repos/TextDB/textdb/stargazers","contributors_url":"https://api.github.com/repos/TextDB/textdb/contributors","subscribers_url":"https://api.github.com/repos/TextDB/textdb/subscribers","subscription_url":"https://api.github.com/repos/TextDB/textdb/subscription","commits_url":"https://api.github.com/repos/TextDB/textdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/TextDB/textdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/TextDB/textdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/TextDB/textdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/TextDB/textdb/contents/{+path}","compare_url":"https://api.github.com/repos/TextDB/textdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TextDB/textdb/merges","archive_url":"https://api.github.com/repos/TextDB/textdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TextDB/textdb/downloads","issues_url":"https://api.github.com/repos/TextDB/textdb/issues{/number}","pulls_url":"https://api.github.com/repos/TextDB/textdb/pulls{/number}","milestones_url":"https://api.github.com/repos/TextDB/textdb/milestones{/number}","notifications_url":"https://api.github.com/repos/TextDB/textdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TextDB/textdb/labels{/name}","releases_url":"https://api.github.com/repos/TextDB/textdb/releases{/id}","deployments_url":"https://api.github.com/repos/TextDB/textdb/deployments","created_at":"2016-03-15T20:38:46Z","updated_at":"2016-05-09T15:33:04Z","pushed_at":"2016-05-13T23:48:58Z","git_url":"git://github.com/TextDB/textdb.git","ssh_url":"git@github.com:TextDB/textdb.git","clone_url":"https://github.com/TextDB/textdb.git","svn_url":"https://github.com/TextDB/textdb","homepage":null,"size":13881,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":8,"default_branch":"master"}},"base":{"label":"TextDB:master","ref":"master","sha":"0d4782fab1e641761e8f7a864c134606ee18e6b1","user":{"login":"TextDB","id":18126950,"avatar_url":"https://avatars.githubusercontent.com/u/18126950?v=3","gravatar_id":"","url":"https://api.github.com/users/TextDB","html_url":"https://github.com/TextDB","followers_url":"https://api.github.com/users/TextDB/followers","following_url":"https://api.github.com/users/TextDB/following{/other_user}","gists_url":"https://api.github.com/users/TextDB/gists{/gist_id}","starred_url":"https://api.github.com/users/TextDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TextDB/subscriptions","organizations_url":"https://api.github.com/users/TextDB/orgs","repos_url":"https://api.github.com/users/TextDB/repos","events_url":"https://api.github.com/users/TextDB/events{/privacy}","received_events_url":"https://api.github.com/users/TextDB/received_events","type":"Organization","site_admin":false},"repo":{"id":53976910,"name":"textdb","full_name":"TextDB/textdb","owner":{"login":"TextDB","id":18126950,"avatar_url":"https://avatars.githubusercontent.com/u/18126950?v=3","gravatar_id":"","url":"https://api.github.com/users/TextDB","html_url":"https://github.com/TextDB","followers_url":"https://api.github.com/users/TextDB/followers","following_url":"https://api.github.com/users/TextDB/following{/other_user}","gists_url":"https://api.github.com/users/TextDB/gists{/gist_id}","starred_url":"https://api.github.com/users/TextDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TextDB/subscriptions","organizations_url":"https://api.github.com/users/TextDB/orgs","repos_url":"https://api.github.com/users/TextDB/repos","events_url":"https://api.github.com/users/TextDB/events{/privacy}","received_events_url":"https://api.github.com/users/TextDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TextDB/textdb","description":"Text-centric data management system","fork":false,"url":"https://api.github.com/repos/TextDB/textdb","forks_url":"https://api.github.com/repos/TextDB/textdb/forks","keys_url":"https://api.github.com/repos/TextDB/textdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TextDB/textdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TextDB/textdb/teams","hooks_url":"https://api.github.com/repos/TextDB/textdb/hooks","issue_events_url":"https://api.github.com/repos/TextDB/textdb/issues/events{/number}","events_url":"https://api.github.com/repos/TextDB/textdb/events","assignees_url":"https://api.github.com/repos/TextDB/textdb/assignees{/user}","branches_url":"https://api.github.com/repos/TextDB/textdb/branches{/branch}","tags_url":"https://api.github.com/repos/TextDB/textdb/tags","blobs_url":"https://api.github.com/repos/TextDB/textdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TextDB/textdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TextDB/textdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/TextDB/textdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TextDB/textdb/statuses/{sha}","languages_url":"https://api.github.com/repos/TextDB/textdb/languages","stargazers_url":"https://api.github.com/repos/TextDB/textdb/stargazers","contributors_url":"https://api.github.com/repos/TextDB/textdb/contributors","subscribers_url":"https://api.github.com/repos/TextDB/textdb/subscribers","subscription_url":"https://api.github.com/repos/TextDB/textdb/subscription","commits_url":"https://api.github.com/repos/TextDB/textdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/TextDB/textdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/TextDB/textdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/TextDB/textdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/TextDB/textdb/contents/{+path}","compare_url":"https://api.github.com/repos/TextDB/textdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TextDB/textdb/merges","archive_url":"https://api.github.com/repos/TextDB/textdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TextDB/textdb/downloads","issues_url":"https://api.github.com/repos/TextDB/textdb/issues{/number}","pulls_url":"https://api.github.com/repos/TextDB/textdb/pulls{/number}","milestones_url":"https://api.github.com/repos/TextDB/textdb/milestones{/number}","notifications_url":"https://api.github.com/repos/TextDB/textdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TextDB/textdb/labels{/name}","releases_url":"https://api.github.com/repos/TextDB/textdb/releases{/id}","deployments_url":"https://api.github.com/repos/TextDB/textdb/deployments","created_at":"2016-03-15T20:38:46Z","updated_at":"2016-05-09T15:33:04Z","pushed_at":"2016-05-13T23:48:58Z","git_url":"git://github.com/TextDB/textdb.git","ssh_url":"git@github.com:TextDB/textdb.git","clone_url":"https://github.com/TextDB/textdb.git","svn_url":"https://github.com/TextDB/textdb","homepage":null,"size":13881,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/100"},"html":{"href":"https://github.com/TextDB/textdb/pull/100"},"issue":{"href":"https://api.github.com/repos/TextDB/textdb/issues/100"},"comments":{"href":"https://api.github.com/repos/TextDB/textdb/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/TextDB/textdb/statuses/d1117dacac05aec0fae323bd1cac5824d84b6706"}}}}