id
string | status
string | _server_id
string | code
string | span_label.responses
list | span_label.responses.users
sequence | span_label.responses.status
sequence |
---|---|---|---|---|---|---|
599f6f88-38e3-4275-b2ca-a75827a1b8ae | completed | bf8e3b61-a7c2-4ac9-bb2e-18f886ac2acd | function [paragraphs, wordCounts, maxWordCount, maxParagraph] = processTextDocument(str)
% Counts words in each paragraph and identifies the paragraph with the maximum number of words.
% Split the document into paragraphs
paragraphs = splitParagraphs(str);
% Initialize an array to store word counts
wordCounts = zeros(1, length(paragraphs));
% Loop through each paragraph to count the number of words
for i = 1:length(paragraphs)
words = strsplit(paragraphs{i});
wordCounts(i) = length(words);
end
[maxWordCount, idx] = max(wordCounts);
% Identify the paragraph with the maximum word count
if isempty(idx)
maxParagraph = "";
wordCounts = 0;
maxWordCount = 0;
else
maxParagraph = paragraphs(idx);
end
end | [
[
{
"end": 46,
"label": "REMOVE",
"start": 9
},
{
"end": 825,
"label": "REMOVE",
"start": 723
}
]
] | [
"344fe7e0-81e4-443c-a7de-a35222018436"
] | [
"submitted"
] |