{"action":"created","comment":{"url":"https://api.github.com/repos/TextDB/textdb/pulls/comments/61479926","id":61479926,"diff_hunk":"@@ -13,153 +14,243 @@\n import org.junit.Assert;\n import org.junit.Before;\n import org.junit.Test;\n-\n import edu.uci.ics.textdb.api.common.Attribute;\n import edu.uci.ics.textdb.api.common.IDictionary;\n+import edu.uci.ics.textdb.api.common.IField;\n import edu.uci.ics.textdb.api.common.ITuple;\n import edu.uci.ics.textdb.api.dataflow.ISourceOperator;\n import edu.uci.ics.textdb.api.storage.IDataReader;\n import edu.uci.ics.textdb.api.storage.IDataWriter;\n import edu.uci.ics.textdb.common.constants.LuceneConstants;\n+import edu.uci.ics.textdb.common.constants.SchemaConstants;\n import edu.uci.ics.textdb.common.constants.TestConstants;\n+import edu.uci.ics.textdb.common.field.DataTuple;\n+import edu.uci.ics.textdb.common.field.DateField;\n+import edu.uci.ics.textdb.common.field.DoubleField;\n+import edu.uci.ics.textdb.common.field.IntegerField;\n+import edu.uci.ics.textdb.common.field.ListField;\n+import edu.uci.ics.textdb.common.field.Span;\n+import edu.uci.ics.textdb.common.field.StringField;\n+import edu.uci.ics.textdb.common.field.TextField;\n import edu.uci.ics.textdb.dataflow.source.ScanBasedSourceOperator;\n import edu.uci.ics.textdb.dataflow.utils.TestUtils;\n import edu.uci.ics.textdb.storage.LuceneDataStore;\n import edu.uci.ics.textdb.storage.reader.LuceneDataReader;\n import edu.uci.ics.textdb.storage.writer.LuceneDataWriter;\n \n /**\n- * @author Sudeep [inkudo] and Rajesh [rajesh9625]\n+ * @author rajeshyarlagadda\n  *\n  */\n public class DictionaryMatcherTest {\n \n-    private DictionaryMatcher dictionaryMatcher;\n-    private LuceneDataStore dataStore;\n-    private IDataWriter dataWriter;\n-    private IDataReader dataReader;\n-    private Analyzer analyzer;\n-    private Query query;\n-\n-    @Before\n-    public void setUp() throws Exception {\n-\n-        dataStore = new LuceneDataStore(LuceneConstants.INDEX_DIR, TestConstants.SCHEMA_PEOPLE);\n-        analyzer = new  StandardAnalyzer();\n-        dataWriter = new LuceneDataWriter(dataStore, analyzer );\n-        QueryParser queryParser = new QueryParser(\n-                TestConstants.ATTRIBUTES_PEOPLE.get(0).getFieldName(), analyzer);\n-        query = queryParser.parse(LuceneConstants.SCAN_QUERY);\n-        dataReader = new LuceneDataReader(dataStore, query);\n-        dataWriter.clearData();\n-        dataWriter.writeData(TestConstants.getSamplePeopleTuples());\n-\n-    }\n-\n-    @After\n-    public void cleanUp() throws Exception {\n-        dataWriter.clearData();\n-    }\n-\n-    /**\n-     * Scenario S1:verifies GetNextTuple of Dictionary\n-     */\n-\n-    @Test\n-    public void testGetNextDictionaryItem() throws Exception {\n-\n-        ArrayList<String> names = new ArrayList<String>(Arrays.asList(\"brad cooper\", \"clooney\", \"george\", \"lee\"));\n-        IDictionary dictionary = new Dictionary(names);\n-        int numTuples = 0;\n-        String dictionaryItem;\n-        while ((dictionaryItem = dictionary.getNextValue()) != null) {\n-            boolean contains = TestUtils.contains(names, dictionaryItem);\n-            Assert.assertTrue(contains);\n-            numTuples++;\n-        }\n-        Assert.assertEquals(4, numTuples);\n-\n-    }\n-\n-    /**\n-     * Scenario S2:verifies GetNextTuple of DictionaryMatcher and single word\n-     * queries\n-     */\n-\n-    @Test\n-    public void testGetNextTuple() throws Exception {\n-\n-        ArrayList<String> names = new ArrayList<String>(Arrays.asList(\"bruce\",\"cena\",\"lin\",\"george\"));\n-        IDictionary dictionary = new Dictionary(names);\n-        ISourceOperator sourceOperator = new ScanBasedSourceOperator(dataReader);\n-        List<ITuple> data = TestConstants.getSamplePeopleTuples();\n-        List<Attribute> attributes = TestConstants.ATTRIBUTES_PEOPLE;\n-        dictionaryMatcher = new DictionaryMatcher(dictionary, sourceOperator);\n-        dictionaryMatcher.open();\n-        ITuple iTuple;\n-        int numTuples=0;\n-        while ((iTuple = dictionaryMatcher.getNextTuple()) != null) {\n-            \n-            boolean contains = TestUtils.checkSpan(data, iTuple, attributes);\n-            Assert.assertTrue(contains);\n-            numTuples++;\n+\tprivate DictionaryMatcher dictionaryMatcher;\n+\tprivate LuceneDataStore dataStore;\n+\tprivate IDataWriter dataWriter;\n+\tprivate IDataReader dataReader;\n+\tprivate Analyzer analyzer;\n+\tprivate Query query;\n+\n+\t@Before\n+\tpublic void setUp() throws Exception {\n+\n+\t\tdataStore = new LuceneDataStore(LuceneConstants.INDEX_DIR, TestConstants.SCHEMA_PEOPLE);\n+\t\tanalyzer = new StandardAnalyzer();\n+\t\tdataWriter = new LuceneDataWriter(dataStore, analyzer);\n+\t\tQueryParser queryParser = new QueryParser(TestConstants.ATTRIBUTES_PEOPLE[0].getFieldName(), analyzer);\n+\t\tquery = queryParser.parse(LuceneConstants.SCAN_QUERY);\n+\t\tdataReader = new LuceneDataReader(dataStore, query);\n+\t\tdataWriter.clearData();\n+\t\tdataWriter.writeData(TestConstants.getSamplePeopleTuples());\n+\n+\t}\n+\n+\t@After\n+\tpublic void cleanUp() throws Exception {\n+\t\tdataWriter.clearData();\n+\t}\n+\n+\tpublic List<ITuple> getQueryResults(IDictionary dictionary, ISourceOperator sourceOperator, List<Attribute> attributes) throws Exception {\n+\n+\t\tdictionaryMatcher = new DictionaryMatcher(dictionary, sourceOperator, attributes);\n+\t\tdictionaryMatcher.open();\n+\t\tITuple nextTuple = null;\n+\t\tList<ITuple> results = new ArrayList<ITuple>();\n+\t\twhile ((nextTuple = dictionaryMatcher.getNextTuple()) != null) {\n+\t\t\tresults.add(nextTuple);\n+\t\t}\n+\t\tdictionaryMatcher.close();\n+\t\treturn results;\n+\t}\n+\n+\t/**\n+\t * Scenario S1:verifies GetNextTuple of Dictionary\n+\t */\n+\n+\t@Test\n+\tpublic void testGetNextOfDictionaryItem() throws Exception {\n+\n+\t\tArrayList<String> names = new ArrayList<String>(Arrays.asList(\"george\", \"lee\"));\n+\t\tIDictionary dictionary = new Dictionary(names);\n+\t\tint numTuples = 0;\n+\t\tString dictionaryItem;\n+\t\twhile ((dictionaryItem = dictionary.getNextValue()) != null) {\n+\t\t\tboolean contains = TestUtils.contains(names, dictionaryItem);\n+\t\t\tAssert.assertTrue(contains);\n+\t\t\tnumTuples++;\n+\t\t}\n+\t\tAssert.assertEquals(2, numTuples);","path":"textdb/textdb-dataflow/src/test/java/edu/uci/ics/textdb/dataflow/dictionarymatcher/DictionaryMatcherTest.java","position":null,"original_position":173,"commit_id":"ecc284c499488d221326b90c163b3a96ca4034de","original_commit_id":"e231a7e0234fc1c5a483a0d860bb28971601f06a","user":{"login":"rajesh9625","id":15056428,"avatar_url":"https://avatars.githubusercontent.com/u/15056428?v=3","gravatar_id":"","url":"https://api.github.com/users/rajesh9625","html_url":"https://github.com/rajesh9625","followers_url":"https://api.github.com/users/rajesh9625/followers","following_url":"https://api.github.com/users/rajesh9625/following{/other_user}","gists_url":"https://api.github.com/users/rajesh9625/gists{/gist_id}","starred_url":"https://api.github.com/users/rajesh9625/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajesh9625/subscriptions","organizations_url":"https://api.github.com/users/rajesh9625/orgs","repos_url":"https://api.github.com/users/rajesh9625/repos","events_url":"https://api.github.com/users/rajesh9625/events{/privacy}","received_events_url":"https://api.github.com/users/rajesh9625/received_events","type":"User","site_admin":false},"body":"Made required changes for this, Using \"containsAllResults()\" for all the test cases in DictionaryMatcherTest.java","created_at":"2016-04-28T18:36:44Z","updated_at":"2016-04-28T18:36:44Z","html_url":"https://github.com/TextDB/textdb/pull/80#discussion_r61479926","pull_request_url":"https://api.github.com/repos/TextDB/textdb/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/comments/61479926"},"html":{"href":"https://github.com/TextDB/textdb/pull/80#discussion_r61479926"},"pull_request":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/TextDB/textdb/pulls/80","id":68176023,"html_url":"https://github.com/TextDB/textdb/pull/80","diff_url":"https://github.com/TextDB/textdb/pull/80.diff","patch_url":"https://github.com/TextDB/textdb/pull/80.patch","issue_url":"https://api.github.com/repos/TextDB/textdb/issues/80","number":80,"state":"open","locked":false,"title":"[Issue #79] Refactored Dictionary Matcher","user":{"login":"inkudo","id":18095598,"avatar_url":"https://avatars.githubusercontent.com/u/18095598?v=3","gravatar_id":"","url":"https://api.github.com/users/inkudo","html_url":"https://github.com/inkudo","followers_url":"https://api.github.com/users/inkudo/followers","following_url":"https://api.github.com/users/inkudo/following{/other_user}","gists_url":"https://api.github.com/users/inkudo/gists{/gist_id}","starred_url":"https://api.github.com/users/inkudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inkudo/subscriptions","organizations_url":"https://api.github.com/users/inkudo/orgs","repos_url":"https://api.github.com/users/inkudo/repos","events_url":"https://api.github.com/users/inkudo/events{/privacy}","received_events_url":"https://api.github.com/users/inkudo/received_events","type":"User","site_admin":false},"body":"1. Added list of attributes as a parameter to dictionary matcher constructor. Only checking in this list of attributes.\r\n2. Added SpanList. Only one tuple per document is returned with getNextTuple() even if there are multiple matches.\r\n3. Word boundary is checked using Java regex (need opinion on this)\r\n\r\n@chenlica @JavierJia .. Please review the changes","created_at":"2016-04-28T07:34:40Z","updated_at":"2016-04-28T18:36:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cc638a416630915269f6dc7f5d05381e17cf659","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TextDB/textdb/pulls/80/commits","review_comments_url":"https://api.github.com/repos/TextDB/textdb/pulls/80/comments","review_comment_url":"https://api.github.com/repos/TextDB/textdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TextDB/textdb/issues/80/comments","statuses_url":"https://api.github.com/repos/TextDB/textdb/statuses/ecc284c499488d221326b90c163b3a96ca4034de","head":{"label":"TextDB:team1-refactor-dictionary-matcher","ref":"team1-refactor-dictionary-matcher","sha":"ecc284c499488d221326b90c163b3a96ca4034de","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-04-06T19:07:11Z","pushed_at":"2016-04-28T18:33:10Z","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":13212,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":12,"forks":2,"open_issues":12,"watchers":7,"default_branch":"master"}},"base":{"label":"TextDB:master","ref":"master","sha":"dcdfef471fcdcc69f6682d00e2c530dbceff5121","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-04-06T19:07:11Z","pushed_at":"2016-04-28T18:33:10Z","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":13212,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":12,"forks":2,"open_issues":12,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/80"},"html":{"href":"https://github.com/TextDB/textdb/pull/80"},"issue":{"href":"https://api.github.com/repos/TextDB/textdb/issues/80"},"comments":{"href":"https://api.github.com/repos/TextDB/textdb/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TextDB/textdb/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/TextDB/textdb/statuses/ecc284c499488d221326b90c163b3a96ca4034de"}}}}