Skip to content

Instantly share code, notes, and snippets.

@crcx
Forked from anonymous/,
Created February 18, 2016 11:30
Show Gist options
  • Save crcx/7889b0d1fda5535319ba to your computer and use it in GitHub Desktop.
Save crcx/7889b0d1fda5535319ba to your computer and use it in GitHub Desktop.
0 'Confidence' var!
[ 'var?' ] {
[ 'Probability' ] ::
[ "s-s" dup first uppercase? [ &Probability increment ] if-true ] 'initial' :
[ "s-s" dup 1 fetch lowercase? [ &Probability increment ] if-true ] 'second' :
[ "s-s" dup lookup-function first remark? [ &Probability increment ] if-false drop ] 'no-comment?' :
[ "s-f" \
0 !Probability \
slice-length? \
1 eq? [ initial no-comment? @Probability 2 eq? ] \
[ initial second no-comment? @Probability 3 eq? ] if \
nip \
] 'var?' :
}
[ 'String' 'A' 'a' 'AppleSauce' ] ::
'String' var?
'A' var?
'a' var?
'AppleSauce' var?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment