Salt  3.4.2
A powerful, tagset-independent and theory-neutral meta model and API for storing, manipulating, and representing nearly all types of linguistic data .
org.corpus_tools.salt.util.internal.DocumentStructureDiff Class Reference

Inherits org.corpus_tools.salt.util.internal.AbstractDiff< SDocumentGraph >.

Public Member Functions

 DocumentStructureDiff (SDocumentGraph template, SDocumentGraph other)
 Initializes Diff object with the two graphs template and other. More...
 
 DocumentStructureDiff (SDocumentGraph template, SDocumentGraph other, DiffOptions optionMap)
 
- Public Member Functions inherited from org.corpus_tools.salt.util.internal.AbstractDiff< SDocumentGraph >
 AbstractDiff (final S template, final S other)
 Initializes Diff object with the two graphs template and other. More...
 
 AbstractDiff (final S template, final S other, DiffOptions optionMap)
 
boolean isIsomorph ()
 Compares the set graphs and returns if they are isomorphic or not. More...
 
Set< DifferencefindDiffs ()
 Compares the set graphs and returns if they are isomorphic or not. More...
 

Protected Member Functions

boolean findDiffs (boolean diffsRequested)
 Compares the set graphs and returns if they are isomorphic or not. More...
 
boolean compareRelations (SDocumentGraph template, List<? extends SRelation > templateRels, SDocumentGraph other, List<? extends SRelation > otherRels, Boolean diff)
 Compares all SPointingRelation of other and template graph. More...
 
boolean compareLayers (SDocumentGraph template, SDocumentGraph other, Boolean diff)
 Compares all layers in template graph with all layers in other graph and searches for isomorphic partners. More...
 
- Protected Member Functions inherited from org.corpus_tools.salt.util.internal.AbstractDiff< SDocumentGraph >
BiMap< SNode, SNodegetIsoNodes ()
 Return BiMap with isomorphic SNodes key= template, value= other. More...
 
Set< DifferencegetDifferences ()
 Returns a list containing all computed differences. More...
 
void addDifference (final Object templateObject, final Object otherObject, final Object container, final DIFF_TYPES diffType, final Set< Difference > subDiffs)
 Adds a difference to the differences set. More...
 
abstract boolean findDiffs (boolean diffsRequested)
 
boolean compareIdentifiableElements (final IdentifiableElement template, final IdentifiableElement other, final Set< Difference > subDiffs)
 Checks whether two IdentifiableElement objects are isomorph. More...
 
boolean compareAnnotationContainers (final SAnnotationContainer template, final SAnnotationContainer other, final Set< Difference > subDiffs)
 Checks whether two SAnnotationContainer objects are isomorph and returns true if this is the case, false otherwise. More...
 

Additional Inherited Members

- Protected Attributes inherited from org.corpus_tools.salt.util.internal.AbstractDiff< SDocumentGraph >
final S templateObject
 
final S otherObject
 
final DiffOptions options
 
Set< Differencedifferences
 
boolean diffsRequested
 if false, only isomorphie is computed, which makes the process faster but does not collect all differences
 

Constructor & Destructor Documentation

◆ DocumentStructureDiff()

org.corpus_tools.salt.util.internal.DocumentStructureDiff.DocumentStructureDiff ( SDocumentGraph  template,
SDocumentGraph  other 
)

Initializes Diff object with the two graphs template and other.

Parameters
template
other

Member Function Documentation

◆ compareLayers()

boolean org.corpus_tools.salt.util.internal.DocumentStructureDiff.compareLayers ( SDocumentGraph  template,
SDocumentGraph  other,
Boolean  diff 
)
protected

Compares all layers in template graph with all layers in other graph and searches for isomorphic partners.

To layers are isomorph, when have the same name and contain the same number of nodes and relations and have the same labels.
When diff is true, the return value is not necessarily correct, since in that case the differences in getDifferences() is computed. To check the isomorphie there must be no differences.

Parameters
template
other
diff
Returns

◆ compareRelations()

boolean org.corpus_tools.salt.util.internal.DocumentStructureDiff.compareRelations ( SDocumentGraph  template,
List<? extends SRelation templateRels,
SDocumentGraph  other,
List<? extends SRelation otherRels,
Boolean  diff 
)
protected

Compares all SPointingRelation of other and template graph.


When diff is true, the return value is not necessarily correct, since in that case the differences in getDifferences() is computed. To check the isomorphie there must be no differences.

Parameters
template
other
diff
Returns

◆ findDiffs()

boolean org.corpus_tools.salt.util.internal.DocumentStructureDiff.findDiffs ( boolean  diffsRequested)
protected

Compares the set graphs and returns if they are isomorphic or not.

If graphs are not isomporphic, this method finds and records all differences and lists them. This means the entire graphs have to be compared and could slow down the computation. If you are only interested in the result and not in the particular differences, use method isIsomorph().

Parameters
diffsRequestedif false, only isomorphie is computed, which makes the process faster but does not collect all differences
Returns
true, if graphs are isomorphic, false otherwise.