Determine sentence type: Difference between revisions
m
→{{header|Python}}: Reinterpreted N tag as 'not punctuated'
m (→{{header|Python}}: Reinterpreted N tag as 'not puncuated') |
m (→{{header|Python}}: Reinterpreted N tag as 'not punctuated') |
||
Line 397:
tags = {'!': 'E', '?': 'Q', '.': 'S'}
# Joined by spaces,
sample = ' '.join([
"Hi there, how are you today?",
Line 408:
])
#
sentences = sentenceSegments(
tags.keys()
)(sample)
#
for kv in tagGroups(tags)(sentences):
print(kv)
|