feat: scan

This commit is contained in:
hashbro
2026-09-13 02:12:06 +08:00
parent d7bd4d1b03
commit 1746e7b485
13 changed files with 266 additions and 40 deletions
+15
View File
@@ -117,6 +117,21 @@ TXT;
$this->assertSame(12, $hit['word_count']);
}
#[Test]
public function notes_keep_inline_and_glued_numbered_phrase(): void
{
$phrase = 'during exhaust tool custom smart old busy region skin wasp attitude wrist';
$spaced = '1 during 2 exhaust 3 tool 4 custom 5 smart 6 old 7 busy 8 region 9 skin 10 wasp 11 attitude 12 wrist';
$glued = '1.during 2.exhaust 3.tool 4.custom 5.smart 6.old 7.busy 8.region 9.skin 10.wasp 11.attitude 12.wrist';
foreach ([$spaced, $glued] as $text) {
$hit = (new MnemonicDetector)->detect($text, true);
$this->assertNotNull($hit);
$this->assertTrue($hit['confirmed']);
$this->assertSame($phrase, $hit['candidate']);
}
}
#[Test]
public function prefers_english_phrase_over_chinese_ui(): void
{