Jump to content

I before E except after C: Difference between revisions

added langur language example
m (→‎{{header|Wren}}: Minor tidy)
(added langur language example)
Line 2,702:
rule is not plausible
</pre>
 
 
=={{header|langur}}==
{{trans|Perl}}
<syntaxhighlight lang="langur">val .words = rest split "\n", readfile "./data/unixdict.txt"
 
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 .keys = fw/ei cei ie cie/
var .count = {:}
 
for .w in .words {
for .k in .keys {
.count[.k; 0] += if(.k in .w: 1; 0)
}
}
 
var .support = .count'ie - .count'cie
var .against = .count'ei - .count'cei
 
var .result = .print(.support, .against)
.result += .print(.count'cei, .count'cie)
 
writeln "Overall: ", if(.result < 2: "NOT "; " "), "PLAUSIBLE\n"</syntaxhighlight>
 
{{out}}
<pre>465 / 213 = 2.18: PLAUSIBLE
13 / 24 = 0.54: NOT PLAUSIBLE
Overall: NOT PLAUSIBLE
</pre>
 
 
=={{header|Lasso}}==
990

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.