public String toString() { ArrayList<WebPageEntity> childEntities = getChildEntities(); String str = ""; for (WebPageEntity webPageEntity : childEntities) { str += webPageEntity.toString() + "/n"; } return str + text; }
public ArrayList<WebPageEntity> getChildEntities() { ArrayList<WebPageEntity> childEntities = new ArrayList<WebPageEntity>(); for (WebPageEntity webPageEntity : children) { if (webPageEntity.terms.size() != 0) { childEntities.add(webPageEntity); } if (webPageEntity.children.size() != 0) { childEntities.addAll(webPageEntity.getChildEntities()); } } return childEntities; }
public ArrayList<String> getNamedEntities() { ArrayList<String> _namedEntities = new ArrayList<String>(); for (WebPageEntity webPageEntity : children) { if (webPageEntity.namedEntities != null && webPageEntity.namedEntities.size() != 0) { _namedEntities.addAll(webPageEntity.getNamedEntities()); } } for (NamedEntity nameEntity : namedEntities) { _namedEntities.add(nameEntity.getEntityValue()); } return _namedEntities; }