探索文本结构
版本 11 包含了全新的高级工具 TextStructure,可用来分析和可视化文本.
生成一个表示普通句子语法结构的 TextElement 对象的嵌套集合.
In[1]:=
![Click for copyable input](assets.zh/explore-the-structure-of-texts/In_94.png)
TextStructure["The cat sat on the mat."]
Out[1]=
![](assets.zh/explore-the-structure-of-texts/O_62.png)
仅显示词类标签.
In[2]:=
![Click for copyable input](assets.zh/explore-the-structure-of-texts/In_95.png)
TextStructure["The cat sat on the mat.", "PartsOfSpeech"]
Out[2]=
![](assets.zh/explore-the-structure-of-texts/O_63.png)
用图形示意语法关系.
In[3]:=
![Click for copyable input](assets.zh/explore-the-structure-of-texts/In_96.png)
TextStructure["The cat sat on the mat.", "DependencyGraphs"]
Out[3]=
![](assets.zh/explore-the-structure-of-texts/O_64.png)