partial word search text analytics toolbox

how do I undertake a partial word search in the text analysis toolbox, so for example I am seacrhing for 'wind' using context, but also want 'winds' or 'windspeed'

回答 (1 件)

Christopher Creutzig
Christopher Creutzig 2020 年 3 月 9 日

0 投票

You could compute those words and then feed them into context:
documents = tokenizedDocument(["A long winding road"; "The winds from the east"]);
words = documents.Vocabulary;
for word=words(startsWith(words,"wind"))
context(documents,word)
end
To get a single table, you can use arrayfun and vertcat on the resulting tables:
documents = tokenizedDocument(["A long winding road"; "The winds from the east"]);
words = documents.Vocabulary;
words = words(startsWith(words,"wind"));
ctx = arrayfun(@(word) context(documents,word), words,'UniformOutput',false);
vertcat(ctx{:})

カテゴリ

製品

リリース

R2019a

質問済み:

2019 年 7 月 22 日

回答済み:

2020 年 3 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by