Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Parse a sentence into its constituents
ResourceFunction["SentenceConstituents"]["sent"] parses the sentence "sent" into its constituents. |
Get the constituents of a sentence:
| In[1]:= |
| Out[1]= | ![]() |
The sentence does not need to be in the indicative mood; here is an example of the interrogative mood:
| In[2]:= |
| Out[2]= | ![]() |
Use a sentence in the imperative mood:
| In[3]:= |
| Out[3]= | ![]() |
Extract all the prepositional phrases from some text:
| In[4]:= |
| Out[5]= | ![]() |
TextStructure produces the tree, graph, or string version of the entire sentence's nested structure:
| In[6]:= | ![]() |
| Out[7]= | ![]() |
SentenceConstituents distills out the constituents into lists, grouping together all the clauses, noun phrases, etc.:
| In[8]:= |
| Out[8]= | ![]() |
Sentences of extreme complexity can overload SentenceConstituents. In those cases, the function returns a Failure object:
| In[9]:= | ![]() |
| Out[9]= |
SentenceConstituents relies on AI to parse the sentence. It occasionally makes mistakes:
| In[10]:= |
| Out[10]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License