I before E except after C: Difference between revisions

No edit summary
Line 2,706:
=={{header|langur}}==
{{trans|Perl}}
<syntaxhighlight lang="langur">val .words = rest split "\n", readfile "./data/unixdict.txt"
val words = split("\n", readfile("./data/unixdict.txt")) -> rest
 
val .print = impure fn(.support, .against) {
val .ratio = .support / .against
writeln "{{.support}} / {{.against}} = {{.ratio : r2}}:", if(.ratio < 2:) * " NOT"; ""), " PLAUSIBLE"
return if(.ratio >= 2: 1; 0)
}
 
val .keysks = fw/ei cei ie cie/
var .countcnt = {:}
 
for .w in .words {
for .k in .keysks {
.countcnt[.k; 0] += if(.k in .w: 1; 0)
}
}
 
var .support = .countcnt'ie - .countcnt'cie
var .against = .countcnt'ei - .countcnt'cei
 
var .result = .print(.support, .against)
.result += .print(.countcnt'cei, .countcnt'cie)
 
writeln "Overall:", if(.result < 2:) * " NOT"; ""), " PLAUSIBLE\n"
</syntaxhighlight>
 
1,007

edits