public class NGram extends UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>
When the input is empty, an empty array is returned. When the input array length is less than n (number of elements per n-gram), no n-grams are returned.
Modifier and Type | Method and Description |
---|---|
protected scala.Function1<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>> |
createTransformFunc()
Creates the transform function using the given param map.
|
int |
getN() |
static NGram |
load(java.lang.String path) |
IntParam |
n()
Minimum n-gram length, >= 1.
|
protected DataType |
outputDataType()
Returns the data type of the output column.
|
NGram |
setN(int value) |
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
protected void |
validateInputType(DataType inputType)
Validates the input type.
|
copy, setInputCol, setOutputCol, transform, transformSchema
transform, transform, transform
transformSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
public static NGram load(java.lang.String path)
public java.lang.String uid()
Identifiable
public IntParam n()
public NGram setN(int value)
public int getN()
protected scala.Function1<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>> createTransformFunc()
UnaryTransformer
createTransformFunc
in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>
protected void validateInputType(DataType inputType)
UnaryTransformer
validateInputType
in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>
inputType
- (undocumented)protected DataType outputDataType()
UnaryTransformer
outputDataType
in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>