From 09188ecab2911efb5b0e65d3e2cc6c04f14da7a3 Mon Sep 17 00:00:00 2001 From: Richard Roberson Date: Thu, 13 Feb 2025 17:17:29 -0700 Subject: [PATCH] Update nlp max length --- src/app/api/nlp/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); };