Skip to content

Commit 09188ec

Browse files
committed
Update nlp max length
1 parent 7431817 commit 09188ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/api/nlp/route.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { NextRequest, NextResponse } from 'next/server';
22
import nlp from 'compromise';
33

4-
const MAX_BLOCK_LENGTH = 300;
4+
const MAX_BLOCK_LENGTH = 450;
55

66
const preprocessSentenceForAudio = (text: string): string => {
77
return text
88
.replace(/\S*(?:https?:\/\/|www\.)([^\/\s]+)(?:\/\S*)?/gi, '- (link to $1) -')
9-
.replace(/(\w+)-\s+(\w+)/g, '$1$2')
9+
.replace(/(\w+)-\s+(\w+)/g, '$1$2') // Remove hyphenation
10+
// Remove special character *
11+
.replace(/\*/g, '')
1012
.replace(/\s+/g, ' ')
1113
.trim();
1214
};

0 commit comments

Comments
 (0)