19 lines
678 B
Text
19 lines
678 B
Text
import Utils # To get the FindFirst class
|
|
|
|
procedure main(a)
|
|
showCounts := "--showcounts" == !a
|
|
totals := table(0)
|
|
phrases := ["cei","cie","ei","ie"] # Longer phrases first
|
|
ff := FindFirst(phrases)
|
|
|
|
every map(!&input) ?
|
|
while totals[2(tab(ff.locate()), ff.moveMatch(), move(-1))] +:= 1
|
|
|
|
eiP := totals["cei"] > 2* totals["cie"]
|
|
ieP := (totals["ie"]+totals["cei"]) > 2* totals["ei"]
|
|
write("phrase is ",((\ieP & \eiP),"plausible")|"not plausible")
|
|
write("ie is ",(\ieP,"plausible")|"not plausible")
|
|
write("ei is ",(\eiP,"plausible")|"not plausible")
|
|
|
|
if \showCounts then every write(phrase := !phrases,": ",totals[phrase])
|
|
end
|