예제 #1
0
 def load_axioms(fname):
     for d in datadirs:
         kf = d + fname + '.scm'
         try:
             tmp = open(kf, 'r')
             scheme_wrapper.load_scm(a, kf)
             print kf
             return
         except IOError:
             continue
     raise IOError("missing data file: " + kf)
예제 #2
0
 def load_axioms(fname):
     for d in datadirs:
         kf = d+fname+'.scm'
         try:
             tmp = open(kf,'r')
             scheme_wrapper.load_scm(a, kf)
             print kf
             return
         except IOError:
             continue
     raise IOError("missing data file: "+kf)
예제 #3
0
    def run_pln_example(self, filename):
        self.atomspace.clear()
            
        tmp = open(filename,'r')
        if not scheme_wrapper.load_scm(self.atomspace, filename):
            print 'unable to load file',filename
            return
        print filename

        chainer = Chainer(self.atomspace, stimulateAtoms = False, agent = self, learnRuleFrequencies=False)

        try:
            query = chainer.get_predicate_arguments('query')[0]
            rules_nodes = chainer.get_predicate_arguments('rules')
        except ValueError, e:
            print e
            return
예제 #4
0
    def run_pln_example(self, filename):
        self.atomspace.clear()

        tmp = open(filename, 'r')
        if not scheme_wrapper.load_scm(self.atomspace, filename):
            print 'unable to load file', filename
            return
        print filename

        chainer = Chainer(self.atomspace,
                          stimulateAtoms=False,
                          agent=self,
                          learnRuleFrequencies=False)

        try:
            query = chainer.get_predicate_arguments('query')[0]
            rules_nodes = chainer.get_predicate_arguments('rules')
        except ValueError, e:
            print e
            return