Add Tamil NER routing and WPF test harness for POC validation.
Introduce dual-script ONNX NER routing (English/Tamil/mixed), Tamil console samples and integration tests, model download scripts, and a resizable WPF MVVM harness with click-to-load prompts, batch validation, and runtime-adjustable detection panels.
This commit is contained in:
54
tests/PiiRedaction.Core.Tests/Detection/ScriptRouterTests.cs
Normal file
54
tests/PiiRedaction.Core.Tests/Detection/ScriptRouterTests.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using FluentAssertions;
|
||||
using PiiRedaction.Core.Detection;
|
||||
using PiiRedaction.Infrastructure.Onnx;
|
||||
|
||||
namespace PiiRedaction.Core.Tests.Detection;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class ScriptRouterTests
|
||||
{
|
||||
private readonly ScriptRouter _router = new();
|
||||
|
||||
[Test]
|
||||
public void GetComposition_LatinOnly_ReturnsLatinOnly()
|
||||
{
|
||||
_router.GetComposition("Customer Ravi Kumar called about billing.")
|
||||
.Should().Be(ScriptComposition.LatinOnly);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetComposition_TamilOnly_ReturnsTamilOnly()
|
||||
{
|
||||
_router.GetComposition("வாடிக்கையாளர் ராஜேஷ் தொலைபேசி 9876543210")
|
||||
.Should().Be(ScriptComposition.TamilOnly);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetComposition_Mixed_ReturnsMixed()
|
||||
{
|
||||
_router.GetComposition("Rajesh மற்றும் Priya disputed the charge.")
|
||||
.Should().Be(ScriptComposition.Mixed);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetComposition_MixedTamilEnglishSample_ReturnsMixed()
|
||||
{
|
||||
_router.GetComposition("வாடிக்கையாளர் Ravi Kumar phone 9876543210 disputed the charge.")
|
||||
.Should().Be(ScriptComposition.Mixed);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetComposition_NoLetters_ReturnsNoLetters()
|
||||
{
|
||||
_router.GetComposition("9876543210 12345")
|
||||
.Should().Be(ScriptComposition.NoLetters);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetComposition_TamilBoundaryChars_AreClassifiedAsTamil()
|
||||
{
|
||||
_router.GetComposition("\u0B80").Should().Be(ScriptComposition.TamilOnly);
|
||||
_router.GetComposition("\u0BFF").Should().Be(ScriptComposition.TamilOnly);
|
||||
_router.GetComposition("A").Should().Be(ScriptComposition.LatinOnly);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user