now filtering out words with <4 lettters

This commit is contained in:
Andrzej Stepien 2023-08-09 20:46:52 +02:00
parent a16cc64648
commit 7017017814
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,8 @@ import { db } from "./db.mjs"
const blocklist = db.union([ const blocklist = db.union([
db('bad_words').select('word'), db('bad_words').select('word'),
db('medical_procedures').select('name'), db('medical_procedures').select('name'),
db('diseases').select('name') db('diseases').select('name'),
db('medical_dictionary').select('word')
]) ])
@ -19,6 +20,7 @@ export default async function getNewPrompt({ minCount = 200000, maxCount = 30000
.andWhere('count', '<', maxCount) .andWhere('count', '<', maxCount)
.andWhere('count', '>', minCount) .andWhere('count', '>', minCount)
.andWhere('word', 'not in', blocklist) .andWhere('word', 'not in', blocklist)
.whereRaw('length(word) > 3')
.whereNotNull('pronunciation') .whereNotNull('pronunciation')
.orderByRaw('count desc') .orderByRaw('count desc')