Class Utils
- java.lang.Object
-
- de.pseudonymisierung.controlnumbers.Utils
-
public class Utils extends Object
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>getNGrams(String input, int nGramLength)Split the input string into n-grams of length nGramLength.
-
-
-
Method Detail
-
getNGrams
public static List<String> getNGrams(String input, int nGramLength)
Split the input string into n-grams of length nGramLength. The string is padded with nGramLength-1 spaces (trailing and leading). For example, the input string "Java" yields the output bigrams (n=2) " J", "Ja", "av", "va", "a ".- Parameters:
input- String to split into n-grams.nGramLength- Length of n-grams.- Returns:
- The set of n-grams.
-
-