partial word search text analytics toolbox
1 次查看(过去 30 天)
显示 更早的评论
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'
0 个评论
回答(1 个)
Christopher Creutzig
2020-3-9
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{:})
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!