Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

문자열 조각 나누기

항목값
화면 이름Chunk string
식별자chunkStringV1
지원 실행 방식Batch, Streaming
범주문자열 (String)
반환 자료형Array<String>

문자열을 지정한 크기와 구분자에 따라 여러 조각으로 나눕니다.

입력 인자

이름지정 여부자료형의미와 조건
Expression필수Expression<String>조각으로 나눌 문서 텍스트 열입니다.
Chunk overlap선택Literal<Integer>인접 조각에서 대략 이 문자 수만큼 내용을 겹치게 합니다. 0 이상이고 선택한 조각 크기보다 작아야 합니다.
Chunk size선택Literal<Integer>조각의 목표 문자 수입니다. 0보다 커야 합니다.
Keep separator선택Literal<Boolean>구분자를 출력 조각에 포함할지 지정합니다.
Separators선택List<Literal<String>>문자열을 나눌 구분자들입니다. 기본 구분자는 문단, 문장, 단어 순서로 내용을 가능한 한 함께 유지하도록 동작합니다.

입출력 예시

예시 1: 기본 동작

인자 값:

  • Expression: string
  • Chunk overlap: null
  • Chunk size: 10
  • Keep separator: null
  • Separators: null
string출력
hello[ hello ]
hello world. the quick brown fox jumps over the fence.[ hello, world., the quick, brown fox, jumps, over the, fence. ]
hello world.
the quick brown fox
jumps over the fence.
[ hello, world., the quick, brown fox, jumps, over the, fence. ]
hello world.
the quick brown fox
jumps over the fence.
[ hello, world., the quick, brown fox, jumps, over the, fence. ]

예시 2: 기본 동작

인자 값:

  • Expression: A quick-brown-fox-jumps over the lazy dog
  • Chunk overlap: null
  • Chunk size: 10
  • Keep separator: false
  • Separators: [

    ,
    , ]

출력: [ A, quick-brown-fox-jumps, over the, lazy dog ]

예시 3: 기본 동작

인자 값:

  • Expression: A quick brown fox jumps over the lazy dog
  • Chunk overlap: 5
  • Chunk size: 10
  • Keep separator: null
  • Separators: null

출력: [ A quick, brown fox, fox jumps, over the, the lazy, lazy dog ]

예시 4: 기본 동작

인자 값:

  • Expression: Text1|Text2||Text3
  • Chunk overlap: null
  • Chunk size: 10
  • Keep separator: false
  • Separators: [||, |]

출력: [ Text1, Text2, Text3 ]

예시 5: 기본 동작

인자 값:

  • Expression: Text1|Text2||Text3
  • Chunk overlap: null
  • Chunk size: 10
  • Keep separator: null
  • Separators: [||, |]

출력: [ Text1, |Text2, ||Text3 ]

예시 6: 기본 동작

인자 값:

  • Expression: Text1, Text2

    Text3
    Text4
  • Chunk overlap: null
  • Chunk size: 256
  • Keep separator: null
  • Separators: null

출력: [ Text1, Text2

Text3
Text4 ]

예시 7: 기본 동작

인자 값:

  • Expression: Text1 Text2

    Text3
    Text4
  • Chunk overlap: null
  • Chunk size: 10
  • Keep separator: null
  • Separators: null

출력: [ Text1, Text2, Text3, Text4 ]