Beispiel #1
0
 def sentence_walk(self):
     output = []
     sents = tokenize(self.source_text)
     words = set(search.hypernym_search(self.source_text, "artifact"))
     pat = re.compile(" " + "|".join(words) + " ")
     sents = [s for s in sents if pat.search(s) != None]
     pprint(sents)
 def sentence_walk(self):
     output = []
     sents = tokenize(self.source_text)
     words = set(search.hypernym_search(self.source_text, 'artifact'))
     pat = re.compile(' ' + '|'.join(words) + ' ')
     sents = [s for s in sents if pat.search(s) != None]
     pprint(sents)
Beispiel #3
0
def search_line(line, search, searchtype):
    if searchtype == 're':
        return re.search(search, line)  #, re.IGNORECASE)
    elif searchtype == 'pos':
        return Search.search_out(line, search)
    elif searchtype == 'hyper':
        return Search.hypernym_search(line, search)
Beispiel #4
0
def search_line(line, search, searchtype):
    if searchtype == 're':
        return re.search(search, line)  #, re.IGNORECASE)
    elif searchtype == 'pos':
        return Search.search_out(line, search)
    elif searchtype == 'hyper':
        return Search.hypernym_search(line, search)
Beispiel #5
0
    def key_sentences(self):
        words = set(search.hypernym_search(self.source_text, "instrumentality"))
        sents = tokenize(self.source_text)
        pat = re.compile(" " + "|".join(words) + " ")
        sents = [s for s in sents if pat.search(s) != None]

        pprint(sents)
        pprint(words)
    def key_sentences(self):
        words = set(search.hypernym_search(self.source_text,
                                           'instrumentality'))
        sents = tokenize(self.source_text)
        pat = re.compile(' ' + '|'.join(words) + ' ')
        sents = [s for s in sents if pat.search(s) != None]

        pprint(sents)
        pprint(words)