예제 #1
0
    def parse_to_readings(self, sentence):
        """:see: ReadingCommand.parse_to_readings()"""
        from nltk.sem import root_semrep

        tokens = sentence.split()
        trees = self._parser.parse(tokens)
        return [root_semrep(tree) for tree in trees]
예제 #2
0
    def parse_to_readings(self, sentence):
        """:see: ReadingCommand.parse_to_readings()"""
        from nltk.sem import root_semrep

        tokens = sentence.split()
        trees = self._parser.parse(tokens)
        return [root_semrep(tree) for tree in trees]
예제 #3
0
파일: discourse.py 프로젝트: DrDub/icsisumm
 def _get_readings(self, sentence):
     """
     Build a list of semantic readings for a sentence.
     
     @rtype: C{list} of  L{logic.Expression}.
     """
     tokens = sentence.split()
     trees = self._parser.nbest_parse(tokens)
     return [root_semrep(tree) for tree in trees]    
예제 #4
0
def demo():
    cp = parse.load_parser('file:rdf.fcfg', trace=0)
    tokens = 'list the actors in the_shining'.split()
    trees = cp.nbest_parse(tokens)
    tree = trees[0]
    semrep = sem.root_semrep(tree)
    trans = SPARQLTranslator()
    trans.translate(semrep)
    print trans.query
예제 #5
0
def demo():
    cp = parse.load_parser('file:rdf.fcfg', trace=0)
    tokens = 'list the actors in the_shining'.split()
    trees = cp.nbest_parse(tokens)
    tree = trees[0]
    semrep = sem.root_semrep(tree)
    trans = SPARQLTranslator()
    trans.translate(semrep)
    print trans.query
예제 #6
0
 def _get_readings(self, sentence):
     """
     Build a list of semantic readings for a sentence.
     
     @rtype: C{list} of  L{logic.Expression}.
     """
     tokens = sentence.split()
     trees = self._parser.nbest_parse(tokens)
     return [root_semrep(tree) for tree in trees]
예제 #7
0
 def parse_to_readings(self, sentence):
     """@see: ReadingCommand.parse_to_readings()"""
     tokens = sentence.split()
     trees = self._parser.nbest_parse(tokens)
     return [root_semrep(tree) for tree in trees]
예제 #8
0
 def parse_to_readings(self, sentence):
     """@see: ReadingCommand.parse_to_readings()"""
     tokens = sentence.split()
     trees = self._parser.nbest_parse(tokens)
     return [root_semrep(tree) for tree in trees]