Class NgramMatch
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.model.base.detection.NgramMatch
-
- All Implemented Interfaces:
java.io.Serializable
public class NgramMatch extends java.lang.Object implements java.io.SerializableContains all data for a single matched pair.Contains: Start and end lines for block in reference file, Start and end lines for block in checked file, The float value denoting similarity between the 2 blocks, A pointer to the reference file (File1), A pointer to the checked file (File2).
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description booleancommonUsed to allow skipping during score methods if the math is considered common.ISourceFile[]filesThe two files with matching sections.java.util.ArrayList<Tuple<java.lang.Integer,java.lang.Integer>>linesThe line positions of both blocks.floatsimilarityThe similarity between the section of both files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(NgramMatch pair)Checks if the two stored blocks are the same.
-
-
-
Field Detail
-
lines
public java.util.ArrayList<Tuple<java.lang.Integer,java.lang.Integer>> lines
The line positions of both blocks.
-
similarity
public float similarity
The similarity between the section of both files.
-
files
public ISourceFile[] files
The two files with matching sections.
-
common
public boolean common
Used to allow skipping during score methods if the math is considered common. Is now redundant due to depreciation, but has been left in if needed in future use cases.
-
-
Method Detail
-
equals
public boolean equals(NgramMatch pair)
Checks if the two stored blocks are the same.- Parameters:
pair- The match to check for equality.- Returns:
- True if the blocks are the same.
-
-