예제 #1
0
  private Table processJournalName(Table table) throws IOException {

    ScimapsJournalMatcher scimapsJournalMatcher = new ScimapsJournalMatcher();

    // Create new output table
    Table outputTable = TableUtilities.copyTable(table);
    outputTable.addColumn(STANDARDIZED_JOURNAL_NAME_COLUMN, String.class);
    int standardizedJournalNameColumnIndex =
        outputTable.getColumnNumber(STANDARDIZED_JOURNAL_NAME_COLUMN);

    // Retrieve iterator
    Iterator<?> rows = outputTable.tuples();

    // Process journal names
    int rowIndex = 0;
    while (rows.hasNext()) {
      Tuple row = (Tuple) rows.next();
      if (row.canGetString(journalColumnName)) {
        String name = row.getString(journalColumnName);
        String suggestedName = scimapsJournalMatcher.get(name);
        outputTable.setString(rowIndex, standardizedJournalNameColumnIndex, suggestedName);
      }
      rowIndex++;
    }
    return outputTable;
  }