public class TokenMergeContainer extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
TokenMergeContainer.AlignedTokensMap
This class contains all tokens which were aligned and allows a search for
specific
SToken objects by their start position. |
| Constructor and Description |
|---|
TokenMergeContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlignedToken(org.corpus_tools.salt.common.STextualDS text,
org.corpus_tools.salt.common.SToken tok,
int left,
int right)
This method adds the given
SToken which is contained in the given
STextualDS at the normalized left and right position. |
void |
addNormalizedText(org.corpus_tools.salt.common.SDocument doc,
org.corpus_tools.salt.common.STextualDS sTextualDS,
String normalizedText)
This method adds the normalized text, specified by the parameter, for the
specified
STextualDS of the specified SDocument object. |
void |
addTokenMapping(org.corpus_tools.salt.common.SToken baseTextToken,
org.corpus_tools.salt.common.SToken otherTextToken,
org.corpus_tools.salt.common.STextualDS otherSText)
This method adds an equivalence mapping for the given
SToken of
the base text to the given SToken in some other
STextualDS which is specified as parameter |
void |
finishDocument(org.corpus_tools.salt.common.SDocument document)
This method frees the memory used by the specified in the
TokenMergeContainer. |
org.corpus_tools.salt.common.SToken |
getAlignedTokenByStart(org.corpus_tools.salt.common.STextualDS sTextualDS,
int start)
This method returns the
SToken object which is located in the
given normalized STextualDS at the given start position. |
int |
getAlignedTokenLength(org.corpus_tools.salt.common.STextualDS sTextualDS,
org.corpus_tools.salt.common.SToken sToken)
This method returns the length for the given
SToken object in the
normalized version of the given STextualDS. |
TokenMergeContainer.AlignedTokensMap |
getAlignedTokens(org.corpus_tools.salt.common.STextualDS text)
This method returns the map of aligned
SToken objects for the
specified STextualDS. |
int |
getAlignedTokenStart(org.corpus_tools.salt.common.STextualDS sTextualDS,
org.corpus_tools.salt.common.SToken sToken)
This method returns the start for the given
SToken object in the
normalized version of the given STextualDS. |
org.corpus_tools.salt.common.SDocument |
getBaseDocument()
This method returns the base
SDocument object. |
int |
getBaseTextPositionByNormalizedTextPosition(org.corpus_tools.salt.common.STextualDS sTextualDS,
int position)
This method returns the position of a character in the original text,
specified by the given
STextualDS and the given position in the
normalized text. |
Map<org.corpus_tools.salt.common.SToken,Map<org.corpus_tools.salt.common.STextualDS,org.corpus_tools.salt.common.SToken>> |
getEquivalenceMap()
This method returns the map of equivalences for the base text tokens.
|
String |
getNormalizedText(org.corpus_tools.salt.common.STextualDS sTextualDS)
This method searches the normalized text for the given
STextualDS
. |
org.corpus_tools.salt.common.SToken |
getTokenMapping(org.corpus_tools.salt.common.SToken baseTextToken,
org.corpus_tools.salt.common.STextualDS otherSText)
This method gives access to the TokenMergeContainer and returns the
equivalent
SToken in the specified STextualDS for the
specified SToken in the base text/document. |
void |
setBaseDocument(org.corpus_tools.salt.common.SDocument sDocument)
This method sets the base
SDocument. |
void |
setBaseTextPositionByNormalizedTextPosition(org.corpus_tools.salt.common.STextualDS sTextualDS,
List<Integer> posMapping)
This method sets the specified mapping from normalized text to the
original text for the specified
STextualDS object. |
public void setBaseDocument(org.corpus_tools.salt.common.SDocument sDocument)
SDocument.sDocument - The SDocument to set as base.public org.corpus_tools.salt.common.SDocument getBaseDocument()
SDocument object.SDocument or null, if there is no base
SDocumentpublic void setBaseTextPositionByNormalizedTextPosition(org.corpus_tools.salt.common.STextualDS sTextualDS,
List<Integer> posMapping)
STextualDS object.sTextualDS - The STextualDS objectposMapping - The mapping listpublic int getBaseTextPositionByNormalizedTextPosition(org.corpus_tools.salt.common.STextualDS sTextualDS,
int position)
STextualDS and the given position in the
normalized text.sTextualDS - The STextualDS objectposition - The position of a character in the normalized textpublic void addNormalizedText(org.corpus_tools.salt.common.SDocument doc,
org.corpus_tools.salt.common.STextualDS sTextualDS,
String normalizedText)
STextualDS of the specified SDocument object.doc - The SDocument object containing the given textsTextualDS - The STextualDS for which a normalized text should be
addednormalizedText - The normalized text for the given STextualDSpublic String getNormalizedText(org.corpus_tools.salt.common.STextualDS sTextualDS)
STextualDS
.sTextualDS - The STextualDS to search the normalized text for.STextualDSpublic org.corpus_tools.salt.common.SToken getAlignedTokenByStart(org.corpus_tools.salt.common.STextualDS sTextualDS,
int start)
SToken object which is located in the
given normalized STextualDS at the given start position.sTextualDS - The STextualDS which contains the SToken at
the start positionstart - The start position of the SToken in the
STextualDS.SToken which is located at position start in the
given STextualDS or null, if there is no such
SToken.public int getAlignedTokenStart(org.corpus_tools.salt.common.STextualDS sTextualDS,
org.corpus_tools.salt.common.SToken sToken)
SToken object in the
normalized version of the given STextualDS.sTextualDS - The STextualDS to search the start position of the
given SToken forsToken - The SToken to search the start position forSToken in the normalized version of
the given STextualDS or -1, if the SToken has no
position in the given STextualDS.public int getAlignedTokenLength(org.corpus_tools.salt.common.STextualDS sTextualDS,
org.corpus_tools.salt.common.SToken sToken)
SToken object in the
normalized version of the given STextualDS.sTextualDS - The STextualDS to search the length of the given
SToken forsToken - The SToken to search the length forSToken in the normalized version of the
given STextualDS or -1, if the SToken has length
in the given STextualDS.public TokenMergeContainer.AlignedTokensMap getAlignedTokens(org.corpus_tools.salt.common.STextualDS text)
SToken objects for the
specified STextualDS.text - The STextualDS to search the map of aligned tokens
for.TokenMergeContainer.AlignedTokensMap for the specified STextualDS
or null if there is no such map.public void addAlignedToken(org.corpus_tools.salt.common.STextualDS text,
org.corpus_tools.salt.common.SToken tok,
int left,
int right)
SToken which is contained in the given
STextualDS at the normalized left and right position.text - The STextualDS which contains the given STokentok - The SToken object to addleft - The start of the SToken in the normalized version of
the STextualDSright - The end of the SToken in the normalized version of the
STextualDSpublic void addTokenMapping(org.corpus_tools.salt.common.SToken baseTextToken,
org.corpus_tools.salt.common.SToken otherTextToken,
org.corpus_tools.salt.common.STextualDS otherSText)
SToken of
the base text to the given SToken in some other
STextualDS which is specified as parameterbaseTextToken - The base SToken to add a mapping for.otherTextToken - The SToken which is a mapping for the base
STokenotherSText - The STextualDS which is connected to the mapped
STokenpublic org.corpus_tools.salt.common.SToken getTokenMapping(org.corpus_tools.salt.common.SToken baseTextToken,
org.corpus_tools.salt.common.STextualDS otherSText)
SToken in the specified STextualDS for the
specified SToken in the base text/document.baseTextToken - the SToken for which an equivalent SToken
shall be searchedotherSText - the STextualDS to search for an equivalent tokenSToken if existent and null, else.public Map<org.corpus_tools.salt.common.SToken,Map<org.corpus_tools.salt.common.STextualDS,org.corpus_tools.salt.common.SToken>> getEquivalenceMap()
public void finishDocument(org.corpus_tools.salt.common.SDocument document)
TokenMergeContainer.document - document whose elements should be removed from internal
indexesCopyright © 2014–2019 Humboldt-Universität zu Berlin. All rights reserved.