public class MergerMapper
extends org.corpus_tools.pepper.impl.PepperMapperImpl
implements org.corpus_tools.pepper.modules.PepperMapper
| Modifier and Type | Field and Description |
|---|---|
protected TokenMergeContainer |
container
the
TokenMergeContainer instance |
protected boolean |
isTestMode |
| Constructor and Description |
|---|
MergerMapper() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
alignTexts(org.corpus_tools.salt.common.STextualDS baseText,
org.corpus_tools.salt.common.STextualDS otherText,
Set<org.corpus_tools.salt.common.SToken> nonEquivalentTokenInOtherTexts,
Map<org.corpus_tools.salt.core.SNode,org.corpus_tools.salt.core.SNode> equivalenceMap)
This method aligns the normalized texts of the given
STextualDS
objects and also aligns the SToken including the creation
of equivalent SToken information. |
protected org.corpus_tools.pepper.modules.MappingSubject |
chooseBaseDocument()
Chooses the base
SDocument in which all nodes, relations etc. |
protected List<Integer> |
createBaseTextNormOriginalMapping(org.corpus_tools.salt.common.STextualDS sTextualDS)
This method creates a reverse mapping list for the given Text.
|
org.corpus_tools.salt.common.SCorpusGraph |
getBaseCorpusStructure()
Returns the
SCorpusGraph is the base corpus graph, in which
everything has to be merged in. |
org.corpus_tools.salt.common.SDocument |
getBaseDocument() |
TokenMergeContainer |
getContainer() |
Merger |
getMerger() |
protected int |
indexOfOmitChars(String stringToSearchIn,
String stringToSearchFor,
boolean useIndexOf,
Set<Character> omitChars)
This method searches for the first occurence of the stringToSearchFor in
the stringToSearchIn and ommits all chars in the omitCharArray.
|
protected void |
initialize()
This method initializes the mapping.
|
org.corpus_tools.pepper.common.DOCUMENT_STATUS |
mapSCorpus() |
org.corpus_tools.pepper.common.DOCUMENT_STATUS |
mapSDocument()
This method is called by the Pepper framework and merges a set of given
SDocumentGraph objects. |
void |
mergeDocumentStructures(org.corpus_tools.pepper.modules.MappingSubject baseSubject)
Merges all document-structures pairwise by calling
mergeDocumentStructures(SDocument, SDocument). |
protected void |
mergeTokens(org.corpus_tools.salt.common.STextualDS baseText,
org.corpus_tools.salt.common.STextualDS otherText,
Map<org.corpus_tools.salt.core.SNode,org.corpus_tools.salt.core.SNode> equivalenceMap) |
protected void |
normalizePrimaryTexts(org.corpus_tools.salt.common.SDocument sDocument)
Normalizes all primary texts of the given
SDocument. |
void |
setBaseCorpusStructure(org.corpus_tools.salt.common.SCorpusGraph baseCorpusStructure)
Sets the
SCorpusGraph is the base corpus graph, in which
everything has to be merged in. |
void |
setBaseDocument(org.corpus_tools.salt.common.SDocument baseDocument) |
void |
setMerger(Merger merger) |
addProgress, getCorpus, getDocument, getMappingResult, getMappingSubjects, getPepperMapperController, getProgress, getProperties, getResourceURI, readXMLResource, setCorpus, setDocument, setMappingResult, setPepperMapperController, setProgress, setProperties, setResourceURIclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddProgress, getCorpus, getDocument, getMappingResult, getMappingSubjects, getPepperMapperController, getProgress, getProperties, getResourceURI, setCorpus, setDocument, setMappingResult, setPepperMapperController, setProgress, setProperties, setResourceURIprotected boolean isTestMode
protected TokenMergeContainer container
TokenMergeContainer instancepublic Merger getMerger()
Merger object which has invoked this
mapper.public void setMerger(Merger merger)
merger - A reference to the Merger object which has invoked
this mapper.public org.corpus_tools.salt.common.SCorpusGraph getBaseCorpusStructure()
SCorpusGraph is the base corpus graph, in which
everything has to be merged in.public void setBaseCorpusStructure(org.corpus_tools.salt.common.SCorpusGraph baseCorpusStructure)
SCorpusGraph is the base corpus graph, in which
everything has to be merged in.baseCorpusStructure - protected void initialize()
initialize in class org.corpus_tools.pepper.impl.PepperMapperImplpublic org.corpus_tools.pepper.common.DOCUMENT_STATUS mapSCorpus()
mapSCorpus in interface org.corpus_tools.pepper.modules.PepperMappermapSCorpus in class org.corpus_tools.pepper.impl.PepperMapperImplpublic org.corpus_tools.salt.common.SDocument getBaseDocument()
SDocument which is the base document. That means,
that all document-structures are merged into this document.public void setBaseDocument(org.corpus_tools.salt.common.SDocument baseDocument)
baseDocument - the SDocument which is the base document. That means,
that all document-structures are merged into this document.public org.corpus_tools.pepper.common.DOCUMENT_STATUS mapSDocument()
SDocumentGraph objects.mapSDocument in interface org.corpus_tools.pepper.modules.PepperMappermapSDocument in class org.corpus_tools.pepper.impl.PepperMapperImplpublic void mergeDocumentStructures(org.corpus_tools.pepper.modules.MappingSubject baseSubject)
mergeDocumentStructures(SDocument, SDocument).public TokenMergeContainer getContainer()
protected org.corpus_tools.pepper.modules.MappingSubject chooseBaseDocument()
SDocument in which all nodes, relations etc.
have to be merged in in further processing. MappingSubject containing the base documentprotected void normalizePrimaryTexts(org.corpus_tools.salt.common.SDocument sDocument)
SDocument. The
normalized text corresponding to its original is added to the
TokenMergeContainer. Also each token corresponding to its start
and end position in the normalized text is added to the
TokenMergeContainer. SToken are
not determined in any way. For this functionality, you need to use
alignDocuments.sDocument - the SDocument for which the textual layer should be
normalized.protected List<Integer> createBaseTextNormOriginalMapping(org.corpus_tools.salt.common.STextualDS sTextualDS)
sTextualDS - The STextualDSprotected boolean alignTexts(org.corpus_tools.salt.common.STextualDS baseText,
org.corpus_tools.salt.common.STextualDS otherText,
Set<org.corpus_tools.salt.common.SToken> nonEquivalentTokenInOtherTexts,
Map<org.corpus_tools.salt.core.SNode,org.corpus_tools.salt.core.SNode> equivalenceMap)
STextualDS
objects and also aligns the SToken including the creation
of equivalent SToken information. If a SToken has an
equivalent SToken in the base text, it is removed from the
nonEquivalentTokenInOtherTexts set.baseText - the base STextualDSotherText - the other STextualDSnonEquivalentTokenInOtherTexts - A HashSet which contains all tokens which do not have an
equivalent in the base textequivalenceMap - A map of tokens in the other text with their equivalent token
in the base text as valueprotected int indexOfOmitChars(String stringToSearchIn, String stringToSearchFor, boolean useIndexOf, Set<Character> omitChars)
stringToSearchIn - String in which is searchedstringToSearchFor - String which is to searchuseIndexof - If this flag is set, all omit chars are removed from both
provided strings and a normal indexOf is usedomitCharArray - protected void mergeTokens(org.corpus_tools.salt.common.STextualDS baseText,
org.corpus_tools.salt.common.STextualDS otherText,
Map<org.corpus_tools.salt.core.SNode,org.corpus_tools.salt.core.SNode> equivalenceMap)
baseText - otherText - equivalenceMap - Copyright © 2014–2019 Humboldt-Universität zu Berlin. All rights reserved.