mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-16 07:14:29 -04:00
Add more Acronyms on SentenceSplitter (#2022)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@llamaindex/core": patch
|
||||
---
|
||||
|
||||
Add more Acronyms on SentenceSplitter
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user