Пример #1
0
 public PlagiarismAnalyzeHandler(IServiceProvider serviceProvider, IPlagiarismSettings plagiarismSettings,
                                 IHashService hashService)
 {
     _plagiarismSettings = plagiarismSettings;
     _hashService        = hashService;
     _serviceProvider    = serviceProvider;
 }
 public void Setup()
 {
     _settings = new PlagiarismSettings()
     {
         Threshold      = 0.6,
         Configurations = new List <ComparisonConfig>
         {
             new() { SamplingWindow = 6, KGramLength = 3 },
             new() { SamplingWindow = 8, KGramLength = 5 }
         }
     };
     _hashService        = new HashService();
     _plagiarismService  = new PlagiarismService(_settings, _hashService);
     _functionsToCompare = new List <FunctionAggregate>(new[]
     {
         GetFunctionAggregate(
             "var serviceProvider = new ServiceCollection().AddLogging().BuildServiceProvider();var factory = serviceProvider.GetService<ILoggerFactory>();"
             )
     });
     _suspectedFunction = GetFunctionAggregate(
         "var serviceProvider = new ServiceCollection().AddLogging().BuildServiceProvider();");
 }