How to select only ADJECTIVES from a list of strings?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi
I have a list of words in the string format. See below
I would like to only select adjectives from this list.
How to achieve it? Please help.:)
댓글 수: 4
답변 (1개)
Matt J
2020년 9월 10일
Do you have a list of adjectives to cross check against? And what if a word is both an adjective and a noun, like "orange"? If you just want to know if a word belongs to another list containing exclusively adjectives, you can use ismember, e.g.,
>> adjectives={'red','three','passive','candid'};
>> s=["red","person","woman","man","camera","tv","three"]
>> ismember(s,adjectives)
ans =
1×7 logical array
1 0 0 0 0 0 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!