v0.2
v0.1
Preparing search index...
The search index is not available
LangChain.js - v0.2.15
LangChain.js
langchain-textsplitters
RecursiveCharacterTextSplitter
Class RecursiveCharacterTextSplitter
Hierarchy (
view full
)
TextSplitter
RecursiveCharacterTextSplitter
MarkdownTextSplitter
LatexTextSplitter
Implements
RecursiveCharacterTextSplitterParams
Index
Constructors
constructor
Properties
chunk
Overlap
chunk
Size
keep
Separator
length
Function
separators
Methods
create
Documents
merge
Splits
split
Documents
split
Text
transform
Documents
from
Language
get
Separators
For
Language
split
On
Separator
Constructors
constructor
new
Recursive
Character
Text
Splitter
(
fields
?
)
:
RecursiveCharacterTextSplitter
Parameters
Optional
fields
:
Partial
<
RecursiveCharacterTextSplitterParams
>
Returns
RecursiveCharacterTextSplitter
Properties
chunk
Overlap
chunk
Overlap
:
number
= 200
chunk
Size
chunk
Size
:
number
= 1000
keep
Separator
keep
Separator
:
boolean
= false
length
Function
length
Function
:
(
(
text
:
string
)
=>
number
)
|
(
(
text
:
string
)
=>
Promise
<
number
>
)
separators
separators
:
string
[]
= ...
Methods
create
Documents
create
Documents
(
texts
,
metadatas
?
,
chunkHeaderOptions
?
)
:
Promise
<
Document
[]
>
Parameters
texts
:
string
[]
metadatas
:
Record
<
string
,
any
>
[]
= []
chunkHeaderOptions
:
TextSplitterChunkHeaderOptions
= {}
Returns
Promise
<
Document
[]
>
merge
Splits
merge
Splits
(
splits
,
separator
)
:
Promise
<
string
[]
>
Parameters
splits
:
string
[]
separator
:
string
Returns
Promise
<
string
[]
>
split
Documents
split
Documents
(
documents
,
chunkHeaderOptions
?
)
:
Promise
<
Document
[]
>
Parameters
documents
:
Document
[]
chunkHeaderOptions
:
TextSplitterChunkHeaderOptions
= {}
Returns
Promise
<
Document
[]
>
split
Text
split
Text
(
text
)
:
Promise
<
string
[]
>
Parameters
text
:
string
Returns
Promise
<
string
[]
>
transform
Documents
transform
Documents
(
documents
,
chunkHeaderOptions
?
)
:
Promise
<
Document
[]
>
Parameters
documents
:
Document
[]
chunkHeaderOptions
:
TextSplitterChunkHeaderOptions
= {}
Returns
Promise
<
Document
[]
>
Static
from
Language
from
Language
(
language
,
options
?
)
:
RecursiveCharacterTextSplitter
Parameters
language
:
|
"html"
|
"ruby"
|
"cpp"
|
"go"
|
"java"
|
"js"
|
"php"
|
"proto"
|
"python"
|
"rst"
|
"rust"
|
"scala"
|
"swift"
|
"markdown"
|
"latex"
|
"sol"
Optional
options
:
Partial
<
RecursiveCharacterTextSplitterParams
>
Returns
RecursiveCharacterTextSplitter
Static
get
Separators
For
Language
get
Separators
For
Language
(
language
)
:
string
[]
Parameters
language
:
|
"html"
|
"ruby"
|
"cpp"
|
"go"
|
"java"
|
"js"
|
"php"
|
"proto"
|
"python"
|
"rst"
|
"rust"
|
"scala"
|
"swift"
|
"markdown"
|
"latex"
|
"sol"
Returns
string
[]
Protected
split
On
Separator
split
On
Separator
(
text
,
separator
)
:
string
[]
Parameters
text
:
string
separator
:
string
Returns
string
[]
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
chunk
Overlap
chunk
Size
keep
Separator
length
Function
separators
Methods
create
Documents
merge
Splits
split
Documents
split
Text
transform
Documents
from
Language
get
Separators
For
Language
split
On
Separator
LangChain.js - v0.2.15
Loading...