Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Proofread: 07-05-CodeSplitter #36

@chaeyoonyunakim

Description

@chaeyoonyunakim

안녕하세요 @greencode-99 님,
#12 번역 확인입니다.

다음과 같이 크게 세 가지 제안 및 확인 요청을 드리고자 합니다.

  1. 개요 단락 문맥을 해치지 않는 선에서 단어와 문장을 변경하였습니다. 약어 enum의 원어 병행표기 확인 부탁드립니다.
  2. 환경설정 단락 설명 어조을 명령형에서 완화하였습니다. package 대신 bundle 치환 사용 가능한지 확인 부탁드립니다.
  3. (Solidity 예제를 기준으로) 실행순서를 제시하는 대화형으로 전환하였습니다. 타 언어 예시에도 제안 사항이 적절할지 확인 부탁드립니다.

Overview

RecursiveCharacterTextSplitter includes pre-built separator lists optimized for splitting text in different programming languages.

The CodeTextSplitter provides even more specialized functionality for splitting code.

To use it, import the Language enumeration (or enum) and specify the desired programming language.

Environment Setup

Setting up your environment is the first step. See the Environment Setup guide for more details.

[Note]

  • The langchain-opentutorial is a bundle of easy-to-use environment setup guidance, useful functions and utilities for tutorials.
  • Check out the langchain-opentutorial for more details.

Solidity

Here's how to split Solidity code (sotred as a string in the SOL_CODE variable) into smaller chunks by creating a RecursiveCharacterTextSplitter instance called sol_splitter to handle the splitting.

  • First, specify Language.SOL for the language parameter. It tells the splitter you're working with Solidity code.

  • Then, set chunk_size to 128. This limits the size of each resulting chunk to a maximum of 128 characters.

  • Finally, set chunk_overlap to 0. It prevents any of the chunks from overlapping.

  • The sol_splitter.create_documents() method splits the Solidity code(SOL_CODE) into chunks and stores them in the sol_docs variable.

  • Print or display the output(sol_docs) to verify the split.

모두 반영하였을 때 전체 흐름을 보실 수 있게 수정본 커밋 링크 추가하였습니다.

감사합니다.

Metadata

Metadata

Labels

proofreading번역/검수팀 제안사항 반영

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions