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, transformSchematransform, transform, transformtransformSchemaclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParamstoStringpublic static NGram load(java.lang.String path)
public java.lang.String uid()
Identifiablepublic 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()
UnaryTransformercreateTransformFunc in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>protected void validateInputType(DataType inputType)
UnaryTransformervalidateInputType in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>inputType - (undocumented)protected DataType outputDataType()
UnaryTransformeroutputDataType in class UnaryTransformer<scala.collection.Seq<java.lang.String>,scala.collection.Seq<java.lang.String>,NGram>