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$
.
