Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

fix issue #3 (missing results for empty lines) #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMUTweetTagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _call_runtagger(tweets, run_tagger_cmd=RUN_TAGGER_CMD):
# 'Listening on stdin for input. (-h for help)\nDetected text input format\nTokenized and tagged 1 tweets (2 tokens) in 7.5 seconds: 0.1 tweets/sec, 0.3 tokens/sec\n')

pos_result = result[0].strip('\n\n') # get first line, remove final double carriage return
pos_result = pos_result.replace("\n\n","\n\n\n") # avoid missing result for empty lines
pos_result = pos_result.split('\n\n') # split messages by double carriage returns
pos_results = [pr.split('\n') for pr in pos_result] # split parts of message by each carriage return
return pos_results
Expand Down