public final class ProjogSourceReader extends Object
KnowledgeBase
with clauses parsed from Prolog syntax.
Modifier and Type | Method and Description |
---|---|
static void |
parseFile(KnowledgeBase kb,
File prologSourceFile)
Populates the KnowledgeBase with clauses defined in the file.
|
static void |
parseReader(KnowledgeBase kb,
Reader reader)
Populates the KnowledgeBase with clauses read from the Reader.
|
static void |
parseResource(KnowledgeBase kb,
String prologSourceResourceName)
Populates the KnowledgeBase with clauses defined in the specified resource.
|
public static void parseFile(KnowledgeBase kb, File prologSourceFile)
kb
- the KnowledgeBase to add the clauses toprologSourceFile
- source of the prolog syntax defining clauses to add to the KnowledgeBaseProjogException
- if there is any problem parsing the syntax or adding the new clauses to the KnowledgeBasepublic static void parseResource(KnowledgeBase kb, String prologSourceResourceName)
If prologSourceResourceName
refers to an existing file on the file system then that file is used as the
source of the prolog syntax else prologSourceResourceName
is read from the classpath.
kb
- the KnowledgeBase to add the clauses toprologSourceResourceName
- source of the prolog syntax defining clauses to add to the KnowledgeBaseProjogException
- if there is any problem parsing the syntax or adding the new clauses to the KnowledgeBasepublic static void parseReader(KnowledgeBase kb, Reader reader)
Note that this method will call close()
on the specified reader - regardless of whether this method
completes successfully or if an exception is thrown.
kb
- the KnowledgeBase to add the clauses toreader
- source of the prolog syntax defining clauses to add to the KnowledgeBaseProjogException
- if there is any problem parsing the syntax or adding the new clauses to the KnowledgeBaseCopyright © 2024. All rights reserved.