Class PlainText
Copy detector for plain text files.
Inherited Members
Namespace: AutoCheck.Core.CopyDetectors
Assembly: AutoCheck.Core.dll
Syntax
public class PlainText : Base
Constructors
| Improve this Doc View SourcePlainText(Single, Int32, String)
Creates a new instance, setting up its properties in order to allow copy detection with the lowest possible false-positive probability.
Declaration
public PlainText(float threshold, int sensibility, string filePattern = "*.txt")
Parameters
Type | Name | Description |
---|---|---|
System.Single | threshold | |
System.Int32 | sensibility | |
System.String | filePattern |
PlainText(Single, String)
Creates a new instance, setting up its properties in order to allow copy detection with the lowest possible false-positive probability.
Declaration
public PlainText(float threshold, string filePattern = "*.txt")
Parameters
Type | Name | Description |
---|---|---|
System.Single | threshold | |
System.String | filePattern |
Properties
| Improve this Doc View SourceCount
The quantity of files loaded.
Declaration
public override int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceDiffs
Declaration
protected List<Diff>[, ] Diffs { get; set; }
Property Value
Type | Description |
---|---|
List<Diff>[,] |
Files
Declaration
protected List<PlainText.File> Files { get; set; }
Property Value
Type | Description |
---|---|
List<PlainText.File> |
Index
Declaration
protected Dictionary<string, int> Index { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.Int32> |
LineCountWeight
The weight that line counting (different documents with the same amount of lines) will have when computing the global matching percentage.
Declaration
protected float LineCountWeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Matches
Declaration
protected float[, ] Matches { get; set; }
Property Value
Type | Description |
---|---|
System.Single[,] |
SentenceMatchWeight
The weight that sentence matching (different documents with the same sentences within) will have when computing the global matching percentage.
Declaration
protected float SentenceMatchWeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
WordCountWeight
The weight that word counting (different documents with the same amount of words) will have when computing the global matching percentage.
Declaration
protected float WordCountWeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
| Improve this Doc View SourceCompare()
Compares all the previously loaded files, between each other.
Declaration
public override void Compare()
Overrides
| Improve this Doc View SourceCopyDetected(String)
Checks if a potential copy has been detected. The Compare() method should be called firts.
Declaration
public override bool CopyDetected(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to a compared file. |
Returns
Type | Description |
---|---|
System.Boolean | True of copy has been detected. |
Overrides
| Improve this Doc View SourceDispose()
Disposes the current copy detector instance and releases its internal objects.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceGetDetails(String)
Returns a printable details list, containing information about the comparissons (student, source and % of match).
Declaration
public override (string Folder, string File, (string Folder, string File, float Match)[] matches) GetDetails(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where the files has been loaded. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.String, System.String, System.ValueTuple<System.String, System.String, System.Single>[]> | Left file followed by all the right files compared with its matching score. |
Overrides
| Improve this Doc View SourceLoad(String, String)
Loads the given file into the local collection, in order to compare it when Compare() is called.
Declaration
public override void Load(string folder, string file)
Parameters
Type | Name | Description |
---|---|---|
System.String | folder | Path where the files will be looked for. |
System.String | file | File that will be loaded into the copy detector. |