Change e letters to i in words: Difference between revisions

Content deleted Content added
Added Algol 68
MaiconSoft (talk | contribs)
Added Delphi example
Line 103: Line 103:
welles -> willis
welles -> willis
</pre>
</pre>
=={{header|Delphi}}==
{{libheader| System.SysUtils}}
{{libheader| System.Classes}}
<lang Delphi>
program Change_e_letters_to_i_in_words;

{$APPTYPE CONSOLE}

uses
System.SysUtils,
System.Classes;

var
Result: TStringList;

begin
with TStringList.Create do
begin
LoadFromFile('unixdict.txt');
for var i := Count - 1 downto 0 do
if (Strings[i].Length < 6) then
Delete(i);

Result := TStringList.Create;

for var i := Count - 1 downto 0 do
begin
var w_e := Strings[i];

if w_e.IndexOf('e') = -1 then
continue;

var w_i := w_e.Replace('e', 'i', [rfReplaceAll]);
if IndexOf(w_i) > -1 then
Result.Add(format('%s ──► %s', [w_e.PadRight(12), w_i]));
end;

Result.Sort;
writeln(Result.Text);
Free;
end;

readln;
end.</lang>
{{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|Factor}}==
=={{header|Factor}}==