-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGround.java
More file actions
24 lines (21 loc) · 811 Bytes
/
Copy pathGround.java
File metadata and controls
24 lines (21 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
The ground of project: where all actions take place
*/
import data.database.JsonDatabase;
import service.search.*;
import data.entity.Entity;
import data.DataGround;
import java.util.*;
public class Ground {
public static void main(String[] args) {
JsonDatabase database = JsonDatabase.getDatabase("/home/minh/School/Learning/20222/OOP/ProjectOOP20222/Data/Database/historical-character/hc#4.json");
List<Entity> listEntity = DataGround.load(database);
Searcher searcher = new Searcher();
searcher.setSearchFieldGetter(new SearchIdGetter());
searcher.setSearchStrategy(new LcsSearchStrategy());
List<Entity> listMatchEntity = searcher.search(listEntity, "nguyen");
for (Entity entity: listMatchEntity) {
System.out.println(entity.getProperty("id"));
} // close for
} // close main
}