public class StringGrid
extends java.util.ArrayList<java.util.List<java.lang.String>>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NONE |
Constructor and Description |
---|
StringGrid(java.lang.String sep,
java.util.Collection<java.lang.String> data) |
StringGrid(StringGrid grid) |
StringGrid(java.lang.String sep,
int numColumns) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(java.util.List<java.lang.String> column) |
void |
addRow(java.util.List<java.lang.String> row) |
void |
appendToEach(java.lang.String append,
int toColumn) |
StringCluster |
clusterColumn(int column) |
void |
combineColumns(int templateColumn,
int[] paramColumns)
Combine the column based on a template and a number of template variable
columns.
|
void |
combineColumns(int templateColumn,
java.lang.Integer[] paramColumns)
Combine the column based on a template and a number of template variable
columns.
|
void |
dedupeByCluster(int column)
Deduplicate based on the column clustering signature
|
void |
dedupeByClusterAll() |
void |
fillDown(java.lang.String value,
int column) |
void |
filterBySimilarity(double threshold,
int firstColumn,
int secondColumn) |
java.util.List<java.lang.Integer> |
filterRowsByColumn(int column,
java.util.Collection<java.lang.String> values) |
static StringGrid |
fromFile(java.lang.String file,
java.lang.String sep) |
static StringGrid |
fromInput(java.io.InputStream from,
java.lang.String sep) |
StringGrid |
getAllWithSimilarity(double threshold,
int firstColumn,
int secondColumn) |
java.util.List<java.lang.String> |
getColumn(int column) |
int |
getNumColumns() |
java.util.List<java.lang.String> |
getRow(int row) |
java.util.List<java.util.List<java.lang.String>> |
getRowsWithColumnValues(java.util.Collection<java.lang.String> values,
int column) |
StringGrid |
getRowsWithDuplicateValuesInColumn(int column) |
StringGrid |
getRowWithOnlyOneOccurrence(int column) |
StringGrid |
getUniqueRows() |
void |
head(int num) |
java.util.Map<java.lang.String,java.util.List<java.util.List<java.lang.String>>> |
mapByPrimaryKey(int columnKey) |
void |
merge(int column1,
int column2) |
void |
prependToEach(java.lang.String prepend,
int toColumn) |
void |
removeColumns(java.lang.Integer... columns)
Removes the specified columns from the grid
|
void |
removeRowsWithEmptyColumn(int column)
Removes all rows with a column of NONE
|
void |
removeRowsWithEmptyColumn(int column,
java.lang.String missingValue)
Removes all rows with a column of missingValue
|
StringGrid |
select(int column,
java.lang.String value) |
void |
sortBy(int column) |
void |
sortColumnsByWordLikelihoodIncluded(int column) |
void |
split(int column,
java.lang.String sepBy) |
void |
stripDuplicateRows() |
void |
swap(int column1,
int column2) |
java.util.List<java.lang.String> |
toLines() |
void |
writeLinesTo(java.lang.String path) |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public static final java.lang.String NONE
public StringGrid(StringGrid grid)
public StringGrid(java.lang.String sep, int numColumns)
public StringGrid(java.lang.String sep, java.util.Collection<java.lang.String> data)
public int getNumColumns()
public static StringGrid fromFile(java.lang.String file, java.lang.String sep) throws java.io.IOException
java.io.IOException
public static StringGrid fromInput(java.io.InputStream from, java.lang.String sep) throws java.io.IOException
java.io.IOException
public void removeRowsWithEmptyColumn(int column)
column
- the column to remove bypublic void head(int num)
public void removeColumns(java.lang.Integer... columns)
columns
- the columns to removepublic void removeRowsWithEmptyColumn(int column, java.lang.String missingValue)
column
- he column to remove bymissingValue
- the missingValue sentinel valuepublic java.util.List<java.util.List<java.lang.String>> getRowsWithColumnValues(java.util.Collection<java.lang.String> values, int column)
public void sortColumnsByWordLikelihoodIncluded(int column)
public StringCluster clusterColumn(int column)
public void dedupeByClusterAll()
public void dedupeByCluster(int column)
column
- public java.util.List<java.lang.Integer> filterRowsByColumn(int column, java.util.Collection<java.lang.String> values)
public void sortBy(int column)
public java.util.List<java.lang.String> toLines()
public void swap(int column1, int column2)
public void merge(int column1, int column2)
public StringGrid getAllWithSimilarity(double threshold, int firstColumn, int secondColumn)
public void writeLinesTo(java.lang.String path) throws java.io.IOException
java.io.IOException
public void fillDown(java.lang.String value, int column)
public StringGrid select(int column, java.lang.String value)
public void split(int column, java.lang.String sepBy)
public void filterBySimilarity(double threshold, int firstColumn, int secondColumn)
public void prependToEach(java.lang.String prepend, int toColumn)
public void appendToEach(java.lang.String append, int toColumn)
public void addColumn(java.util.List<java.lang.String> column)
public void combineColumns(int templateColumn, java.lang.Integer[] paramColumns)
templateColumn
- the column with the template ( uses printf style templating)paramColumns
- the columns with template variablespublic void combineColumns(int templateColumn, int[] paramColumns)
templateColumn
- the column with the template ( uses printf style templating)paramColumns
- the columns with template variablespublic void addRow(java.util.List<java.lang.String> row)
public java.util.Map<java.lang.String,java.util.List<java.util.List<java.lang.String>>> mapByPrimaryKey(int columnKey)
public java.util.List<java.lang.String> getRow(int row)
public java.util.List<java.lang.String> getColumn(int column)
public StringGrid getRowsWithDuplicateValuesInColumn(int column)
public StringGrid getRowWithOnlyOneOccurrence(int column)
public StringGrid getUniqueRows()
public void stripDuplicateRows()