We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7431817 commit 09188ecCopy full SHA for 09188ec
src/app/api/nlp/route.ts
@@ -1,12 +1,14 @@
1
import { NextRequest, NextResponse } from 'next/server';
2
import nlp from 'compromise';
3
4
-const MAX_BLOCK_LENGTH = 300;
+const MAX_BLOCK_LENGTH = 450;
5
6
const preprocessSentenceForAudio = (text: string): string => {
7
return text
8
.replace(/\S*(?:https?:\/\/|www\.)([^\/\s]+)(?:\/\S*)?/gi, '- (link to $1) -')
9
- .replace(/(\w+)-\s+(\w+)/g, '$1$2')
+ .replace(/(\w+)-\s+(\w+)/g, '$1$2') // Remove hyphenation
10
+ // Remove special character *
11
+ .replace(/\*/g, '')
12
.replace(/\s+/g, ' ')
13
.trim();
14
};
0 commit comments