Words containing "the" substring

From Rosetta Code
Revision as of 08:56, 6 December 2020 by CalmoSoft (talk | contribs) (Created page with "{{Draft task}} ;Task: Using the dictionary   [https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt unixdict.txt],   search...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Words containing "the" substring is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
Task

Using the dictionary   unixdict.txt,   search words containing "the" substring,
then display the found words (on this page).

The length of any word shown should have a length   >  11.

Ring

<lang ring> cStr = read("unixdict.txt") wordList = str2list(cStr) num = 0 the = "the"

see "working..." + nl

ln = len(wordList) for n = ln to 1 step -1

   if len(wordList[n]) < 12
      del(wordList,n)
   ok

next

see "Words containing "the" substring:" + nl

for n = 1 to len(wordList)

   ind = substr(wordList[n],the)
   if ind > 0
      num = num +1
      see "" + num + ". " + wordList[n] + nl
   ok

next

see "done..." + nl </lang> Output:

working...
Founded "the" words are:
1. authenticate
2. chemotherapy
3. chrysanthemum
4. clothesbrush
5. clotheshorse
6. eratosthenes
7. featherbedding
8. featherbrain
9. featherweight
10. gaithersburg
11. hydrothermal
12. lighthearted
13. mathematician
14. neurasthenic
15. nevertheless
16. northeastern
17. northernmost
18. otherworldly
19. parasympathetic
20. physiotherapist
21. physiotherapy
22. psychotherapeutic
23. psychotherapist
24. psychotherapy
25. radiotherapy
26. southeastern
27. southernmost
28. theoretician
29. weatherbeaten
30. weatherproof
31. weatherstrip
32. weatherstripping
done...