NIHOPA / NLPre

Python library for Natural Language Preprocessing (NLPre)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace acronym fails with parenthesis

thoppe opened this issue · comments

from nlpre import replace_acronyms

text = '''
BEACH (beige and Chediak Higashi) domain containing proteins (BDCPs) are a highly conserved protein family in eukaryotes.
'''

ABBR = { (('BEACH', 'domain', 'containing', 'proteins'), 'BDCPs'): 1}
P1 = replace_acronyms(ABBR)
print P1(text)
Traceback (most recent call last):
  File "tx.py", line 31, in <module>
    print P1(text)
  File "/home/hoppeta/git-repo/NLPre/nlpre/replace_acronyms.py", line 229, in __call__
    highest_phrase = '_'.join(highest_phrase)
TypeError: sequence item 1: expected string, ParseResults found