# Get the graph from a sentence? Playing with TextStructure

**URL:** <https://community.wolfram.com/t/get-the-graph-from-a-sentence-playing-with-textstructure/8910>\
**Category:** Questions\
**Tags:** graphs-and-networks, computational-linguistics\
**Created:** [July 14, 2016, 10:56am UTC](https://community.wolfram.com/t/get-the-graph-from-a-sentence-playing-with-textstructure/8910 "2016-07-14T10:56:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgealmahecha](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jorgealmahecha/32/3033_2.png) [@jorgealmahecha](https://community.wolfram.com/u/jorgealmahecha)\
**Post date:** [July 14, 2016, 10:56am UTC](https://community.wolfram.com/t/get-the-graph-from-a-sentence-playing-with-textstructure/8910/1 "2016-07-14T10:56:49Z")

</div>

Let’s say you have the sentence:

```
t2 = "The alcohol evaporated because the temperature was so high"

```

“TextStructure”, an experimental function, provides a beautiful sentence constituent graph:

```
gt2 = TextStructure[t2,"ConstituentGraphs"]

```

 ![ScreenShot2016-07-14at6.49.51AM.png](https://global.discourse-cdn.com/wolfram/original/3X/8/b/8b92c57f56fb5673d99cbdf71bda322fa656c722.png)

However, gt2 is not a Graph: GraphQ[gt2] gives a “False” result. In order to have it as a graph, I have to manually select the graph and copy it as “Input Text”.

My question is: how do I make this process of converting the picture to a graph using commands instead of manually?

---

<div class="post-metadata">

**Author:** ![wkan](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wkan/32/15980_2.png) [@wkan](https://community.wolfram.com/u/wkan)\
**Post date:** [July 14, 2016, 3:42pm UTC](https://community.wolfram.com/t/get-the-graph-from-a-sentence-playing-with-textstructure/8910/2 "2016-07-14T15:42:52Z")

</div>

Hi Jorge,

If you take a look at the following:

```
FullForm[gt2]

```

You will see that gt2 is indeed a Graph except it is enclosed by List. This will return True

```
GraphQ[gt2[[1]]]

```

Hope that helps.

Wilson

---

<div class="post-metadata">

**Author:** ![jorgealmahecha](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jorgealmahecha/32/3033_2.png) [@jorgealmahecha](https://community.wolfram.com/u/jorgealmahecha)\
**Post date:** [July 14, 2016, 4:26pm UTC](https://community.wolfram.com/t/get-the-graph-from-a-sentence-playing-with-textstructure/8910/3 "2016-07-14T16:26:19Z")

</div>

That helps a lot, you just made a person very happy today Wilson. Now I can compute all sort of Graph properties on this. My best regards,

Jorge
