Determine sentence type: Difference between revisions

m
→‎{{header|Python}}: Reinterpreted N tag as 'not puncuated'
m (→‎{{header|Python}}: Reinterpreted N tag as 'not puncuated')
Line 355:
def go(sentences):
return [
(tagDict.get(k, 'NNot punctuated'), list(v))
for (k, v) in groupby(
sorted(sentences, key=last),
Line 393:
# main :: IO ()
def main():
'''TestJoin, segmentation, tags'''
 
tags = {'!': 'E', '?': 'Q', '.': 'S'}
Line 405:
"Feels as light as polystyrene filler.",
"But perhaps substance isn't the goal!",
"Just make sure you don't break itoff before the"
])
 
Line 459:
('S', ["I'd like to present to you the washing machine 9001.", 'Feels as light as polystyrene filler.'])
('Q', ['Hi there, how are you today?', 'Might it be possible to add some challenge to this task?'])
('NNot punctuated', ["Just make sure you don't break itoff before the"])</pre>
 
=={{header|Raku}}==
9,655

edits