Package org.folg.places.standardize

Examples of org.folg.places.standardize.Place$Source


    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    Button btnCreateSource = new Button(container, SWT.NONE);
    btnCreateSource.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Source newSource = new Source();
        newSource.setId("Source_" + (table.getItemCount() + 1)); //$NON-NLS-1$
        SourceBindingWrapper sourceBindingWrapper = new SourceBindingWrapper(newSource);
        writableList.add(sourceBindingWrapper);
        tableViewer.setSelection(new StructuredSelection(sourceBindingWrapper));
      }
    });
View Full Code Here


    titleStmt.getTitles().add(title);
    fileDesc.setTitleStmt(titleStmt);
    PubStmt pubStmt = new PubStmt();
    fileDesc.setPubStmt(pubStmt);
    SourceDesc sourceDesc = new SourceDesc();
    Source source = new Source();
    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
View Full Code Here

      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

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
    int taskSourceCount;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Cast the input feed to the correct type.
    // Connect the tasks.
    source.setSink(task);
   
    // Register all the sources provided by this task as outputs.
    taskSourceCount = task.getSourceCount();
    for (int i = 0; i < taskSourceCount; i++) {
      setOutputTask(pipeTasks, task.getSource(i), i);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Cast the input feed to the correct type.
    // Connect the tasks.
    source.setSink(task);
   
    // Register the task as an output. A source only has one output, this
    // corresponds to pipe index 0.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

  public void connect(PipeTasks pipeTasks) {
    // A multi sink receives multiple streams of data, so we must connect
    // them up one by one.
    for (int i = 0; i < task.getSinkCount(); i++) {
      Sink sink;
      Source source;
     
      // Retrieve the next sink.
      sink = task.getSink(i);
     
      // Retrieve the appropriate source.
      source = (Source) getInputTask(pipeTasks, i, Source.class);
     
      // Connect the tasks.
      source.setSink(sink);
    }
   
    // Register the source as an output task.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

TOP

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

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.