use of edu.uci.ics.textdb.api.field.IField in project textdb by TextDB.
the class RegexTestConstantsCorp method getSampleCorpTuples.
public static List<Tuple> getSampleCorpTuples() {
IField[] fields1 = { new StringField("Facebook"), new StringField("404 Not Found"), new StringField("66.220.144.0") };
IField[] fields2 = { new StringField("Weibo"), new StringField("http://weibo.com"), new StringField("180.149.134.141") };
IField[] fields3 = { new StringField("Microsoft"), new StringField("https://www.microsoft.com/en-us/"), new StringField("131.107.0.89") };
IField[] fields4 = { new StringField("Google"), new StringField("websit: www.google.com"), new StringField("8.8.8.8.8.8") };
Tuple tuple1 = new Tuple(SCHEMA_CORP, fields1);
Tuple tuple2 = new Tuple(SCHEMA_CORP, fields2);
Tuple tuple3 = new Tuple(SCHEMA_CORP, fields3);
Tuple tuple4 = new Tuple(SCHEMA_CORP, fields4);
return Arrays.asList(tuple1, tuple2, tuple3, tuple4);
}
use of edu.uci.ics.textdb.api.field.IField in project textdb by TextDB.
the class RegexTestConstantsText method getTextTuple.
private static Tuple getTextTuple(String content) {
IField field = new TextField(content);
Tuple tuple = new Tuple(SCHEMA_TEXT, field);
return tuple;
}
use of edu.uci.ics.textdb.api.field.IField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest4Tuple.
public static List<Tuple> getTest4Tuple() throws ParseException {
IField[] fields1 = { new TextField("Microsoft, Google and Facebook are organizations."), new TextField("Donald Trump and Barack Obama are persons") };
Tuple tuple1 = new Tuple(SCHEMA_TWO_SENTENCE, fields1);
return Arrays.asList(tuple1);
}
use of edu.uci.ics.textdb.api.field.IField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest7Tuple.
public static List<Tuple> getTest7Tuple() throws ParseException {
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);
return Arrays.asList(tuple1);
}
use of edu.uci.ics.textdb.api.field.IField in project textdb by TextDB.
the class NlpEntityTestConstants method getTest3ResultTuples.
public static List<Tuple> getTest3ResultTuples() {
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");
Span span4 = new Span("sentence_one", 53, 65, NlpEntityType.PERSON.toString(), "Donald Trump");
Span span5 = new Span("sentence_one", 70, 82, NlpEntityType.PERSON.toString(), "Barack Obama");
spanList.add(span1);
spanList.add(span2);
spanList.add(span3);
spanList.add(span4);
spanList.add(span5);
IField[] fields1 = { new TextField("Microsoft, Google and Facebook are organizations and Donald Trump and Barack Obama are persons.") };
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