]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/ChatlibDatabase.php
further refine chat gen
[alttp.git] / app / Console / Commands / ChatlibDatabase.php
index bfe0135c4b8e00e684a9f2974faf862f447296fd..280d4a0c6351e29fd04a2ee0d31c4d0a68fe1712 100644 (file)
@@ -34,6 +34,9 @@ class ChatlibDatabase extends Command {
                ChatLog::where('type', '=', 'chat')
                        ->where('banned', '=', false)
                        ->whereNotNull('evaluated_at')
+                       ->where('created_at', '<', now()->sub(7, 'day'))
+                       ->whereNotIn('classification', ['gg', 'gl', 'number', 'o7'])
+                       ->whereRaw('LENGTH(`text_content`) > 12')
                        ->chunk(5000, function ($msgs) use ($de, $en) {
                                foreach ($msgs as $msg) {
                                        if ($msg->detected_language === 'de') {
@@ -48,16 +51,10 @@ class ChatlibDatabase extends Command {
                        });
 
                $de->compile();
-               $en->compile();
+               $de->saveAs('de');
 
-               $this->line('');
-               for ($i = 0; $i < 50; ++$i) {
-                       $this->line($de->generate());
-               }
-               $this->line('');
-               for ($i = 0; $i < 50; ++$i) {
-                       $this->line($en->generate());
-               }
+               $en->compile();
+               $en->saveAs('en');
 
                return 0;
        }