MATLAB 도움말 센터
단어가 문서에 포함되었는지 검사
R2022b 이후
tf = containsWords(documents,words)
tf = containsWords(documents,words,IgnoreCase=flag)
tf = containsWords(documents,words)는 documents의 토큰이 words와 일치하는 경우 1을 반환하고, 그 외의 경우에는 0을 반환합니다.
tf
documents
words
1
0
예제
tf = containsWords(documents,words,IgnoreCase=flag)는 단어를 검사할 때 대/소문자를 무시할지 여부도 지정합니다.
flag
모두 축소
토큰화된 문서로 구성된 배열을 만듭니다.
documents = tokenizedDocument([ "an example of a short sentence" "a second short sentence"]);
단어 "second"가 포함된 문서를 검사합니다.
"second"
tf = containsWords(documents,"second")
tf = 2×1 logical array 0 1
tokenizedDocument
입력 문서로, tokenizedDocument 배열로 지정됩니다.
pattern
검사할 단어로, 다음 값 중 하나로 지정됩니다.
string형 배열
문자형 벡터
문자형 벡터로 구성된 셀형 배열
pattern 배열
words에 여러 개의 단어가 포함된 경우 함수는 대응되는 문서에 해당 단어가 하나라도 나타나면 1을 반환합니다.
false
true
대/소문자를 무시하는 옵션으로, 다음 값 중 하나로 지정됩니다.
0 (false) – 대/소문자만 다른 일치 항목 후보를 일치하지 않는 것으로 처리합니다.
1 (true) – 대/소문자만 다른 일치 항목 후보를 일치하는 것으로 처리합니다.
데이터형: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
R2022b에 개발됨
contains | containsNgrams | tokenizedDocument | removeWords | removeStopWords | normalizeWords | replaceWords | doclength | context | replace
contains
containsNgrams
removeWords
removeStopWords
normalizeWords
replaceWords
doclength
context
replace
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의