pubmed/functions.py
def search_abstract(article,terms,stem=False):
    '''search_article
    Search article for one or more terms of interest - no processing of expression. return 1 if found, 0 if not

    article: Article 
        an Article object
    terms: str/list
        a list of terms to be compiled with re
    stem: boolean
        if True, stem article words first
    '''
    text = [article.getAbstract()] + article.getMesh() + article.getKeywords()
    text = text[0].lower()

    # Perform stemming of terms    
    if stem:
        words = do_stem(terms,return_unique=True)

    term = "|".join([x.strip(" ").lower() for x in words])
    expression = re.compile(term)
    # Search abstract for terms, return 1 if found
    found = expression.search(text)
    if found:
        return 1
    return 0
search_article
    Search article for one or more terms of interest - no processing of expression. return 1 if found, 0 if not

    article: Article 
        an Article object
    terms: str/list
        a list of terms to be compiled with re
    stem: boolean
        if True, stem article words first
    
search_article
Search article for one or more terms of interest - no processing of expression. return 1 if found, 0 if not

Article
an Article object
terms: str/list
a list of terms to be compiled with re
stem: boolean
if True, stem article words first
search_article Search article for one or more terms of interest - no processing of expression . return 1 if found 0 if not Article an Article object terms : str / list a list of terms to be compiled with re stem : boolean if True stem article words first
def search_abstract(article,terms,stem=False):
    text = [article.getAbstract()] + article.getMesh() + article.getKeywords()
    text = text[0].lower()
    if stem:
        words = do_stem(terms,return_unique=True)
    term = "|".join([x.strip(" ").lower() for x in words])
    expression = re.compile(term)
    found = expression.search(text)
    if found:
        return 1
    return 0
def search_abstract ( article , terms , stem = False ) : text = [ article . getAbstract ( ) ] + article . getMesh ( ) + article . getKeywords ( ) text = text [ 0 ] . lower ( ) if stem : words = do_stem ( terms , return_unique = True ) term = "|" . join ( [ x . strip ( " " ) . lower ( ) for x in words ] ) expression = re . compile ( term ) found = expression . search ( text ) if found : return 1 return 0
search_article
Search article for one or more terms of interest - no processing of expression.
search_article Search article for one or more terms of interest - no processing of expression .
'''search_article
    Search article for one or more terms of interest - no processing of expression. return 1 if found, 0 if not

    article: Article 
        an Article object
    terms: str/list
        a list of terms to be compiled with re
    stem: boolean
        if True, stem article words first
    ''' # Perform stemming of terms     # Search abstract for terms, return 1 if found
article
terms
stem