Package org.mediameter.cliff.orgs

Examples of org.mediameter.cliff.orgs.ResolvedOrganization


    @Override
    public List<ResolvedOrganization> select(List<OrganizationOccurrence> allPossibilities) {
        ArrayList<ResolvedOrganization> bestCandidates = new ArrayList<ResolvedOrganization>();
        for(OrganizationOccurrence occurrence: allPossibilities){
          if (bestCandidates.size() == 0){
            bestCandidates.add(new ResolvedOrganization(occurrence));
            continue;
          }
          boolean added = false;
         
          for(ResolvedOrganization alreadyAdded: bestCandidates){
            String newDude= occurrence.text.toLowerCase(Locale.US);
            String oldDude = alreadyAdded.getName().toLowerCase(Locale.US);
            if (newDude.equals(oldDude)){
              logger.debug(alreadyAdded.getName() + " is a duplicate of " + occurrence.text);
              alreadyAdded.addOccurrence(occurrence);
              added = true;
              break;
            }
          }
          if (!added){
            bestCandidates.add(new ResolvedOrganization(occurrence));
          }
         
        }
        return bestCandidates;
    }
View Full Code Here

TOP

Related Classes of org.mediameter.cliff.orgs.ResolvedOrganization

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.