initial commit: slides + practica_resueltos + README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Splitters por tipo de contenido
|
||||
|
||||
<v-clicks>
|
||||
|
||||
`RecursiveCharacterTextSplitter.fromLanguage()` usa separadores adaptados a cada formato
|
||||
|
||||
### Markdown — respeta encabezados y listas
|
||||
```typescript
|
||||
import { RecursiveCharacterTextSplitter } from "@langchain/textsplitters";
|
||||
|
||||
const mdSplitter = RecursiveCharacterTextSplitter.fromLanguage("markdown", {
|
||||
chunkSize: 1000, chunkOverlap: 200,
|
||||
});
|
||||
```
|
||||
|
||||
### HTML — respeta estructura de etiquetas
|
||||
```typescript
|
||||
const htmlSplitter = RecursiveCharacterTextSplitter.fromLanguage("html", {
|
||||
chunkSize: 1000, chunkOverlap: 200,
|
||||
});
|
||||
```
|
||||
|
||||
### Código JS/TS — respeta funciones y clases
|
||||
```typescript
|
||||
const codeSplitter = RecursiveCharacterTextSplitter.fromLanguage("js", {
|
||||
chunkSize: 1500, chunkOverlap: 200,
|
||||
});
|
||||
```
|
||||
|
||||
Otros lenguajes soportados: `python`, `java`, `go`, `rust`, `ruby`, `php`...
|
||||
|
||||
</v-clicks>
|
||||
Reference in New Issue
Block a user