コード例 #1
0
ファイル: metamap_fielded.py プロジェクト: nhsland/MEDRank
 def is_ignorable(self, a_line):
     """Check to see if a line should be processed - in the case of 
     METAMAP fielded output, we only want to process actual concept 
     lines. The type of line is determined by the third field of the tab-
     separated list. But first we check to see if the line passes the 
     original tests."""
     # This will preserve the original behavior before adding extra checks
     if ChunkedNLMOutput.is_ignorable(self, a_line):
         return True
     try:
         line_type=a_line.split('\t')[2].lower().strip()
     except IndexError:
         # If it doesn't have a type field, we don't want the line.
         return True
     return line_type!='c' # We only want lines with 'c'