|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.aitools.ie.decomposition.ngram.CharacterNGramDecomposition
public class CharacterNGramDecomposition
This class decomposes a given String
into n-grams of characters. An
n-gram is a sub-sequence of n characters. The next n-gram in result list is
shifted by 1 character. All characters of the string are used, also white
spaces.
WordNGramDecomposition
,
CharacterChunkingDecomposition
Constructor Summary | |
---|---|
CharacterNGramDecomposition(int n)
This class decomposes a given String into n-grams of characters. |
Method Summary | |
---|---|
java.util.List<Span> |
getSpans(java.lang.String text)
Analyses a string and split it in parts. |
java.util.List<java.lang.String> |
getStrings(java.lang.String text,
boolean asSubstring)
Analyses a string and split it in parts. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CharacterNGramDecomposition(int n)
String
into n-grams of characters. An
n-gram is a sub-sequence of n characters. The next n-gram in result list is
shifted by 1 character. All characters of the string are used, also white
spaces.
n
- value of n as integer.Method Detail |
---|
public java.util.List<Span> getSpans(java.lang.String text)
Decomposition
Span
s with start/end index in original string.
getSpans
in interface Decomposition
text
- The original text to decompose.
Span
with start/end index in the original string.Decomposition#getStrings(String, boolean)}
public java.util.List<java.lang.String> getStrings(java.lang.String text, boolean asSubstring)
Decomposition
getStrings
in interface Decomposition
text
- The original text to decompose.asSubstring
- If true, returned strings in list are substrings of input text
else explicit copies are returned. A substring is a pointer to the
original string and start/end position. A string copy is an exact
copy of the part.Decomposition#getSpans(String)}
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |