Add more Acronyms on SentenceSplitter (#2022)

Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
This commit is contained in:
Broda Noel
2025-06-17 00:43:36 -03:00
committed by GitHub
parent 8122c7245e
commit c5b2691302
2 changed files with 39 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@llamaindex/core": patch
---
Add more Acronyms on SentenceSplitter
+34
View File
@@ -39,11 +39,45 @@ let sentenceTokenizer: SentenceTokenizer | null = null;
export const splitBySentenceTokenizer = (): TextSplitterFn => {
if (!sentenceTokenizer) {
sentenceTokenizer = new SentenceTokenizer([
// TODO: This should be improved. Take a look at: https://github.com/run-llama/LlamaIndexTS/issues/2019
// English
"i.e.",
"etc.",
"vs.",
"Inc.",
"A.S.A.P.",
"Mr.",
"Mrs.",
"Ms.",
"Dr.",
"Prof.",
"Sr.",
"Jr.",
// Spanish
"Sr.",
"Sres.",
"Srs.",
"Sra.",
"Sras.",
"Srta.",
"Srtas.",
"Dr.",
"Drs.",
"Dra.",
"Dras.",
"Prof.",
"Profs.",
"Profa.",
"Profas.",
"Ing.",
"Lic.",
"Arq.",
"Ab.",
"Abs.",
"Tel.",
"a.m.",
"p.m.",
"Art.",
]);
}
const tokenizer = sentenceTokenizer;