Determine sentence type: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Added a more general variant, as an alternative to hand-crafted regular expressions.) |
(Added English End of Sentence Punctuation) |
||
Line 3: | Line 3: | ||
[[Category:String manipulation]] |
[[Category:String manipulation]] |
||
Use |
Use these sentences: |
||
"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" |
"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." |
||
;Task |
;Task |
||
: Search for the last used punctuation in a sentence, and determine its type according to its punctuation |
: Search for the last used punctuation in a sentence, and determine its type according to its punctuation. |
||
; Output one of these letters: "E" (Exclamation!), "Q" (Question?), "S" (Serious.), "N" (Neutral) |
; Output one of these letters: "E" (Exclamation!), "Q" (Question?), "S" (Serious.), "N" (Neutral). |
||
;Extra |
;Extra |
||
: Make your code able to determine multiple sentences |
: Make your code able to determine multiple sentences. |
||