Main Content

splitParagraphs

텍스트를 단락으로 분할

R2023a 이후

    설명

    예제

    newStr = splitParagraphs(str)str을 단락으로 구성된 배열로 분할합니다.

    newDocuments = splitParagraphs(document)는 단일 tokenizedDocument 객체를 단락으로 구성된 tokenizedDocument 배열로 분할합니다.

    예제

    모두 축소

    파일 exampleParagraphs.txt에서 텍스트를 추출합니다.

    str = extractFileText("exampleParagraphs.txt")
    str = 
        "This example file contains three paragraphs. The first paragraph contains three sentences. The third sentence is short.
         
         The second paragraph contains one sentence only.
         
         The third (and final) paragraph has seventeen words in total. The final sentence concludes the example file.
         "
    
    

    텍스트를 단락으로 분할합니다.

    paragraphs = splitParagraphs(str)
    paragraphs = 3x1 string
        "This example file contains three paragraphs. The first paragraph contains three sentences. The third sentence is short."
        "The second paragraph contains one sentence only."
        "The third (and final) paragraph has seventeen words in total. The final sentence concludes the example file...."
    
    

    파일 exampleParagraphs.txt에서 텍스트를 추출한 다음 토큰화합니다.

    str = extractFileText("exampleParagraphs.txt");
    document = tokenizedDocument(str)
    document = 
      tokenizedDocument:
    
       49 tokens: This example file contains three paragraphs . The first paragraph contains three sentences . The third sentence is short . The second paragraph contains one sentence only . The third ( and final ) paragraph has seventeen words in total . The final sentence concludes the example file .
    
    

    문서를 단락으로 분할합니다.

    paragraphs = splitParagraphs(document)
    paragraphs = 
      3x1 tokenizedDocument:
    
        20 tokens: This example file contains three paragraphs . The first paragraph contains three sentences . The third sentence is short .
         8 tokens: The second paragraph contains one sentence only .
        21 tokens: The third ( and final ) paragraph has seventeen words in total . The final sentence concludes the example file .
    
    

    입력 인수

    모두 축소

    입력 텍스트로, string형 스칼라, 문자형 벡터 또는 문자형 벡터를 포함하는 스칼라 셀형 배열로 지정됩니다.

    데이터형: string | char | cell

    입력 문서로, 스칼라 tokenizedDocument 객체로 지정됩니다.

    출력 인수

    모두 축소

    출력 텍스트로, string형 배열 또는 문자형 벡터로 구성된 셀형 배열로 반환됩니다.

    str이 string형이면 newStr도 string형입니다. 그렇지 않으면, newStr은 문자형 벡터로 구성된 셀형 배열입니다.

    데이터형: string | cell

    출력 문서로, tokenizedDocument 배열로 반환됩니다.

    버전 내역

    R2023a에 개발됨