Determine sentence type: Difference between revisions

added Easylang
(Add bruijn)
(added Easylang)
Line 323:
You have been nominated to win one of these! (E)
Just make sure you don''t break it (N)
</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight>
func$ stype s$ .
h$ = substr s$ len s$ 1
ind = strpos "?!." h$ mod1 4
return substr "QESN" ind 1
.
txt$[] = [ "hi there, how are you today?" "I'd like to present to you the washing machine 9001." "You have been nominated to win one of these!" "Just make sure you don't break it" ]
for t$ in txt$[]
print t$ & " -> " & stype t$
.
</syntaxhighlight>
{{out}}
<pre>
hi there, how are you today? -> Q
I'd like to present to you the washing machine 9001. -> S
You have been nominated to win one of these! -> E
Just make sure you don't break it -> N
</pre>
 
1,995

edits