Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added capability to Store a KnowledgeBase into stream of bytes using io.Writer and read them back using io.Reader.
I hope, this will enable user to store huge KnowledgeBase rule-set into a binary file and
read that file back into KnowledgeBase when the application start in a much faster way.
To write a KnowledgeBase already loaded in KnowledgeLibrary
The name and version should be existing in the knowledge library.
To read a byte stream back using reader into KnowledgeLibrary
Or, if you're a hacking kind of guy, you can see
example/Serialization_test.go
to see how you can marshal/unmarshal a KnowlegeBase by hand.I have not add any documentation to help user on how to do this. Help is greatly apreciated.
Oh another thing, if you use an io.Writer and io.Reader as they are, the binary size is inflated 10x-20x fold due to lots of indexing happening for the rete and generated keys, etc. So, you can wrap those Writer/Reader with archive/zip counterpart.