Change e letters to i in words: Difference between revisions
Content deleted Content added
m →{{header|Wren}}: Minor tidy |
Not a robot (talk | contribs) add SETL |
||
Line 2,102: | Line 2,102: | ||
26. welles -> willis |
26. welles -> willis |
||
</pre> |
</pre> |
||
=={{header|SETL}}== |
|||
<syntaxhighlight lang="setl">program change_e_letters_to_i_in_words; |
|||
dictfile := open("unixdict.txt", "r"); |
|||
dict := {getline(dictfile) : until eof(dictfile)}; |
|||
close(dictfile); |
|||
loop for word in dict | #word > 5 do |
|||
if "e" notin word then continue; end if; |
|||
iword := replaceall(word, "e", "i"); |
|||
if iword notin dict then continue; end if; |
|||
print([word, iword]); |
|||
end loop; |
|||
proc replaceall(word, x, y); |
|||
loop while x in word do |
|||
word(x) := y; |
|||
end loop; |
|||
return word; |
|||
end proc; |
|||
end program;</syntaxhighlight> |
|||
{{out}} |
|||
<pre>[analyses analysis] |
|||
[atlantes atlantis] |
|||
[bellow billow] |
|||
[breton briton] |
|||
[clench clinch] |
|||
[convect convict] |
|||
[crises crisis] |
|||
[diagnoses diagnosis] |
|||
[enfant infant] |
|||
[enquiry inquiry] |
|||
[frances francis] |
|||
[galatea galatia] |
|||
[harden hardin] |
|||
[heckman hickman] |
|||
[inequity iniquity] |
|||
[inflect inflict] |
|||
[jacobean jacobian] |
|||
[marten martin] |
|||
[module moduli] |
|||
[pegging pigging] |
|||
[psychoses psychosis] |
|||
[rabbet rabbit] |
|||
[sterling stirling] |
|||
[synopses synopsis] |
|||
[vector victor] |
|||
[welles willis]</pre> |
|||
=={{header|Sidef}}== |
=={{header|Sidef}}== |
||
<syntaxhighlight lang="ruby">var file = File("unixdict.txt") |
<syntaxhighlight lang="ruby">var file = File("unixdict.txt") |
||
Line 2,158: | Line 2,206: | ||
26: welles <-> willis |
26: welles <-> willis |
||
</pre> |
</pre> |
||
=={{header|Swift}}== |
=={{header|Swift}}== |
||
<syntaxhighlight lang="swift">import Foundation |
<syntaxhighlight lang="swift">import Foundation |