From 10ec71b76a8d2a8fb3f5e2b8929825f6d9550d82 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Sat, 22 Aug 2026 18:36:47 +0200 Subject: [PATCH] Add dictionary link --- src/Matcher.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Matcher.php b/src/Matcher.php index ac63b62..0d53745 100644 --- a/src/Matcher.php +++ b/src/Matcher.php @@ -7,6 +7,8 @@ use Illuminate\Support\LazyCollection; class Matcher { + private const DICTIONARY = __DIR__ . '/../assets/words.txt'; + public static function findWords(string $anagram, int $minLength = 3): Collection { $matches = self::getWordList() @@ -38,7 +40,7 @@ class Matcher private static function getWordList(): LazyCollection { return LazyCollection::make(function () { - $fh = fopen(DICTIONARY, 'rb'); + $fh = fopen(self::DICTIONARY, 'rb'); try { while (($line = fgets($fh)) !== false) { yield rtrim($line, "\r\n");