# How to identify a word from the paragraph

**URL:** https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578
**Category:** Questions about Thunkable X
**Created:** [November 5, 2021, 10:17am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578 "2021-11-05T10:17:32Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 5, 2021, 10:17am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/1 "2021-11-05T10:17:33Z")

</div>

I want to make an app in which I will provide few words to the user and user has to make paragraph by using those words. Once he completes his paragraph, I have to check whether he used the given words in the paragraph or not. However, I am unable to understand which code to use for the same. I tried to code with mentioned below blocks but failed the get the expected result. Kindly help me for the same.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/1/d1007e28cabb943da30e6cf74df7b14a3612be35.png)

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [November 5, 2021, 10:58am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/2 "2021-11-05T10:58:48Z")

</div>

![screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/b/7b1d838860e22ecc0f59252b16a213adfee2a392.png)  
Just an example to guide you

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [November 5, 2021, 11:50am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/3 "2021-11-05T11:50:05Z")

</div>

Welcome to Thunkable.

The approach you have taken is correct but the blocks you have chosen are not. When you loop through a paragraph ( a stream of text) you are actually taking the paragraph character by character.

To convert the paragraph word by word you will need to use the list block  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/49c747d51b3ebf5b586888c3cc81561e8a63602b.png)  
With this block you will make a list of all the words in the paragraph. You need to change the last (pink) option from a **comma** to a **space**.

Now, you can use the blocks that @mimostel demonstrated to get the words of the paragraph one at a time and compare them by your key words.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bca057e754fa8de0da509ca48812c4068e41e89e.png)

Happy Thunking!

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 5, 2021, 12:19pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/4 "2021-11-05T12:19:44Z")

</div>

By taking reference of both the replies I tried the following code but it is still not working.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/a/0a24079b4649f652ae2d0944771cec9fe300bc8f.png)

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 5, 2021, 12:20pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/5 "2021-11-05T12:20:20Z")

</div>

Thanks for the help. However when I run it, even though I use all the words, it still says not all words used.

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [November 5, 2021, 12:28pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/6 "2021-11-05T12:28:49Z")

</div>

> [@manharan.kaurms75yp](#):
>
> it still says not all words used.

The logic is the other way round. Just swap the messages and it should work ok.

However, this method will only tell you if the word is used or not. It will not give you the count and it will not give you how many of your key words are used.

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 5, 2021, 12:36pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/7 "2021-11-05T12:36:41Z")

</div>

Ok thanks for the advice. In order to know about number of words used, shall I use for loop (1 to length of para\_list)?

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [November 5, 2021, 2:11pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/8 "2021-11-05T14:11:29Z")

</div>

> [@muneer](#):
>
> However, this method will only tell you if the word is used or not. It will not give you the count and it will not give you how many of your key words are used.

> [@manharan.kaurms75yp](#):
>
> Once he completes his paragraph, I have to check whether he used the given words in the paragraph or not.

That was the only request 😊

Now:

 ![screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/c/3cf7693f4a0fd0934bc3397140c676a209e4863e.png)

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 9, 2021, 7:58am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/9 "2021-11-09T07:58:17Z")

</div>

I clubbed both the advices and come up with the following code:-

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/5/65e1422d3d439354e6416ad66ae965fb241a1f34.png)

However, it is showing score 1 only. What should I do?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 9, 2021, 8:16am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/10 "2021-11-09T08:16:51Z")

</div>

It works when I preview your project. But the words will only match if the **case** matches. So you need to check to see if the words are lowercase, Sentence Case, or UPPERCASE.

 ![Screen Shot 2021-11-09 at 12.19.57 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0d8329be79bebc619e952d4ef6be6666ef1de927.png)

 ![Screen Shot 2021-11-09 at 12.20.23 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/8/c8a5a94ed8b65da8e47c2d163fc15f984ae23dd2.png)

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 9, 2021, 8:22am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/11 "2021-11-09T08:22:40Z")

</div>

It worked. Thanks for all the help i got from here. It is finally giving me the exact expected result. 😃 😃 😃

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 9, 2021, 8:26am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/12 "2021-11-09T08:26:23Z")

</div>

You’re welcome. I was going to suggest using the `to lower case` block but it sounds like you figured it out.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/4/c46a7e6dbc3e1df6c641359f5053264d8afbb83b.png)

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 9, 2021, 4:10pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/13 "2021-11-09T16:10:20Z")

</div>

Thanks for that. It was thoughtful. 🙂

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [November 9, 2021, 11:19pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/14 "2021-11-09T23:19:19Z")

</div>

> [@manharan.kaurms75yp](#):
>
> I clubbed both the advices and come up with the following code:-
> 
> ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/5/65e1422d3d439354e6416ad66ae965fb241a1f34.png)

I don’t see any difference between do and else… no point to do that if you just want to congratulate for using x words… just set and show alert message without any IF… IF is useful only if you want to give points for a condition. (for example if all words are used).  
And my bad… forgot about sensitive case… thank you @tatiang🤗

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [November 10, 2021, 1:42am UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/15 "2021-11-10T01:42:43Z")

</div>

don’t you want to include punctuation marks (like ?,.;:’"!) in your delimiters? so you can parse out the words correctly from a sentence like (you mean, he didn’t say “Fire!”?).  
if you use only space as delimiter you would get unexpected “words”!

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 10, 2021, 6:09pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/16 "2021-11-10T18:09:39Z")

</div>

This was just for testing so that’s why if else have similar code. I changed it later on as per my requirement. Thanks for your code it made my work very easy. 🙂

---

<div class="post-metadata">

### Author: ![manharan.kaurms75yp](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@manharan.kaurms75yp](https://community.thunkable.com/u/manharan.kaurms75yp)
#### Post date: [November 10, 2021, 6:11pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/17 "2021-11-10T18:11:27Z")

</div>

I replaced all the punctuations with space in my paragraph and then converted it into list. Since this was specimen therefore not all code is mentioned here. Thanks for your consideration. 🙂 🙂

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/how-to-identify-a-word-from-the-paragraph/1598578/18 "2024-11-08T13:14:27Z")

</div>


