use of org.opensextant.extractors.geo.PlaceCount in project Xponents by OpenSextant.
the class ProvinceAssociationRule method setProvinces.
public void setProvinces(Collection<PlaceCount> p) {
if (p == null) {
return;
}
for (PlaceCount count : p) {
Place adm1 = count.place;
relevantProvinceID.put(adm1.getHierarchicalPath(), adm1);
}
}
use of org.opensextant.extractors.geo.PlaceCount in project Xponents by OpenSextant.
the class LocationChooserRule method debuggingHistograms.
/**
* What can we learn from assembling better stats at the document level?
* Evidence breaks down into concrete locations vs. inferred.
*
* @param names
*/
private void debuggingHistograms(List<PlaceCandidate> names) {
/*
* TODO: Is this histogram helpful.?
*
* Uniqueness or popularity of a given name.
*/
for (PlaceCandidate name : names) {
if (name.isFilteredOut()) {
continue;
}
PlaceCount x = namespace.get(name.getTextnorm());
if (x == null) {
x = new PlaceCount();
x.place = new Place(name.getTextnorm(), name.getTextnorm());
x.total = names.size();
namespace.put(name.getTextnorm(), x);
} else {
++x.count;
}
}
for (String cc : countryContext.keySet()) {
CountryCount count = countryContext.get(cc);
//log.debug("Country: {}/{} ({})", cc, count.country, count.count);
log.debug("Country: {}", count);
}
for (PlaceCount count : boundaryContext.values()) {
//log.debug("Boundary: {} ({})", count.place, count.count);
log.debug("Boundary: {}", count);
String cc = count.place.getCountryCode();
CountryCount Ccnt = inferredCountries.get(cc);
if (Ccnt == null) {
Ccnt = new CountryCount();
Ccnt.country = new Country(cc, cc);
inferredCountries.put(cc, Ccnt);
} else {
++Ccnt.count;
}
}
log.debug("Places: {}/{}", namespace.size(), namespace);
}
Aggregations