Wip Blacklisting dmm porn
Create adult text classifier ML Model wip - starting to write PTN in c# More work on season, show and movie parsing Remove ML project
This commit is contained in:
13
src/producer/Features/Text/FuzzySearcher.cs
Normal file
13
src/producer/Features/Text/FuzzySearcher.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Producer.Features.Text;
|
||||
|
||||
public class FuzzyStringSearcher(IEnumerable<string> records, SearchOptions<string>? options = null) : IFuzzySearcher<string>
|
||||
{
|
||||
private readonly IReadOnlyCollection<string> _records = records.ToList();
|
||||
private readonly SearchOptions<string> _options = options ?? new SearchOptions<string>();
|
||||
|
||||
public IReadOnlyCollection<ExtractedResult<string>> Search(string text)
|
||||
{
|
||||
var dynamicThreshold = (int) Math.Ceiling(text.Length * (_options.Threshold / 100.0));
|
||||
return Process.ExtractSorted(text, _records, cutoff: dynamicThreshold).ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user