필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

search large amount of words

조회 수: 1 (최근 30일)
Rafi Kandli
Rafi Kandli 2017년 9월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi all, I have a string from URL in CHAR form, and i want to execute a search of large amount of words, does someone have an idea how to do that? thank you very much!
  댓글 수: 8
Rafi Kandli
Rafi Kandli 2017년 9월 25일
Thank you all, I have a string of about 80 words and i want to check if at least one word from the string is contained in the text that is extracted from a website.
Walter Roberson
Walter Roberson 2017년 9월 25일
matchpattern = ['(?<=\W)', strjoin(WordListCell, '(?=\W)|(?<=\W)'), '(?=\W)' ];
results = regexp(txt, matchpattern, 'match');
This would be for the case of exact matches of words -- so for example plurals would not be matched, and words with article prefix characters would not be matched. I do not promise that \W knows about the proper classification of Hebrew characters.

답변 (2개)

KSSV
KSSV 2017년 9월 25일
Read about strfind, strcmp, strcmpi and regexp.

Image Analyst
Image Analyst 2017년 9월 25일
What about simply using the contains() function?
Description
TF = contains(str,pattern) returns 1 (true) if str contains the specified pattern, and returns 0 (false) otherwise.
If pattern is an array containing multiple patterns, then contains returns 1 if it finds any element of pattern in str.
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 9월 25일
Note: contains() does not check word boundaries. For example it would find "his" in "this".

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by