Class NgramLeftToRightTokenizer
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.labelToConcept.nGramTokenizers.NgramLeftToRightTokenizer
- All Implemented Interfaces:
LeftToRightTokenizer
,OneToManyLinkingStrategy
public class NgramLeftToRightTokenizer
extends Object
implements LeftToRightTokenizer, OneToManyLinkingStrategy
DEV REMARK: Be aware that refactoring the name leads to hardcoded String changes in the LabelToConcept Linker package.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNgramLeftToRightTokenizer
(String[] arrayToLink, String delimiter, int nGramsize) Constructor -
Method Summary
Modifier and TypeMethodDescriptionString[]
Getting the very first string formation.int
boolean
(package private) String
processArrayForLookup
(String[] arrayToConvert, int start, int end) Cuts the given array as specified and concatenates the components in a space-separated way.void
setArrayToLink
(String[] arrayToLink) void
setDelimiter
(String delimiter) void
setnGramsize
(int nGramsize)
-
Field Details
-
LOG
private static org.slf4j.Logger LOG -
arrayToLink
-
endIndexExclusive
private int endIndexExclusive -
startIndex
private int startIndex -
terminated
private boolean terminated -
cutNgramPosition
private int cutNgramPosition -
nGramsize
private int nGramsize -
delimiter
-
-
Constructor Details
-
NgramLeftToRightTokenizer
Constructor- Parameters:
arrayToLink
- The array that shall be linked.delimiter
- DelimiternGramsize
- n-gram size
-
-
Method Details
-
getNextTokenNotSuccessful
- Specified by:
getNextTokenNotSuccessful
in interfaceLeftToRightTokenizer
-
getNextTokenSuccessful
- Specified by:
getNextTokenSuccessful
in interfaceLeftToRightTokenizer
-
getInitialToken
Getting the very first string formation. This method can only be called as long as the process is not terminated.- Specified by:
getInitialToken
in interfaceLeftToRightTokenizer
- Returns:
- String representation for next test.
-
processArrayForLookup
Cuts the given array as specified and concatenates the components in a space-separated way.- Parameters:
arrayToConvert
- The array to be cut.start
- Start index of cut.end
- End index of cut.- Returns:
- Single String of space-separated components.
-
getArrayToLink
-
setArrayToLink
-
isTerminated
public boolean isTerminated() -
getDelimiter
-
setDelimiter
-
getnGramsize
public int getnGramsize() -
setnGramsize
public void setnGramsize(int nGramsize)
-