RosettaCodeData/Task/I-before-E-except-after-C/Yabasic/i-before-e-except-after-c.basic
2023-07-01 13:44:08 -04:00

24 lines
574 B
Text

open "unixdict.txt" for reading as #1
repeat
line input #1 pal$
if instr(pal$, "ie") then
if instr(pal$, "cie") then CI = CI + 1 else XI = XI + 1 : fi
endif
if instr(pal$, "ei") then
if instr(pal$, "cei") then CE = CE + 1 else XE = XE + 1 : fi
endif
until eof(1)
close #1
print "CIE: ", CI
print "xIE: ", XI
print "CEI: ", CE
print "xEI: ", XE
print "\nI before E when not preceded by C: ";
if 2 * XI <= CI then print "not "; : fi
print "plausible."
print "E before I when preceded by C: ";
if 2 * CE <= XE then print "not "; : fi
print "plausible."
end