テキストの構造を調べる
バージョン11では,テキストを分析し可視化するための高度な新ツール,TextStructureが導入された.
一般的な文の文法構造を表すTextElementオブジェクトのネストした集合を生成する.
In[1]:=
![Click for copyable input](assets.ja/explore-the-structure-of-texts/In_94.png)
TextStructure["The cat sat on the mat."]
Out[1]=
![](assets.ja/explore-the-structure-of-texts/O_62.png)
品詞タグのみを表示する.
In[2]:=
![Click for copyable input](assets.ja/explore-the-structure-of-texts/In_95.png)
TextStructure["The cat sat on the mat.", "PartsOfSpeech"]
Out[2]=
![](assets.ja/explore-the-structure-of-texts/O_63.png)
文法的依存関係をグラフとして返す.
In[3]:=
![Click for copyable input](assets.ja/explore-the-structure-of-texts/In_96.png)
TextStructure["The cat sat on the mat.", "DependencyGraphs"]
Out[3]=
![](assets.ja/explore-the-structure-of-texts/O_64.png)