splitParagraphs
설명
는 단일 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 .
입력 인수
str
— 입력 텍스트
string형 스칼라 | 문자형 벡터 | 문자형 벡터를 포함하는 스칼라 셀형 배열
입력 텍스트로, string형 스칼라, 문자형 벡터 또는 문자형 벡터를 포함하는 스칼라 셀형 배열로 지정됩니다.
데이터형: string
| char
| cell
document
— 입력 문서
스칼라 tokenizedDocument
객체
입력 문서로, 스칼라 tokenizedDocument
객체로 지정됩니다.
출력 인수
newStr
— 출력 텍스트
string형 배열 | 문자형 벡터로 구성된 셀형 배열
출력 텍스트로, string형 배열 또는 문자형 벡터로 구성된 셀형 배열로 반환됩니다.
str
이 string형이면 newStr
도 string형입니다. 그렇지 않으면, newStr
은 문자형 벡터로 구성된 셀형 배열입니다.
데이터형: string
| cell
newDocuments
— 출력 문서
tokenizedDocument
배열
출력 문서로, tokenizedDocument
배열로 반환됩니다.
버전 내역
R2023a에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)