docs: #302 a little tweak to find more duplicates
This commit is contained in:
parent
ecda39ded9
commit
df81656953
@ -71,22 +71,26 @@ namespace RMuseum.Services.Implementation
|
||||
bool found = false;
|
||||
foreach (var probable in probablyTheOnes)
|
||||
{
|
||||
var meVerse = await context.GanjoorVerses.AsNoTracking().Where(p => p.PoemId == probable.Id).OrderBy(v => v.VOrder).FirstAsync();
|
||||
if(_AreSimilar(firstVerse.Text, meVerse.Text, false))
|
||||
var targetVerses = await context.GanjoorVerses.AsNoTracking().Where(p => p.PoemId == probable.Id).OrderBy(v => v.VOrder).ToListAsync();
|
||||
foreach (var targetVerse in targetVerses)
|
||||
{
|
||||
context.GanjoorDuplicates.Add
|
||||
(
|
||||
new GanjoorDuplicate()
|
||||
{
|
||||
SrcCatId = srcCatId,
|
||||
SrcPoemId = poem.Id,
|
||||
DestPoemId = probable.Id
|
||||
}
|
||||
);
|
||||
await context.SaveChangesAsync();
|
||||
found = true;
|
||||
break;
|
||||
if (_AreSimilar(firstVerse.Text, targetVerse.Text, false))
|
||||
{
|
||||
context.GanjoorDuplicates.Add
|
||||
(
|
||||
new GanjoorDuplicate()
|
||||
{
|
||||
SrcCatId = srcCatId,
|
||||
SrcPoemId = poem.Id,
|
||||
DestPoemId = probable.Id
|
||||
}
|
||||
);
|
||||
await context.SaveChangesAsync();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
if (found) continue;
|
||||
foreach (var probable in targetPoems)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user