diff --git a/src/app/api/nlp/route.ts b/src/app/api/nlp/route.ts index 276e170..41c53cb 100644 --- a/src/app/api/nlp/route.ts +++ b/src/app/api/nlp/route.ts @@ -1,12 +1,14 @@ import { NextRequest, NextResponse } from 'next/server'; import nlp from 'compromise'; -const MAX_BLOCK_LENGTH = 300; +const MAX_BLOCK_LENGTH = 450; const preprocessSentenceForAudio = (text: string): string => { return text .replace(/\S*(?:https?:\/\/|www\.)([^\/\s]+)(?:\/\S*)?/gi, '- (link to $1) -') - .replace(/(\w+)-\s+(\w+)/g, '$1$2') + .replace(/(\w+)-\s+(\w+)/g, '$1$2') // Remove hyphenation + // Remove special character * + .replace(/\*/g, '') .replace(/\s+/g, ' ') .trim(); };