Package org.folg.places.standardize

Examples of org.folg.places.standardize.Place


      Map<String,MatchCount> matchCounts = new TreeMap<String, MatchCount>();

      // standardize all places + calculate matchCounts
      while (reader.ready()) {
         String nextLine = reader.readLine();
         Place p = standardizer.standardize(nextLine);
         if (p != null) {
            int level = p.getLevel();
            int countryId = p.getCountryId();
            String fullName = p.getFullName();
            int pos = fullName.lastIndexOf(",");
            String countryName;
            if (pos >= 0) {
               countryName = fullName.substring(pos+1).trim();
            }
View Full Code Here


         String nextLine = reader.readLine();
         String[] fields = nextLine.split("\\|");
         String text = fields[0];
         String otherPlace = fields[1];
         String ourPlace = "";
         Place p = standardizer.standardize(text);
         if (p != null) {
            ourPlace = p.getFullName();
         }
         if (!removeSpuriousDifferences(ourPlace).equals(removeSpuriousDifferences(otherPlace))) {
            cntDiffs++;
            writer.println(text+"|"+ourPlace+"|"+otherPlace);
         }
View Full Code Here

      // log only children without numbers
      if (words.size() > 0 && !hasDigit(words)) {
         // build place with all levels from here up
         String hereUp = generatePlaceName(levels, levelNumber);
         // just write out the first place in the list
         Place p = standardizer.getPlace(matchedPlaceIds.get(0));
         skippedWriter.println(hereUp+" | "+p.getFullName());
      }
   }
View Full Code Here

      long startMillis = System.currentTimeMillis();
      while (bufferedReader.ready()) {
         String nextLine = bufferedReader.readLine();

         if (numResults == 0) {
            Place p = standardizer.standardize(nextLine);
            if (p != null) {
               placesWriter.println(nextLine + " | "+ p.getFullName());
               printAlsoLocatedIns(placesWriter, p);
            }
         }
         else {
            List<Standardizer.PlaceScore> results = standardizer.standardize(nextLine, numResults);
View Full Code Here

      int[] alsoLocatedInIds = p.getAlsoLocatedInIds();
      if ((printAlsoLocatedIns) && (alsoLocatedInIds != null) && (alsoLocatedInIds.length > 0)) {
         StringBuffer alsoLocatedStrs = new StringBuffer();
         for (int indx = 0; indx < alsoLocatedInIds.length; indx++) {
            int alsoLocatedInId = alsoLocatedInIds[indx];
            Place alsoLocatedPlace = standardizer.getPlace(alsoLocatedInId);
            if (alsoLocatedStrs.length() > 0) {
               alsoLocatedStrs.append(", ");
            }
            alsoLocatedStrs.append(alsoLocatedPlace.getFullName());
         }
         placesWriter.println("\talso located in = " + alsoLocatedStrs);

      }
   }
View Full Code Here

TOP

Related Classes of org.folg.places.standardize.Place

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.