Change e letters to i in words: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "{{Draft task}} ;Task: Use the dictionary   [https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt unixdict.txt] Change letters &...")
 
No edit summary
Line 8: Line 8:
If changed word in dictionary show it here on this page.
If changed word in dictionary show it here on this page.


The length of any word shown should have a length > 5.
The length of any word shown should have a length &nbsp; <big>'''>&nbsp; 5</big>.


=={{header|Ring}}==
=={{header|Ring}}==

Revision as of 07:06, 12 February 2021

Change e letters to i in words 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

Use the dictionary   unixdict.txt

Change letters   e   to   i   in words.

If changed word in dictionary show it here on this page.

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

Ring

<lang ring> load "stdlib.ring"

cStr = read("unixdict.txt") wordList = str2list(cStr) num = 0

see "working..." + nl see "Words are:" + nl

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

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

next

for n = 1 to len(wordList)

   ind = substr(wordList[n],"e") 
   if ind > 0
      str = substr(wordList[n],"e","i")
      indstr = find(wordList,str)
      if indstr > 0
         num = num + 1
         see "" + num + ". " + wordList[n] + " >> " + str + nl
      ok
   ok 

next

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

working...
Words are:
1. analyses >> analysis
2. atlantes >> atlantis
3. bellow >> billow
4. breton >> briton
5. clench >> clinch
6. convect >> convict
7. crises >> crisis
8. diagnoses >> diagnosis
9. enfant >> infant
10. enquiry >> inquiry
11. frances >> francis
12. galatea >> galatia
13. harden >> hardin
14. heckman >> hickman
15. inequity >> iniquity
16. inflect >> inflict
17. jacobean >> jacobian
18. marten >> martin
19. module >> moduli
20. pegging >> pigging
21. psychoses >> psychosis
22. rabbet >> rabbit
23. sterling >> stirling
24. synopses >> synopsis
25. vector >> victor
26. welles >> willis
done...