Class Base
This class must be inherited in order to develop a custom copy detectors. This class is in charge of performing the copy detection along the student's files, code the abstract methods and provide all the necessary extra code needed.
Namespace: AutoCheck.Core.CopyDetectors
Assembly: AutoCheck.Core.dll
Syntax
public abstract class Base : IDisposable
Constructors
| Improve this Doc View SourceBase(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 Base(float threshold, int sensibility, string filePattern = "*")
Parameters
Type | Name | Description |
---|---|---|
System.Single | threshold | |
System.Int32 | sensibility | |
System.String | filePattern |
Base(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 Base(float threshold, string filePattern = "*")
Parameters
Type | Name | Description |
---|---|---|
System.Single | threshold | |
System.String | filePattern |
Properties
| Improve this Doc View SourceCount
The amount of items loaded into the copy detector.
Declaration
public abstract int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FilePattern
Pattern that will be used to find and load files within the copy detector.
Declaration
public string FilePattern { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Sensibility
The comparison sensibility, a lower value increases the sensibility so produces more potential copy results.
Declaration
protected int Sensibility { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Threshold
Match values higher than this one, will be considered as a potential copy.
Declaration
public float Threshold { get; protected set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
| Improve this Doc View SourceCompare()
Performs the item comparison between each other.
Declaration
public abstract void Compare()
CopyDetected(String)
Checks if a potential copy has been detected. The Compare() method should be called firts.
Declaration
public abstract 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. |
Dispose()
Disposes the current copy detector instance and releases its internal objects.
Declaration
public abstract void Dispose()
GetDetails(String)
Returns a printable details list, containing information about the comparissons (student, source and % of match).
Declaration
public abstract (string Folder, string File, (string Folder, string File, float Match)[] matches) GetDetails(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Student name |
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. |
Load(Utils.OS, String, String, String, Int32, String)
Loads a remote file into the local collection in order to compare it when Compare() is called.
Declaration
public virtual void Load(Utils.OS os, string host, string username, string password, int port, string path)
Parameters
Type | Name | Description |
---|---|---|
Utils.OS | os | |
System.String | host | Remote OS family. |
System.String | username | The username wich will be used to connect with the remote host. |
System.String | password | The password wich will be used to connect with the remote host. |
System.Int32 | port | |
System.String | path | Path to a file or folder; if the path points to a folder, the first file found using the FilePattern property will be loaded. |
Load(Utils.OS, String, String, String, String)
Loads a remote file into the local collection in order to compare it when Compare() is called.
Declaration
public virtual void Load(Utils.OS os, string host, string username, string password, string path)
Parameters
Type | Name | Description |
---|---|---|
Utils.OS | os | |
System.String | host | Remote OS family. |
System.String | username | The username wich will be used to connect with the remote host. |
System.String | password | The password wich will be used to connect with the remote host. |
System.String | path |
Load(String)
Loads a local file into the local collection in order to compare it when Compare() is called.
Declaration
public virtual void Load(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to a file or folder; if the path points to a folder, the first file found using the FilePattern property will be loaded. |
Load(String, String)
Loads the given file into the local collection, in order to compare it when Compare() is called.
Declaration
public abstract 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. |