Group Abstract Group Abstract

Message Boards Message Boards

Why should add First before TextStructure when use CommunityGraphPlot?

Posted 2 years ago

CommunityGraphPlot[ First[TextStructure[First[TextSentences[WikipediaData["language"]]], "ConstituentGraphs"]]]

Hello,
I see this code on my book. I am confused why added the First before the

TextStructure[First[TextSentences[WikipediaData["language"]]],
"ConstituentGraphs"]]

I know no First will cause error, but I don't know why should add it?
Thanks.

POSTED BY: Zhenyu Zeng
4 Replies
Posted 2 years ago

Thanks for your kind reply. I know now.

POSTED BY: Zhenyu Zeng
Posted 2 years ago

TextStructure returns a list. The text can be multiple sentences, in which case the list contains an element for each sentence. CommunityGraphPlot requires a Graph as input, not a List of Graph.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

The structure of the sentence according to the words in it? What's the answer and hot to get the answer from MMA?

POSTED BY: Zhenyu Zeng

What is TextStructure returning?

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard