use of main.database.TableTuple in project Info-Evaluation by TechnionYP5777.
the class DataListTest method test2.
@Test
public void test2() {
final TableTuple tup = new TableTuple("Charlie Sheen", "02/12/2016", "arrest on domestic violence charges");
final DataList dl = new DataList();
dl.insert("Justin Bieber", "23/01/2015", "drunk driving");
assertEquals(1, dl.getNumOfTuples());
dl.insert(tup);
assertEquals(2, dl.getNumOfTuples());
}
use of main.database.TableTuple in project Info-Evaluation by TechnionYP5777.
the class AnalyzeSourcesTest method testAddSourceFile.
@Test
public void testAddSourceFile() {
boolean check = false;
final AnalyzeSources as = new AnalyzeSources();
try {
as.addSourceFile((Resources.getResource("text3.txt") + "").replace("file:", ""));
} catch (Exception e) {
check = true;
}
assert check;
try {
as.addSourceFile((Resources.getResource("text1.txt") + "").replace("file:", ""), "2013");
ArrayList<TableTuple> details = as.getData().getList();
assert "Tito Ortiz".equals(details.get(0).getName());
assert "01/06/2013".equals(details.get(0).getDate());
assert "driving under influence".equals(details.get(0).getReason());
as.addSourceFile((Resources.getResource("text2.txt") + "").replace("file:", ""));
details = as.getData().getList();
assert "Mark Salling".equals(details.get(3).getName());
assert "12/29/2016".equals(details.get(3).getDate());
assert "possession of pornography".equals(details.get(3).getReason());
} catch (IOException e) {
fail();
}
}
use of main.database.TableTuple in project Info-Evaluation by TechnionYP5777.
the class GetCategoryTest method init.
@Before
public void init() throws Exception {
clearDB();
DataList lin = new DataList();
TableTuple t1 = new TableTuple("Austin Chumlee Russell", "01/09/2014", "driving without a licesnce");
t1.addKeyWord("driving license");
TableTuple t2 = new TableTuple("Austin Chumlee Russell", "01/09/2014", "driving without a licesnce");
t2.addKeyWord("driving license");
TableTuple t3 = new TableTuple("Chris Kattan", "02/10/2015", "attacking wife");
t3.addKeyWord("attacking");
TableTuple t4 = new TableTuple("Hugh Jackman", "02/12/2015", "drunk driving");
t4.addKeyWord("drunk driving");
TableTuple t5 = new TableTuple("Austin Chumlee Russell", "03/09/2013", "drunk driving");
t5.addKeyWord("drunk driving");
TableTuple t6 = new TableTuple("Ben Stiller", "02/12/2015", "driving without a licesnce");
t6.addKeyWord("driving license");
TableTuple t7 = new TableTuple("Emile Hirsch", "02/12/2015", "drunk driving");
t7.addKeyWord("drunk driving");
TableTuple t8 = new TableTuple("Chris Kattan", "01/23/2014", "attacking wife");
t8.addKeyWord("attacking");
TableTuple t9 = new TableTuple("Austin Chumlee Russell", "01/09/2014", "sexual assault");
t9.addKeyWord("assault");
TableTuple t10 = new TableTuple("Ben Stiller", "02/12/2015", "sexual assault");
t10.addKeyWord("assault");
lin.insert(t1);
lin.insert(t2);
lin.insert(t3);
lin.insert(t4);
lin.insert(t5);
lin.insert(t6);
lin.insert(t7);
lin.insert(t8);
lin.insert(t9);
lin.insert(t10);
addEvents(lin);
addAllKeywords(lin);
}
use of main.database.TableTuple in project Info-Evaluation by TechnionYP5777.
the class AnalyzeParagraphTest method test4.
@Test
public void test4() {
final Sentence sent = new Sentence("Axl Rose was arrested for consuming drugs on October 5th 2012 in NY during rock concert .");
final TableTuple tt = new AnalyzeParagragh(sent, "2012").Analyze();
assertEquals("Axl Rose", tt.getName());
assertEquals("drugs consuming during concert", tt.getReason());
assertEquals("10/05/2012", tt.getDate());
}
use of main.database.TableTuple in project Info-Evaluation by TechnionYP5777.
the class AnalyzeParagraphTest method test5.
@Test
public void test5() {
final Sentence sent = new Sentence("Axl Rose was arrested after driving drunk in New Zeland on March 1.");
final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
assertEquals("Axl Rose", tt.getName());
assertEquals("driving drunk in New Zeland", tt.getReason());
assertEquals("03/01/2015", tt.getDate());
}
Aggregations