diff --git a/classifier/README.txt b/classifier/README.txt index 2407089..5a88272 100644 --- a/classifier/README.txt +++ b/classifier/README.txt @@ -128,6 +128,15 @@ that may be identified as being candidates for classification. So we are now ready to have the whole stuff run in one call. >>> classifier.process(r1) + >>> list(sorted([c.title for c in r1.getConcepts()])) + [u'Collection One', u'Contract', u'External File', u'Gerald Webb', u'im Editors'] + + >>> for name in rnames[1:]: + ... classifier.process(resources[name]) + >>> len(webbg.getResources()) + 4 + >>> len(webbg.getResources((concepts['ownedby'],))) + 3 Fin de partie diff --git a/classifier/base.py b/classifier/base.py index 014b4ce..8feda3d 100644 --- a/classifier/base.py +++ b/classifier/base.py @@ -57,13 +57,16 @@ class Classifier(AdapterBase): infoSet.update(extractor.extractInformationSet()) analyzer = component.getAdapter(self, name=self.analyzer) statements = analyzer.extractStatements(infoSet) + defaultPredicate = self.context.getConceptManager().getDefaultPredicate() for statement in statements: if statement.subject is None: statement.subject = resource + if statement.predicate is None: + statement.predicate = defaultPredicate self.assignConcept(statement) def assignConcept(self, statement): - pass + statement.object.assignResource(statement.subject, statement.predicate) class Extractor(object):