use of edu.uci.ics.textdb.api.field.TextField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest1ResultTuples.
public static List<Tuple> getTest1ResultTuples() {
List<Tuple> resultList = new ArrayList<>();
List<Span> spanList = new ArrayList<Span>();
Span span1 = new Span("sentence_one", 0, 9, NlpEntityType.ORGANIZATION.toString(), "Microsoft");
spanList.add(span1);
IField[] fields1 = { new TextField("Microsoft is an organization.") };
Tuple tuple1 = new Tuple(SCHEMA_ONE_SENTENCE, fields1);
Schema returnSchema = Utils.addAttributeToSchema(tuple1.getSchema(), new Attribute(RESULTS, AttributeType.LIST));
Tuple returnTuple = DataflowUtils.getSpanTuple(tuple1.getFields(), spanList, returnSchema);
resultList.add(returnTuple);
return resultList;
}
use of edu.uci.ics.textdb.api.field.TextField in project textdb by TextDB.
the class NlpEntityTestConstants method getOneSentenceTestTuple.
public static List<Tuple> getOneSentenceTestTuple() {
IField[] fields1 = { new TextField("Microsoft is an organization.") };
IField[] fields2 = { new TextField("Microsoft, Google and Facebook are organizations.") };
IField[] fields3 = { new TextField("Microsoft, Google and Facebook are organizations and Donald Trump and Barack Obama are persons.") };
IField[] fields4 = { new TextField("Feeling the warm sun rays beaming steadily down, the girl decided there was no need to wear a coat.") };
IField[] fields5 = { new TextField("This backpack costs me 300 dollars.") };
IField[] fields6 = { new TextField("What't the brand, Samsung or Apple?") };
Tuple tuple1 = new Tuple(SCHEMA_ONE_SENTENCE, fields1);
Tuple tuple2 = new Tuple(SCHEMA_ONE_SENTENCE, fields2);
Tuple tuple3 = new Tuple(SCHEMA_ONE_SENTENCE, fields3);
Tuple tuple4 = new Tuple(SCHEMA_ONE_SENTENCE, fields4);
Tuple tuple5 = new Tuple(SCHEMA_ONE_SENTENCE, fields5);
Tuple tuple6 = new Tuple(SCHEMA_ONE_SENTENCE, fields6);
return Arrays.asList(tuple1, tuple2, tuple3, tuple4, tuple5, tuple6);
}
use of edu.uci.ics.textdb.api.field.TextField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest7ResultTuples.
public static List<Tuple> getTest7ResultTuples() {
List<Tuple> resultList = new ArrayList<>();
List<Span> spanList = new ArrayList<Span>();
Span span1 = new Span("sentence_one", 12, 16, NlpEntityType.ADJECTIVE.toString(), "warm");
spanList.add(span1);
IField[] fields1 = { new TextField("Feeling the warm sun rays beaming steadily down, the girl decided there was no need to wear a coat.") };
Tuple tuple1 = new Tuple(SCHEMA_ONE_SENTENCE, fields1);
Schema returnSchema = Utils.addAttributeToSchema(tuple1.getSchema(), new Attribute(RESULTS, AttributeType.LIST));
Tuple returnTuple = DataflowUtils.getSpanTuple(tuple1.getFields(), spanList, returnSchema);
resultList.add(returnTuple);
return resultList;
}
use of edu.uci.ics.textdb.api.field.TextField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest2Tuple.
public static List<Tuple> getTest2Tuple() throws ParseException {
IField[] fields1 = { new TextField("Microsoft, Google and Facebook are organizations.") };
Tuple tuple1 = new Tuple(SCHEMA_ONE_SENTENCE, fields1);
return Arrays.asList(tuple1);
}
use of edu.uci.ics.textdb.api.field.TextField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest2ResultTuples.
public static List<Tuple> getTest2ResultTuples() {
List<Tuple> resultList = new ArrayList<>();
List<Span> spanList = new ArrayList<Span>();
Span span1 = new Span("sentence_one", 0, 9, NlpEntityType.ORGANIZATION.toString(), "Microsoft");
Span span2 = new Span("sentence_one", 11, 17, NlpEntityType.ORGANIZATION.toString(), "Google");
Span span3 = new Span("sentence_one", 22, 30, NlpEntityType.ORGANIZATION.toString(), "Facebook");
spanList.add(span1);
spanList.add(span2);
spanList.add(span3);
IField[] fields1 = { new TextField("Microsoft, Google and Facebook are organizations.") };
Tuple tuple1 = new Tuple(SCHEMA_ONE_SENTENCE, fields1);
Schema returnSchema = Utils.addAttributeToSchema(tuple1.getSchema(), new Attribute(RESULTS, AttributeType.LIST));
Tuple returnTuple = DataflowUtils.getSpanTuple(tuple1.getFields(), spanList, returnSchema);
resultList.add(returnTuple);
return resultList;
}
Aggregations